If you create a new Chart wit the command helm create <chartName>
The Default Service Account will be created wrong:
Output of ServiceAccount yaml:
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "helmhart.serviceAccountName" . }}
labels:
{{- include "helmhart.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
{{- end }}
Expected:
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "helmhart.serviceAccountName" . }}
labels:
{{- include "helmhart.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
{{- end }}
Note that the automountServiceAccountToken is going under ServiceAccount.metadata.automountServiceAccountToken. Expected would be ServiceAccount.automountServiceAccountToken.
This will lead to the following Error:
Error: unable to build kubernetes objects from release manifest: error validating "": error validating data: ValidationError(ServiceAccount.metadata): unknown field "automountServiceAccountToken" in io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
Ref to the Kubernets Doc: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#opt-out-of-api-credential-automounting
Output of helm version:
version.BuildInfo{Version:"v3.13.0", GitCommit:"825e86f6a7a38cef1112bfa606e4127a706749b1", GitTreeState:"clean", GoVersion:"go1.21.1"}
If you create a new Chart wit the command
helm create <chartName>The Default Service Account will be created wrong:
Output of ServiceAccount yaml:
Expected:
Note that the automountServiceAccountToken is going under ServiceAccount.metadata.automountServiceAccountToken. Expected would be ServiceAccount.automountServiceAccountToken.
This will lead to the following Error:
Error: unable to build kubernetes objects from release manifest: error validating "": error validating data: ValidationError(ServiceAccount.metadata): unknown field "automountServiceAccountToken" in io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMetaRef to the Kubernets Doc: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#opt-out-of-api-credential-automounting
Output of
helm version:version.BuildInfo{Version:"v3.13.0", GitCommit:"825e86f6a7a38cef1112bfa606e4127a706749b1", GitTreeState:"clean", GoVersion:"go1.21.1"}