make securityContext optional

Signed-off-by: David J. M. Karlsen <david@davidkarlsen.com>
This commit is contained in:
David J. M. Karlsen 2019-12-12 09:39:58 +01:00
parent d283eb76ef
commit 59e91a411c
No known key found for this signature in database
GPG key ID: F54982D216088EE1
5 changed files with 9 additions and 0 deletions

View file

@ -35,7 +35,9 @@ spec:
{{- toYaml .Values.controller.podLabels | nindent 8 }} {{- toYaml .Values.controller.podLabels | nindent 8 }}
{{- end }} {{- end }}
spec: spec:
{{- if .Values.securityContext.enabled }}
securityContext: {{- toYaml .Values.global.securityContext | nindent 8 }} securityContext: {{- toYaml .Values.global.securityContext | nindent 8 }}
{{- end }}
containers: containers:
- command: - command:
- argocd-application-controller - argocd-application-controller

View file

@ -35,7 +35,9 @@ spec:
{{- toYaml .Values.controller.podLabels | nindent 8 }} {{- toYaml .Values.controller.podLabels | nindent 8 }}
{{- end }} {{- end }}
spec: spec:
{{- if .Values.securityContext.enabled }}
securityContext: {{- toYaml .Values.global.securityContext | nindent 8 }} securityContext: {{- toYaml .Values.global.securityContext | nindent 8 }}
{{- end }}
containers: containers:
- name: {{ .Values.repoServer.name }} - name: {{ .Values.repoServer.name }}
image: {{ default .Values.global.image.repository .Values.repoServer.image.repository }}:{{ default .Values.global.image.tag .Values.repoServer.image.tag }} image: {{ default .Values.global.image.repository .Values.repoServer.image.repository }}:{{ default .Values.global.image.tag .Values.repoServer.image.tag }}

View file

@ -35,7 +35,9 @@ spec:
{{- toYaml .Values.controller.podLabels | nindent 8 }} {{- toYaml .Values.controller.podLabels | nindent 8 }}
{{- end }} {{- end }}
spec: spec:
{{- if .Values.securityContext.enabled }}
securityContext: {{- toYaml .Values.global.securityContext | nindent 8 }} securityContext: {{- toYaml .Values.global.securityContext | nindent 8 }}
{{- end }}
containers: containers:
- name: {{ .Values.server.name }} - name: {{ .Values.server.name }}
image: {{ default .Values.global.image.repository .Values.server.image.repository }}:{{ default .Values.global.image.tag .Values.server.image.tag }} image: {{ default .Values.global.image.repository .Values.server.image.repository }}:{{ default .Values.global.image.tag .Values.server.image.tag }}

View file

@ -25,7 +25,9 @@ spec:
app.kubernetes.io/component: {{ .Values.redis.name }} app.kubernetes.io/component: {{ .Values.redis.name }}
spec: spec:
automountServiceAccountToken: false automountServiceAccountToken: false
{{- if .Values.securityContext.enabled }}
securityContext: {{- toYaml .Values.global.securityContext | nindent 8 }} securityContext: {{- toYaml .Values.global.securityContext | nindent 8 }}
{{- end }}
containers: containers:
- name: {{ template "argo-cd.redis.fullname" . }} - name: {{ template "argo-cd.redis.fullname" . }}
args: args:

View file

@ -13,6 +13,7 @@ global:
tag: v1.3.4 tag: v1.3.4
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
securityContext: securityContext:
enabled: true
runAsUser: 999 runAsUser: 999
runAsGroup: 999 runAsGroup: 999
fsGroup: 999 fsGroup: 999