-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add ability to edit non-common labels to kustomize CLI tool #5491
Comments
/area cli |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In response to this:
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-sigs/prow repository. |
Eschewed features
What would you like to have added?
It would be very helpful for the kustomize tool to have the ability to add/set the value of a label in the kustomization file. Currently,
kustomize edit set label
affectscommonLabels
, whose functionality may be undesirable due to its behavior of modifying selectors as well. Non-common labels fit the use case of adding labels to all objects and optionally their templates and selectors, however, there is no CLI capability currently to allow an edit of labels values without having to resort to using tools such as sed or scripted patch creation.Why is this needed?
It's a common use case to update the labels of kubernetes objects when deploying new releases of an application. Additionally, repeating labels throughout a series of kubernetes objects is a bit verbose. I am specifically attempting to solve for setting the
app.kubernetes.io/version
label on all objects I'm creating through kustomize, as well as adding thetags.datadoghq.com/version
label on a deployment and its template.Assigning the label and its value is easily accomplished using the labels functionality and patches or replacements, however, the value of the version may not be known until build-time.
To be clear, the intent of this request is not to templatize a kustomization project, but rather to update a kustomization file's label value. This follows the same pattern as setting the image tag through the command line using the
kustomize
CLI tool.Can you accomplish the motivating task without this feature, and if so, how?
Currently, other tools must be used to accomplish this functionality. Clever use of sed allows replacement of values on the command line, and generating dynamic patches on the command line also suffice. I would argue that these are not ideal, as the
kustomize
tool allows editing of various other components of akustomization
file as first-class citizens.What other solutions have you considered?
n/a
Anything else we should know?
The underlying intent of this request is to be able to modify the kustomize project in a CI/CD pipeline without having to resort to external tooling as mentioned above.
Feature ownership
The text was updated successfully, but these errors were encountered: