Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skipping nameprefix of some resource kinds #4722

Closed
hiteshgakhreja1234 opened this issue Jul 25, 2022 · 5 comments
Closed

skipping nameprefix of some resource kinds #4722

hiteshgakhreja1234 opened this issue Jul 25, 2022 · 5 comments
Labels
kind/support Categorizes issue or PR as a support question. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. triage/resolved Indicates an issue has been resolved or doesn't need to be resolved.

Comments

@hiteshgakhreja1234
Copy link

Hi All

is it possible to have kustomization file avoid adding prefixes to few resources

service
configmap
storageclass

I tried using this link but this is not working
https://stackoverflow.com/questions/69882949/kustomize-namesuffix-skip-on-some-resources

I tried creating a configuration file in kustomize and try skip: true but still its not behaving as expected
hgakhrej@C02G104NMD6M configuration % cat kustomizeconfig/skip-secrets-prefix.yaml
namePrefix:

  • path: metadata/name
    kind: Configmap
    skip: true
  • path: metadata/name
    apiVersion: v1
    kind: Service
    skip: true

I tried below example also but no luck
https://github.com/keleustes/kustomize/tree/allinone/examples/issues/issue_0519#preparation-step-resource0

Can anybody provice me some working example for this or anykind of workaround

@k8s-ci-robot k8s-ci-robot added needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jul 25, 2022
@k8s-ci-robot
Copy link
Contributor

@hiteshgakhreja1234: This issue is currently awaiting triage.

SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@annasong20
Copy link
Contributor

Hi @hiteshgakhreja1234,

I don't believe you can currently skip in kustomize, but you can specify all the kinds under configurations you'd like to apply namePrefix to other than the 3 (service, configmap, storageclass) you mentioned above. This is as instructed by the link you provided: https://stackoverflow.com/questions/69882949/kustomize-namesuffix-skip-on-some-resources

For example, on kustomize v4.5.7, with the following setup:
kustomization.yaml

resources:
- configmap.yaml
- secret.yaml

namePrefix: my-
configurations:
- prefix-rules.yaml

prefix-rules.yaml

namePrefix:
- path: metadata/name
  apiVersion: v1
  kind: Secret

configmap.yaml

apiVersion: v1
kind: ConfigMap
metadata:
  name: configmap

secret.yaml

apiVersion: v1
kind: Secret
metadata:
  name: secret

I get the following output running kustomize build:

apiVersion: v1
kind: ConfigMap
metadata:
  name: configmap
---
apiVersion: v1
kind: Secret
metadata:
  name: my-secret

@KnVerey KnVerey added kind/support Categorizes issue or PR as a support question. triage/resolved Indicates an issue has been resolved or doesn't need to be resolved. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Sep 22, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 21, 2022
@annasong20
Copy link
Contributor

/close
Please re-open if the response above is inadequate.

@k8s-ci-robot
Copy link
Contributor

@annasong20: Closing this issue.

In response to this:

/close
Please re-open if the response above is inadequate.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. triage/resolved Indicates an issue has been resolved or doesn't need to be resolved.
Projects
None yet
Development

No branches or pull requests

5 participants