-
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
kusomize.yaml preprocessing using environment #4673
Comments
@Aypahyo: 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 The 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. |
Thank you for filing the issue. Environment variables have limited support because they are (a) templating and (b) not reproducible, which are two of kustomize's founding design principles. Replacements is the intended solution for use cases such as yours, so it would be helpful if you could elaborate on why it doesn't work for you, and if there are any suggestions you have that align more with kustomize's philosophy. |
Thanks. On templating: connecting the environment to the execution is in line with 12 factor apps and also one of the things done in most if not all ci/cd pipelines. There is always some artifact or deployment target that was generated from environment variables. Getting these variables into my kustomize execution is currently supported. What I want is better support to do that. The implementation details do not matter that much. Templating, String Interpolation,.... there are options to handle how these variables are made available to the kustomize execution. On reproducible: Given a known environment context the output is predictable. Auditing could be a challenge since environments could contain secrets so these values should not be part of any log generic strategy. The only thing that should be controlled for is missing a key in env and values that are null / empty. At the moment there are two options to get environment variable in: c) backdoor through configmap d) cutom preprocessing. Arguably a) is already "violated". If one defines a template as containing a placeholder that is filled at runtime the config map fall through would be exactly that. Making that easy to use may make that template aspect more visible but it would not be a new aspect. The config map backdoor could be closed to remove that and in turn would break a bunch of customers who rely on this hidden templating. In every customer needs to implement their own |
I built a simple template option, so I can run it as a preprocessor to kustomize in order to easily replace values taken from the environemnt: https://github.com/Aypahyo/ayTempler |
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:
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 and PRs. This bot triages issues and PRs 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/test-infra repository. |
Is your feature request related to a problem? Please describe.
The common CI CD problem of using a hash value for container image tags creates the situation on all ci cd solutions where the used tag is available in the environemnt and needs to be processed by kustomize in very simple use cases where only an image needs a tag replacement. Instead of allowing the built in replacement feature to use environemnt variables the common solution is to import environment through a poorly documented fall through statement in config maps and utilize that as a source for the elaborate repalce feature.
I am very frustrated by not beeing able to replace my image tag by writing:
I would like the kustomization.yaml file to have a preprocessing step that replaces anything matched by
\$\{(?<ENVNAME>.+?)\}
with the contents of the ENVNAME varaible in the environement or write out a warning if the env did not match to anything.I considered using the replaceemnt feature but would rather remove my eyealls with a glowing hot spoon. I have also considered writing my own preprocessing using sed statements which is what I googled people end up doing - totally defeats the point og kustomize imo.
I an absolutely certain that I am not the only one who wants this feature - this may be end up beeing the single most popular feature in kustomize since it would be used in every single ci cd pipeline out there.
The text was updated successfully, but these errors were encountered: