1
votes

I have this section in my service template. I want, if variable publicIP is defined, define loadBalancerIP.

  {{- if .Values.publicIP }}
  loadBalancerIP: {{ .Values.publicIP }}
  {{- end }}  

in my values.$environment.yml

I define

publicIP: null

And I need to define publicIP when I do helm install, for example:

helm install release release/path -f values.$environment.yml  -—set publicIP=127.0.0.1

But it isn't working. What can I do to define publicIP and it defines in my template?

1
Does it take public ip as null ? Or blank? Also try --debug --dry-run to check if publicIP is getting passed as 127.0.0.1 - yogesh kunjir
Does 'helm template` with the same -f and --set options include the value? That template code seems correct. - David Maze

1 Answers

3
votes

I am not sure I understand the question but if you want to set an individual parameter you need to do it with

"--set"

eg : helm install --set foo=bar ./mychart


What is the name of your values.yml? values.$environment.yml? Try also command like this

helm install release release/path -f --values {YOUR_VALUES_FILE}.yml  --set publicIP=127.0.0.1

and be sure to use --, you seem in the example provided to use a weird special character much longer than a normal dash.

And second is publicIP a root parameter? if you have something like this in {YOUR_VALUES_FILE}.yml

root
  node: null

you need to set it like this :

helm install release release/path -f --values {YOUR_VALUES_FILE}.yml  --set root.node=value