Issue
In our Jenkins pipeline, I'm using a bash script to call the helm install
command. We have a values.yaml
containing most of the values to be passed to helm. However, few values are based upon environment variables
and have to be passed using the --set
argument. Here is the snippet:
helm install $RELEASE_NAME shared/phoenixmsp-app -f value.yaml \
--set global.env.production=$production \
--set global.cluster.hosts=${CONFIG[${CLUSTER_NAME}]} \
--set nameOverride=$RELEASE_NAME \
--set fullnameOverride=$RELEASE_NAME \
--set image.repository=myhelm.hub.mycloud.io/myrepo/mainservice \
--set-string image.tag=$DOCKER_TAG \
--wait --timeout 180s --namespace $APP_NAMESPACE"
We want to move these --set
parameters to values.yaml
. The goal is to get rid of --set
and simply pass the values.yaml
.
Question: Is it possible to expand Environment Variables in values.yaml
while calling with helm install
or helm upgrade
?
Solution
The only way I think you can do that, if you really want to use a single yaml is to have a template values.yaml
and either sed
the values into it or use a templating language like jinja
or mustache
, then feed the resulting output into helm.
Answered By - Blender Fox Answer Checked By - Willingham (WPSolving Volunteer)