Allow to disable containerSecurityContext

Add a `enabled` property to allow the whole containerSecurityContext to be disabled.
Fixes https://github.com/argoproj/argo-helm/issues/2071

Signed-off-by: wim.fournier <github@fournier.nl>
Signed-off-by: Wim Fournier <github@fournier.nl>
This commit is contained in:
Wim Fournier 2023-05-23 08:53:54 +02:00
parent 6593901daf
commit 59334a0d50
9 changed files with 34 additions and 3 deletions

View file

@ -3,7 +3,7 @@ appVersion: v2.7.2
kubeVersion: ">=1.22.0-0" kubeVersion: ">=1.22.0-0"
description: A Helm chart for Argo CD, a declarative, GitOps continuous delivery tool for Kubernetes. description: A Helm chart for Argo CD, a declarative, GitOps continuous delivery tool for Kubernetes.
name: argo-cd name: argo-cd
version: 5.34.3 version: 5.34.4
home: https://github.com/argoproj/argo-helm home: https://github.com/argoproj/argo-helm
icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png
sources: sources:
@ -27,4 +27,4 @@ annotations:
url: https://argoproj.github.io/argo-helm/pgp_keys.asc url: https://argoproj.github.io/argo-helm/pgp_keys.asc
artifacthub.io/changes: | artifacthub.io/changes: |
- kind: fixed - kind: fixed
description: Align with upstream dex initContainers description: Allow to disable containerSecurityContext

View file

@ -255,8 +255,10 @@ spec:
failureThreshold: {{ .Values.controller.readinessProbe.failureThreshold }} failureThreshold: {{ .Values.controller.readinessProbe.failureThreshold }}
resources: resources:
{{- toYaml .Values.controller.resources | nindent 10 }} {{- toYaml .Values.controller.resources | nindent 10 }}
{{- if .Values.controller.containerSecurityContext.enabled }}
securityContext: securityContext:
{{- toYaml .Values.controller.containerSecurityContext | nindent 10 }} {{- toYaml .Values.controller.containerSecurityContext | nindent 10 }}
{{- end }}
workingDir: /home/argocd workingDir: /home/argocd
volumeMounts: volumeMounts:
{{- with .Values.controller.volumeMounts }} {{- with .Values.controller.volumeMounts }}

View file

@ -182,8 +182,10 @@ spec:
{{- end }} {{- end }}
resources: resources:
{{- toYaml .Values.applicationSet.resources | nindent 12 }} {{- toYaml .Values.applicationSet.resources | nindent 12 }}
{{- if .Values.applicationSet.containerSecurityContext.enabled }}
securityContext: securityContext:
{{- toYaml .Values.applicationSet.containerSecurityContext | nindent 12 }} {{- toYaml .Values.applicationSet.containerSecurityContext | nindent 12 }}
{{- end }}
volumeMounts: volumeMounts:
{{- with .Values.applicationSet.extraVolumeMounts }} {{- with .Values.applicationSet.extraVolumeMounts }}
{{- toYaml . | nindent 12 }} {{- toYaml . | nindent 12 }}

View file

@ -80,8 +80,10 @@ spec:
protocol: TCP protocol: TCP
resources: resources:
{{- toYaml .Values.notifications.resources | nindent 12 }} {{- toYaml .Values.notifications.resources | nindent 12 }}
{{- if .Values.notifications.containerSecurityContext.enabled }}
securityContext: securityContext:
{{- toYaml .Values.notifications.containerSecurityContext | nindent 12 }} {{- toYaml .Values.notifications.containerSecurityContext | nindent 12 }}
{{- end }}
workingDir: /app workingDir: /app
volumeMounts: volumeMounts:
- name: tls-certs - name: tls-certs

View file

@ -273,8 +273,10 @@ spec:
failureThreshold: {{ .Values.repoServer.readinessProbe.failureThreshold }} failureThreshold: {{ .Values.repoServer.readinessProbe.failureThreshold }}
resources: resources:
{{- toYaml .Values.repoServer.resources | nindent 10 }} {{- toYaml .Values.repoServer.resources | nindent 10 }}
{{- if .Values.repoServer.containerSecurityContext.enabled }}
securityContext: securityContext:
{{- toYaml .Values.repoServer.containerSecurityContext | nindent 10 }} {{- toYaml .Values.repoServer.containerSecurityContext | nindent 10 }}
{{- end }}
{{- with .Values.repoServer.lifecycle }} {{- with .Values.repoServer.lifecycle }}
lifecycle: lifecycle:
{{- toYaml . | nindent 10 }} {{- toYaml . | nindent 10 }}
@ -295,10 +297,12 @@ spec:
resources: resources:
{{- toYaml . | nindent 10 }} {{- toYaml . | nindent 10 }}
{{- end }} {{- end }}
{{- if .Values.repoServer.containerSecurityContext.enabled }}
{{- with .Values.repoServer.containerSecurityContext }} {{- with .Values.repoServer.containerSecurityContext }}
securityContext: securityContext:
{{- toYaml . | nindent 10 }} {{- toYaml . | nindent 10 }}
{{- end }} {{- end }}
{{- end }}
volumeMounts: volumeMounts:
- mountPath: /var/run/argocd - mountPath: /var/run/argocd
name: var-files name: var-files

View file

@ -334,8 +334,10 @@ spec:
failureThreshold: {{ .Values.server.readinessProbe.failureThreshold }} failureThreshold: {{ .Values.server.readinessProbe.failureThreshold }}
resources: resources:
{{- toYaml .Values.server.resources | nindent 10 }} {{- toYaml .Values.server.resources | nindent 10 }}
{{- if .Values.repoServer.containerSecurityContext.enabled }}
securityContext: securityContext:
{{- toYaml .Values.server.containerSecurityContext | nindent 10 }} {{- toYaml .Values.repoServer.containerSecurityContext | nindent 10 }}
{{- end }}
{{- with .Values.server.lifecycle }} {{- with .Values.server.lifecycle }}
lifecycle: lifecycle:
{{- toYaml . | nindent 10 }} {{- toYaml . | nindent 10 }}
@ -346,8 +348,10 @@ spec:
imagePullPolicy: {{ .Values.server.extensions.image.imagePullPolicy }} imagePullPolicy: {{ .Values.server.extensions.image.imagePullPolicy }}
resources: resources:
{{- toYaml .Values.server.extensions.resources | nindent 10 }} {{- toYaml .Values.server.extensions.resources | nindent 10 }}
{{- if .Values.server.extensions.containerSecurityContext.enabled }}
securityContext: securityContext:
{{- toYaml .Values.server.extensions.containerSecurityContext | nindent 10 }} {{- toYaml .Values.server.extensions.containerSecurityContext | nindent 10 }}
{{-end }}
volumeMounts: volumeMounts:
- name: extensions - name: extensions
mountPath: /tmp/extensions/ mountPath: /tmp/extensions/

View file

@ -117,8 +117,10 @@ spec:
{{- end }} {{- end }}
resources: resources:
{{- toYaml .Values.dex.resources | nindent 10 }} {{- toYaml .Values.dex.resources | nindent 10 }}
{{- if .Values.dex.containerSecurityContext.enabled }}
securityContext: securityContext:
{{- toYaml .Values.dex.containerSecurityContext | nindent 10 }} {{- toYaml .Values.dex.containerSecurityContext | nindent 10 }}
{{- end }}
volumeMounts: volumeMounts:
{{- with .Values.dex.volumeMounts }} {{- with .Values.dex.volumeMounts }}
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
@ -148,8 +150,10 @@ spec:
name: dexconfig name: dexconfig
resources: resources:
{{- toYaml .Values.dex.resources | nindent 10 }} {{- toYaml .Values.dex.resources | nindent 10 }}
{{- if .Values.dex.containerSecurityContext.enabled }}
securityContext: securityContext:
{{- toYaml .Values.dex.containerSecurityContext | nindent 10 }} {{- toYaml .Values.dex.containerSecurityContext | nindent 10 }}
{{- end}}
{{- with .Values.dex.initContainers }} {{- with .Values.dex.initContainers }}
{{- tpl (toYaml .) $ | nindent 6 }} {{- tpl (toYaml .) $ | nindent 6 }}
{{- end }} {{- end }}

View file

@ -75,8 +75,10 @@ spec:
protocol: TCP protocol: TCP
resources: resources:
{{- toYaml .Values.redis.resources | nindent 10 }} {{- toYaml .Values.redis.resources | nindent 10 }}
{{- if .Values.redis.containerSecurityContext.enabled }}
securityContext: securityContext:
{{- toYaml .Values.redis.containerSecurityContext | nindent 10 }} {{- toYaml .Values.redis.containerSecurityContext | nindent 10 }}
{{- end }}
{{- with .Values.redis.volumeMounts }} {{- with .Values.redis.volumeMounts }}
volumeMounts: volumeMounts:
{{- toYaml . | nindent 10 }} {{- toYaml . | nindent 10 }}
@ -99,8 +101,10 @@ spec:
protocol: TCP protocol: TCP
resources: resources:
{{- toYaml .Values.redis.exporter.resources | nindent 10 }} {{- toYaml .Values.redis.exporter.resources | nindent 10 }}
{{- if .Values.redis.exporter.containerSecurityContext.enabled }}
securityContext: securityContext:
{{- toYaml .Values.redis.exporter.containerSecurityContext | nindent 10 }} {{- toYaml .Values.redis.exporter.containerSecurityContext | nindent 10 }}
{{- end }}
{{- end }} {{- end }}
{{- with .Values.redis.extraContainers }} {{- with .Values.redis.extraContainers }}
{{- tpl (toYaml .) $ | nindent 6 }} {{- tpl (toYaml .) $ | nindent 6 }}

View file

@ -699,6 +699,7 @@ controller:
# -- Application controller container-level security context # -- Application controller container-level security context
# @default -- See [values.yaml] # @default -- See [values.yaml]
containerSecurityContext: containerSecurityContext:
enabled: true
runAsNonRoot: true runAsNonRoot: true
readOnlyRootFilesystem: true readOnlyRootFilesystem: true
allowPrivilegeEscalation: false allowPrivilegeEscalation: false
@ -1017,6 +1018,7 @@ dex:
# -- Dex container-level security context # -- Dex container-level security context
# @default -- See [values.yaml] # @default -- See [values.yaml]
containerSecurityContext: containerSecurityContext:
enabled: true
runAsNonRoot: true runAsNonRoot: true
readOnlyRootFilesystem: true readOnlyRootFilesystem: true
allowPrivilegeEscalation: false allowPrivilegeEscalation: false
@ -1168,6 +1170,7 @@ redis:
# -- Redis exporter security context # -- Redis exporter security context
# @default -- See [values.yaml] # @default -- See [values.yaml]
containerSecurityContext: containerSecurityContext:
enabled: true
runAsNonRoot: true runAsNonRoot: true
readOnlyRootFilesystem: true readOnlyRootFilesystem: true
allowPrivilegeEscalation: false allowPrivilegeEscalation: false
@ -1261,6 +1264,7 @@ redis:
# -- Redis container-level security context # -- Redis container-level security context
# @default -- See [values.yaml] # @default -- See [values.yaml]
containerSecurityContext: containerSecurityContext:
enabled: true
allowPrivilegeEscalation: false allowPrivilegeEscalation: false
capabilities: capabilities:
drop: drop:
@ -1524,6 +1528,7 @@ server:
# -- Server UI extensions container-level security context # -- Server UI extensions container-level security context
# @default -- See [values.yaml] # @default -- See [values.yaml]
containerSecurityContext: containerSecurityContext:
enabled: true
runAsNonRoot: true runAsNonRoot: true
readOnlyRootFilesystem: true readOnlyRootFilesystem: true
allowPrivilegeEscalation: false allowPrivilegeEscalation: false
@ -1628,6 +1633,7 @@ server:
# -- Server container-level security context # -- Server container-level security context
# @default -- See [values.yaml] # @default -- See [values.yaml]
containerSecurityContext: containerSecurityContext:
enabled: true
runAsNonRoot: true runAsNonRoot: true
readOnlyRootFilesystem: true readOnlyRootFilesystem: true
allowPrivilegeEscalation: false allowPrivilegeEscalation: false
@ -2159,6 +2165,7 @@ repoServer:
# -- Repo server container-level security context # -- Repo server container-level security context
# @default -- See [values.yaml] # @default -- See [values.yaml]
containerSecurityContext: containerSecurityContext:
enabled: true
runAsNonRoot: true runAsNonRoot: true
readOnlyRootFilesystem: true readOnlyRootFilesystem: true
allowPrivilegeEscalation: false allowPrivilegeEscalation: false
@ -2512,6 +2519,7 @@ applicationSet:
# -- ApplicationSet controller container-level security context # -- ApplicationSet controller container-level security context
# @default -- See [values.yaml] # @default -- See [values.yaml]
containerSecurityContext: containerSecurityContext:
enabled: true
runAsNonRoot: true runAsNonRoot: true
readOnlyRootFilesystem: true readOnlyRootFilesystem: true
allowPrivilegeEscalation: false allowPrivilegeEscalation: false
@ -2850,6 +2858,7 @@ notifications:
# -- Notification controller container-level security Context # -- Notification controller container-level security Context
# @default -- See [values.yaml] # @default -- See [values.yaml]
containerSecurityContext: containerSecurityContext:
enabled: true
runAsNonRoot: true runAsNonRoot: true
readOnlyRootFilesystem: true readOnlyRootFilesystem: true
allowPrivilegeEscalation: false allowPrivilegeEscalation: false