0

I have been trying to add automountServiceAccountToken: false into deployment using helm but my changes are reflecting inside deployment in kubernetes.

I tried below in helpers.tpl

{{- "<chart-name>.automountserviceaccounttoken" }}
{{- default "false" .Values.automountserviceaccounttoken.name }}
{{- end }}

in app-deployment.yaml

automountServiceAccountToken: {{- include "<chart-name>.automountserviceaccounttoken" . }}

in values.yaml

automountServiceAccountToken: false

But I can't see the changes. Please guide

David Maze
  • 130,717
  • 29
  • 175
  • 215
  • Having made these changes locally, are you running `helm upgrade` to deploy them? Does the added line show up in `helm template` output? – David Maze Feb 08 '23 at 11:35
  • helm template is okay. I am trying to fix security things. so we need to disable service account mount. – Ravindra Kumar Feb 09 '23 at 10:26

1 Answers1

0

You can give a try with following troubleshooting steps

  1. In the helpers.tpl file you are taking the automountserviceaccounttoken value from the values.yaml. In values.yaml you metnioned automountserviceaccounttoken:false but in the tpl file you are accesing the value like automountserviceaccounttoken.name there is no attribute called name under automountserviceaccounttoken in values file. Although you are using default value in function sometimes it may not include it. So correct he value in values.yaml.
  2. Debug the deployed heml chart by using a command $helm template template-name. It will download the generated helm template along with values. Check whether your desired values are reflecting or not.
  3. In case you are redeploying the chart try upgrading it by $helm upgrade [RELEASE] [CHART] and make sure your values are reflecting.
  4. Before installing the helm chart running with dry-run will give us the templates with compiled values. So using dry run will helps to confirm the templates. Command for dry-run $helm install chart-name . --dry-run

Fore more information refer to official document