Skip to content

Commit

Permalink
Add the option to opt out of service account token automounting and a…
Browse files Browse the repository at this point in the history
…llow for volumes to be mountedd to mount the token manually (#89)
  • Loading branch information
gilles-gosuin committed Dec 22, 2023
1 parent 23b2d7d commit f2ee137
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ spec:
labels:
{{- include "kubernetes-secret-generator.selectorLabels" . | nindent 8 }}
spec:
{{- if hasKey .Values "automountServiceAccountToken" }}
automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
{{- end }}
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName | quote}}
{{- end }}
Expand Down Expand Up @@ -67,6 +70,7 @@ spec:
value: {{ .Values.useMetricsService | quote }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts: {{ .Values.volumeMounts | toYaml | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand All @@ -79,3 +83,4 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes: {{ .Values.volumes | toYaml | nindent 8 }}
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
{{- if hasKey .Values.serviceAccount "automountServiceAccountToken" }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
{{- end }}
metadata:
name: {{ include "kubernetes-secret-generator.serviceAccountName" . }}
labels:
Expand Down
7 changes: 7 additions & 0 deletions deploy/helm-chart/kubernetes-secret-generator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ nameOverride: ""
fullnameOverride: ""
deploymentStrategy: "Recreate"

automountServiceAccountToken:

serviceAccount:
automountServiceAccountToken:
# Specifies whether a service account should be created
create: true
# The name of the service account to use.
Expand Down Expand Up @@ -66,6 +69,10 @@ watchNamespace: ""

useMetricsService: false

volumeMounts: []

volumes: []

# RBAC parameteres
# https://kubernetes.io/docs/reference/access-authn-authz/rbac/
rbac:
Expand Down

0 comments on commit f2ee137

Please sign in to comment.