Search code examples
kuberneteskubernetes-helmkubernetes-ingress

How to pass variables to helm install --set parameters


I want to know if it is possible to pass variables to an helm install command's set parameter. Below is an example of what I'm looking to achieve.

appgw_name = "myappgateway"
export appgw_name
helm install applicationgw application-gateway-kubernetes-ingress/ingress-azure --set appgw.name=$appgw_name

I'm executing the above two lines as a shell script and when I try to execute them I get the below error:

Error: execution error at (ingress-azure/templates/configmap.yaml): Please either provide appgw.applicationGatewayID or appgw.name.


Solution

  • Solved it. Was just a few spacings that had to be altered. The issue was with bash and had nothing to do with helm. So this is how I finally declared the variables export appgw_name="myappgateway" Just removed all the spaces and that's it. It worked like charm.