Helm values string to boolean

4.4k Views Asked by At

new to helm and templating. I have a helm value file which needs to refer the value from another common values file.

enabled:  "{{ .Values.common.service.enabled }}"

and the output i expect is

enabled: false but i always get with the quotes

enabled: "false"

The common values file

service:
  enabled : "false"

Have tried toYaml but still same

enabled:  "{{ .Values.common.service.enabled | toYaml }}"
```
`
1

There are 1 best solutions below

2
Alez On

You're receving the quotes because you wrote the quote in the declaration of the component. Instead, the component definition yaml is:

enabled: {{ .Values.common.service.enabled }}

and the values.yaml:

common:
  service:
    enabled: false