I am trying to deploy an application using Helm, and I would like to be able to use a system environment variable in my helm chart.
I have a server with the following environment variable set:
server1 :~$ env
USER=build
In my values file, I would like to do something like this:
home:
user: {{ env "USER" }}
So when I use values.home.user in my yaml files, it expands to "build" (or whatever is set as the system environment variable).
Is there a way to do this?
envfunction is explicitly disabled. Does one of the workarounds in How to pull environment variables with Helm charts help you? You also might find it easier to set up your CI system to write settings to a YAML (or equivalently JSON) file, without trying to manage thehelmprocess's environment.