Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pod SA, disable automount SA tokens #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion charts/simple/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,12 @@ imagePullSecrets:
- name: {{ .Release.Name }}-registry
{{- end }}
{{- end }}
{{- end }}
{{- end }}

{{- define "simple.serviceAccountName" }}
{{- if .Values.serviceAccount.name }}
{{- .Values.serviceAccount.name }}
{{- else }}
{{- .Release.Name }}-sa
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/simple/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ spec:
resources:
{{- .Values.signalsciences.resources | toYaml | nindent 10 }}
{{- end }}

serviceAccountName: {{ include "simple.serviceAccountName" . }}
volumes:
- name: nginx-conf
configMap:
Expand Down
8 changes: 8 additions & 0 deletions charts/simple/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Release.Name }}-sa
labels:
{{ include "simple.release_labels" . | indent 4 }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
{{- include "simple.imagePullSecrets" . }}
8 changes: 8 additions & 0 deletions charts/simple/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
"branchName": { "type": "string" },
"imagePullSecrets": { "type": "array" },
"imagePullSecret": { "type": "string" },
"serviceAccount": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": { "type": "string" },
"automountServiceAccountToken": { "type": "boolean" }
}
},
"app": { "type": "string" },
"silta-release": { "type": "object" },
"replicas": { "type": "integer" },
Expand Down
6 changes: 6 additions & 0 deletions charts/simple/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ imagePullSecrets: []
# Custom imagePullSecret for the containers. Base64 encoded. This will create a secret and append it to the imagePullSecrets.
imagePullSecret: ""

serviceAccount:
# Default value: [Release.Name]-sa
name: ""
# Mount service account token to the containers.
automountServiceAccountToken: false

# The app label added to our Kubernetes resources.
app: simple

Expand Down