Skip to content

Commit a07abc3

Browse files
MINOR: haproxy: Define automountServiceAccountToken on Deployment and DaemonSet (#319)
In some case, automountServiceAccountToken can be set to false by default even if ServiceAccount defines it as true By defining automountServiceAccountToken in the Deployment/DaemonSet, it will work in all case.
1 parent ae0a5e1 commit a07abc3

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

haproxy/templates/daemonset.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ spec:
5353
shareProcessNamespace: true
5454
{{- end }}
5555
serviceAccountName: {{ include "haproxy.serviceAccountName" . }}
56+
{{- if hasKey .Values.serviceAccount "automountServiceAccountToken" }}
57+
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
58+
{{- end }}
5659
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
5760
{{- if $useHostNetwork }}
5861
hostNetwork: true

haproxy/templates/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ spec:
6060
shareProcessNamespace: true
6161
{{- end }}
6262
serviceAccountName: {{ include "haproxy.serviceAccountName" . }}
63+
{{- if hasKey .Values.serviceAccount "automountServiceAccountToken" }}
64+
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
65+
{{- end }}
6366
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
6467
securityContext:
6568
{{- toYaml .Values.podSecurityContext | nindent 8 }}

kubernetes-ingress/templates/controller-daemonset.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ spec:
6060
spec:
6161
enableServiceLinks: {{ .Values.controller.enableServiceLinks }}
6262
serviceAccountName: {{ include "kubernetes-ingress.serviceAccountName" . }}
63+
{{- if hasKey .Values.serviceAccount "automountServiceAccountToken" }}
64+
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
65+
{{- end }}
6366
terminationGracePeriodSeconds: {{ .Values.controller.terminationGracePeriodSeconds }}
6467
{{- if $useHostNetwork }}
6568
hostNetwork: true

kubernetes-ingress/templates/controller-deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ spec:
5959
spec:
6060
enableServiceLinks: {{ .Values.controller.enableServiceLinks }}
6161
serviceAccountName: {{ include "kubernetes-ingress.serviceAccountName" . }}
62+
{{- if hasKey .Values.serviceAccount "automountServiceAccountToken" }}
63+
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
64+
{{- end }}
6265
terminationGracePeriodSeconds: {{ .Values.controller.terminationGracePeriodSeconds }}
6366
{{- with .Values.controller.topologySpreadConstraints }}
6467
topologySpreadConstraints:

0 commit comments

Comments
 (0)