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

Access "-f" Filename(s) #12951

Open
pombaer opened this issue Apr 16, 2024 · 0 comments
Open

Access "-f" Filename(s) #12951

pombaer opened this issue Apr 16, 2024 · 0 comments
Labels

Comments

@pombaer
Copy link

pombaer commented Apr 16, 2024

Hallo, this is not a bug rather a feature request.

I tried to find a way to make a simple environment specific configuration with helm. My goal was to run helm like
helm install -f myfile.yaml ...
I want to apply templates depending on my environments to kubernetes, so i was looking for a variable holding the filename (or list of files) from the -f/--values parameter so i could simply define a condition at the beginning of my templates like:
{{ if eq .<variable> "myfile.yaml" }} (may syntax is not 100% ok, but you know what i mean ;) )
or
{{if has .<variable> "myfile.yaml" }} (may syntax is not 100% ok, but you know what i mean ;) )

I found no way to get filenames of the -f parameter, is there a way or is there a other simple way to achieve this goal?
I found some solutions with ex. helmfile and workarrounds with printf, but all solutions add complexity to the deployments.
For now my workaround uses the "--set" parameter, but i don't like the duplicate definition: -f mycluster.yaml --set cluster=mycluster
{{ if eq .Values.cluster "myfile.yaml" }}

Is there a reason why the -f parameter is not available in helm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants