Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unset/remove default value in helm values.yaml

I have a downloaded file through helm inspect called sftp.yaml

I have a parameter in that sftp.yaml file:-

sftp:
    allowedMACs: "hmac-sha2-512"
    allowedCiphers: aes256-ctr

Now if i install the corresponding helm chart after commenting out the entire line of "allowedMACs" from custom values files i.e. "sftp.yaml", then K8s takes the delta of sftp.yaml and the actual values.yaml and then use values.yaml's "allowedMACs".

However What i want is if "allowedMACs" line is commented in "sftp.yaml" custom values file, then it should not set the env variable at all, or sets it as null.

presently my deployment file's env section looks like

  - name: MACs
    value: {{ default "" .Values.sftp.allowedMACs | quote }}
like image 840
Ankit Sharma Avatar asked Sep 06 '20 17:09

Ankit Sharma


1 Answers

You need to either override (with new value) or unset the value, if you only comment out the section you are not doing any of the above and the default value is going to be used.

Basically you are looking to unset a default value. As per banzaicloud example this can be done like so:

helm install stable/chart-name --set sftp.allowedMACs=null

You can also use override value file in a similar way:

sftp:
    allowedMACs: null
    allowedCiphers: aes256-ctr

This is available in Helm since version 2.6. If you like in-depth information you can review the issue and the subsequent PR that introduced the feature.

like image 190
Filip Nikolov Avatar answered Nov 15 '22 10:11

Filip Nikolov