feat(argo-cd): Allow templated values for init and extra containers (#1749)

This commit is contained in:
Petr Drastil 2023-01-10 13:31:57 +01:00 committed by GitHub
parent c5648d5c9f
commit 31242020c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 128 additions and 93 deletions

View file

@ -3,7 +3,7 @@ appVersion: v2.5.5
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.16.15 version: 5.17.0
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:
@ -23,7 +23,6 @@ dependencies:
condition: redis-ha.enabled condition: redis-ha.enabled
annotations: annotations:
artifacthub.io/changes: | artifacthub.io/changes: |
- "[Added]: Option createClusterRoles to enable cluster roles from one place" - "[Added]: Support for extraContainers and initContainers for applicationSet and notifications"
- "[Deprecated]: Option controller.clusterAdminAccess.enabled" - "[Added]: Support for use of Helm templates for extraContainers and initContainers"
- "[Deprecated]: Option server.clusterAdminAccess.enabled" - "[Docs]: Added notes about custom Helm template support"
- "[Deprecated]: Option repoServer.clusterAdminAccess.enabled"

View file

@ -970,6 +970,7 @@ If you want to use an existing Redis (eg. a managed service from a cloud provide
| applicationSet.image.repository | string | `""` (defaults to global.image.repository) | Repository to use for the ApplicationSet controller | | applicationSet.image.repository | string | `""` (defaults to global.image.repository) | Repository to use for the ApplicationSet controller |
| applicationSet.image.tag | string | `""` (defaults to global.image.tag) | Tag to use for the ApplicationSet controller | | applicationSet.image.tag | string | `""` (defaults to global.image.tag) | Tag to use for the ApplicationSet controller |
| applicationSet.imagePullSecrets | list | `[]` (defaults to global.imagePullSecrets) | If defined, uses a Secret to pull an image from a private Docker registry or repository. | | applicationSet.imagePullSecrets | list | `[]` (defaults to global.imagePullSecrets) | If defined, uses a Secret to pull an image from a private Docker registry or repository. |
| applicationSet.initContainers | list | `[]` | Init containers to add to the ApplicationSet controller pod |
| applicationSet.livenessProbe.enabled | bool | `false` | Enable Kubernetes liveness probe for ApplicationSet controller | | applicationSet.livenessProbe.enabled | bool | `false` | Enable Kubernetes liveness probe for ApplicationSet controller |
| applicationSet.livenessProbe.failureThreshold | int | `3` | Minimum consecutive failures for the [probe] to be considered failed after having succeeded | | applicationSet.livenessProbe.failureThreshold | int | `3` | Minimum consecutive failures for the [probe] to be considered failed after having succeeded |
| applicationSet.livenessProbe.initialDelaySeconds | int | `10` | Number of seconds after the container has started before [probe] is initiated | | applicationSet.livenessProbe.initialDelaySeconds | int | `10` | Number of seconds after the container has started before [probe] is initiated |
@ -1063,6 +1064,7 @@ If you want to use an existing Redis (eg. a managed service from a cloud provide
| notifications.deploymentAnnotations | object | `{}` | Annotations to be applied to the notifications controller Deployment | | notifications.deploymentAnnotations | object | `{}` | Annotations to be applied to the notifications controller Deployment |
| notifications.enabled | bool | `true` | Enable notifications controller | | notifications.enabled | bool | `true` | Enable notifications controller |
| notifications.extraArgs | list | `[]` | Extra arguments to provide to the notifications controller | | notifications.extraArgs | list | `[]` | Extra arguments to provide to the notifications controller |
| notifications.extraContainers | list | `[]` | Additional containers to be added to the notifications controller pod |
| notifications.extraEnv | list | `[]` | Additional container environment variables | | notifications.extraEnv | list | `[]` | Additional container environment variables |
| notifications.extraEnvFrom | list | `[]` (See [values.yaml]) | envFrom to pass to the notifications controller | | notifications.extraEnvFrom | list | `[]` (See [values.yaml]) | envFrom to pass to the notifications controller |
| notifications.extraVolumeMounts | list | `[]` | List of extra mounts to add (normally used with extraVolumes) | | notifications.extraVolumeMounts | list | `[]` | List of extra mounts to add (normally used with extraVolumes) |
@ -1071,6 +1073,7 @@ If you want to use an existing Redis (eg. a managed service from a cloud provide
| notifications.image.repository | string | `""` (defaults to global.image.repository) | Repository to use for the notifications controller | | notifications.image.repository | string | `""` (defaults to global.image.repository) | Repository to use for the notifications controller |
| notifications.image.tag | string | `""` (defaults to global.image.tag) | Tag to use for the notifications controller | | notifications.image.tag | string | `""` (defaults to global.image.tag) | Tag to use for the notifications controller |
| notifications.imagePullSecrets | list | `[]` (defaults to global.imagePullSecrets) | Secrets with credentials to pull images from a private registry | | notifications.imagePullSecrets | list | `[]` (defaults to global.imagePullSecrets) | Secrets with credentials to pull images from a private registry |
| notifications.initContainers | list | `[]` | Init containers to add to the notifications controller pod |
| notifications.logFormat | string | `""` (defaults to global.logging.format) | Notifications controller log format. Either `text` or `json` | | notifications.logFormat | string | `""` (defaults to global.logging.format) | Notifications controller log format. Either `text` or `json` |
| notifications.logLevel | string | `""` (defaults to global.logging.level) | Notifications controller log level. One of: `debug`, `info`, `warn`, `error` | | notifications.logLevel | string | `""` (defaults to global.logging.level) | Notifications controller log level. One of: `debug`, `info`, `warn`, `error` |
| notifications.metrics.enabled | bool | `false` | Enables prometheus metrics server | | notifications.metrics.enabled | bool | `false` | Enables prometheus metrics server |

View file

@ -257,7 +257,11 @@ spec:
- mountPath: /home/argocd - mountPath: /home/argocd
name: argocd-home name: argocd-home
{{- with .Values.controller.extraContainers }} {{- with .Values.controller.extraContainers }}
{{- toYaml . | nindent 6 }} {{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- with .Values.controller.initContainers }}
initContainers:
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }} {{- end }}
{{- with .Values.controller.nodeSelector }} {{- with .Values.controller.nodeSelector }}
nodeSelector: nodeSelector:
@ -304,10 +308,6 @@ spec:
path: tls.key path: tls.key
- key: ca.crt - key: ca.crt
path: ca.crt path: ca.crt
{{- with .Values.controller.initContainers }}
initContainers:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.controller.priorityClassName }} {{- with .Values.controller.priorityClassName }}
priorityClassName: {{ . }} priorityClassName: {{ . }}
{{- end }} {{- end }}

View file

@ -125,7 +125,11 @@ spec:
- mountPath: /tmp - mountPath: /tmp
name: tmp name: tmp
{{- with .Values.applicationSet.extraContainers }} {{- with .Values.applicationSet.extraContainers }}
{{- toYaml . | nindent 8 }} {{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.applicationSet.initContainers }}
initContainers:
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }} {{- end }}
{{- with .Values.applicationSet.nodeSelector }} {{- with .Values.applicationSet.nodeSelector }}
nodeSelector: nodeSelector:

View file

@ -81,23 +81,12 @@ spec:
{{- with .Values.notifications.extraVolumeMounts }} {{- with .Values.notifications.extraVolumeMounts }}
{{- toYaml . | nindent 12 }} {{- toYaml . | nindent 12 }}
{{- end }} {{- end }}
volumes: {{- with .Values.notifications.extraContainers }}
- configMap: {{- tpl (toYaml . ) $ | nindent 8 }}
name: argocd-tls-certs-cm {{- end }}
name: tls-certs {{- with .Values.notifications.initContainers }}
- name: argocd-repo-server-tls initContainers:
secret: {{- tpl (toYaml . ) $ | nindent 8 }}
items:
- key: tls.crt
path: tls.crt
- key: tls.key
path: tls.key
- key: ca.crt
path: ca.crt
optional: true
secretName: argocd-repo-server-tls
{{- with .Values.notifications.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
{{- with .Values.notifications.nodeSelector }} {{- with .Values.notifications.nodeSelector }}
nodeSelector: nodeSelector:
@ -114,4 +103,22 @@ spec:
{{- with .Values.notifications.priorityClassName }} {{- with .Values.notifications.priorityClassName }}
priorityClassName: {{ . }} priorityClassName: {{ . }}
{{- end }} {{- end }}
volumes:
{{- with .Values.notifications.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
- name: tls-certs
configMap:
name: argocd-tls-certs-cm
- name: argocd-repo-server-tls
secret:
secretName: argocd-repo-server-tls
optional: true
items:
- key: tls.crt
path: tls.crt
- key: tls.key
path: tls.key
- key: ca.crt
path: ca.crt
{{- end }} {{- end }}

View file

@ -264,7 +264,30 @@ spec:
securityContext: securityContext:
{{- toYaml .Values.repoServer.containerSecurityContext | nindent 10 }} {{- toYaml .Values.repoServer.containerSecurityContext | nindent 10 }}
{{- with .Values.repoServer.extraContainers }} {{- with .Values.repoServer.extraContainers }}
{{- toYaml . | nindent 6 }} {{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
initContainers:
- command:
- cp
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: {{ default .Values.global.image.repository .Values.repoServer.image.repository }}:{{ default (include "argo-cd.defaultTag" .) .Values.repoServer.image.tag }}
imagePullPolicy: {{ default .Values.global.image.imagePullPolicy .Values.repoServer.image.imagePullPolicy }}
name: copyutil
{{- with .Values.repoServer.resources }}
resources:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.repoServer.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
volumeMounts:
- mountPath: /var/run/argocd
name: var-files
{{- with .Values.repoServer.initContainers }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }} {{- end }}
{{- with .Values.repoServer.nodeSelector }} {{- with .Values.repoServer.nodeSelector }}
nodeSelector: nodeSelector:
@ -328,29 +351,6 @@ spec:
path: tls.key path: tls.key
- key: ca.crt - key: ca.crt
path: ca.crt path: ca.crt
initContainers:
- command:
- cp
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: {{ default .Values.global.image.repository .Values.repoServer.image.repository }}:{{ default (include "argo-cd.defaultTag" .) .Values.repoServer.image.tag }}
imagePullPolicy: {{ default .Values.global.image.imagePullPolicy .Values.repoServer.image.imagePullPolicy }}
name: copyutil
{{- with .Values.repoServer.resources }}
resources:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.repoServer.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
volumeMounts:
- mountPath: /var/run/argocd
name: var-files
{{- with .Values.repoServer.initContainers }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.repoServer.priorityClassName }} {{- with .Values.repoServer.priorityClassName }}
priorityClassName: {{ . }} priorityClassName: {{ . }}
{{- end }} {{- end }}

View file

@ -319,9 +319,6 @@ spec:
lifecycle: lifecycle:
{{- toYaml . | nindent 10 }} {{- toYaml . | nindent 10 }}
{{- end }} {{- end }}
{{- with .Values.server.extraContainers }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- if .Values.server.extensions.enabled }} {{- if .Values.server.extensions.enabled }}
- name: argocd-extensions - name: argocd-extensions
image: {{ .Values.server.extensions.image.repository }}:{{ .Values.server.extensions.image.tag }} image: {{ .Values.server.extensions.image.repository }}:{{ .Values.server.extensions.image.tag }}
@ -336,6 +333,13 @@ spec:
- name: tmp - name: tmp
mountPath: /tmp mountPath: /tmp
{{- end }} {{- end }}
{{- with .Values.server.extraContainers }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- with .Values.server.initContainers }}
initContainers:
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- with .Values.server.nodeSelector }} {{- with .Values.server.nodeSelector }}
nodeSelector: nodeSelector:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
@ -406,10 +410,6 @@ spec:
path: tls.crt path: tls.crt
- key: ca.crt - key: ca.crt
path: ca.crt path: ca.crt
{{- with .Values.server.initContainers }}
initContainers:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.server.priorityClassName }} {{- with .Values.server.priorityClassName }}
priorityClassName: {{ . }} priorityClassName: {{ . }}
{{- end }} {{- end }}

View file

@ -43,27 +43,6 @@ spec:
securityContext: securityContext:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
initContainers:
- name: copyutil
image: {{ default .Values.global.image.repository .Values.dex.initImage.repository }}:{{ default (include "argo-cd.defaultTag" .) .Values.dex.initImage.tag }}
imagePullPolicy: {{ default .Values.global.image.imagePullPolicy .Values.dex.initImage.imagePullPolicy }}
command:
- cp
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
volumeMounts:
- mountPath: /shared
name: static-files
- mountPath: /tmp
name: dexconfig
resources:
{{- toYaml .Values.dex.resources | nindent 10 }}
securityContext:
{{- toYaml .Values.dex.containerSecurityContext | nindent 10 }}
{{- with .Values.dex.initContainers }}
{{- toYaml . | nindent 6 }}
{{- end }}
containers: containers:
- name: {{ .Values.dex.name }} - name: {{ .Values.dex.name }}
image: {{ .Values.dex.image.repository }}:{{ .Values.dex.image.tag }} image: {{ .Values.dex.image.repository }}:{{ .Values.dex.image.tag }}
@ -136,7 +115,28 @@ spec:
- name: argocd-dex-server-tls - name: argocd-dex-server-tls
mountPath: /tls mountPath: /tls
{{- with .Values.dex.extraContainers }} {{- with .Values.dex.extraContainers }}
{{- toYaml . | nindent 6 }} {{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
initContainers:
- name: copyutil
image: {{ default .Values.global.image.repository .Values.dex.initImage.repository }}:{{ default (include "argo-cd.defaultTag" .) .Values.dex.initImage.tag }}
imagePullPolicy: {{ default .Values.global.image.imagePullPolicy .Values.dex.initImage.imagePullPolicy }}
command:
- cp
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
volumeMounts:
- mountPath: /shared
name: static-files
- mountPath: /tmp
name: dexconfig
resources:
{{- toYaml .Values.dex.resources | nindent 10 }}
securityContext:
{{- toYaml .Values.dex.containerSecurityContext | nindent 10 }}
{{- with .Values.dex.initContainers }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }} {{- end }}
{{- with .Values.dex.nodeSelector }} {{- with .Values.dex.nodeSelector }}
nodeSelector: nodeSelector:

View file

@ -41,10 +41,6 @@ spec:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
serviceAccountName: {{ include "argo-cd.redisServiceAccountName" . }} serviceAccountName: {{ include "argo-cd.redisServiceAccountName" . }}
{{- with .Values.redis.initContainers }}
initContainers:
{{- toYaml . | nindent 6 }}
{{- end }}
containers: containers:
- name: {{ .Values.redis.name }} - name: {{ .Values.redis.name }}
image: {{ .Values.redis.image.repository }}:{{ .Values.redis.image.tag }} image: {{ .Values.redis.image.repository }}:{{ .Values.redis.image.tag }}
@ -96,7 +92,11 @@ spec:
{{- toYaml .Values.redis.metrics.containerSecurityContext | nindent 10 }} {{- toYaml .Values.redis.metrics.containerSecurityContext | nindent 10 }}
{{- end }} {{- end }}
{{- with .Values.redis.extraContainers }} {{- with .Values.redis.extraContainers }}
{{- toYaml . | nindent 6 }} {{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- with .Values.redis.initContainers }}
initContainers:
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }} {{- end }}
{{- with .Values.redis.nodeSelector }} {{- with .Values.redis.nodeSelector }}
nodeSelector: nodeSelector:

View file

@ -439,6 +439,7 @@ configs:
# } # }
# -- Array of extra K8s manifests to deploy # -- Array of extra K8s manifests to deploy
## Note: Supports use of custom Helm templates
extraObjects: [] extraObjects: []
# - apiVersion: secrets-store.csi.x-k8s.io/v1 # - apiVersion: secrets-store.csi.x-k8s.io/v1
# kind: SecretProviderClass # kind: SecretProviderClass
@ -538,12 +539,14 @@ controller:
# name: secret-name # name: secret-name
# -- Additional containers to be added to the application controller pod # -- Additional containers to be added to the application controller pod
## Note: Supports use of custom Helm templates
extraContainers: [] extraContainers: []
# -- Init containers to add to the application controller pod # -- Init containers to add to the application controller pod
## If your target Kubernetes cluster(s) require a custom credential (exec) plugin ## If your target Kubernetes cluster(s) require a custom credential (exec) plugin
## you could use this (and the same in the server pod) to provide such executable ## you could use this (and the same in the server pod) to provide such executable
## Ref: https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins ## Ref: https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins
## Note: Supports use of custom Helm templates
initContainers: [] initContainers: []
# - name: download-tools # - name: download-tools
# image: alpine:3 # image: alpine:3
@ -827,9 +830,11 @@ dex:
# name: secret-name # name: secret-name
# -- Additional containers to be added to the dex pod # -- Additional containers to be added to the dex pod
## Note: Supports use of custom Helm templates
extraContainers: [] extraContainers: []
# -- Init containers to add to the dex pod # -- Init containers to add to the dex pod
## Note: Supports use of custom Helm templates
initContainers: [] initContainers: []
# -- Additional volumeMounts to the dex main container # -- Additional volumeMounts to the dex main container
@ -1012,9 +1017,11 @@ redis:
# name: secret-name # name: secret-name
# -- Additional containers to be added to the redis pod # -- Additional containers to be added to the redis pod
## Note: Supports use of custom Helm templates
extraContainers: [] extraContainers: []
# -- Init containers to add to the redis pod # -- Init containers to add to the redis pod
## Note: Supports use of custom Helm templates
initContainers: [] initContainers: []
# -- Additional volumeMounts to the redis container # -- Additional volumeMounts to the redis container
@ -1353,7 +1360,7 @@ server:
# memory: 64Mi # memory: 64Mi
# -- Additional containers to be added to the server pod # -- Additional containers to be added to the server pod
## See https://github.com/lemonldap-ng-controller/lemonldap-ng-controller as example. ## Note: Supports use of custom Helm templates
extraContainers: [] extraContainers: []
# - name: my-sidecar # - name: my-sidecar
# image: nginx:latest # image: nginx:latest
@ -1846,11 +1853,13 @@ repoServer:
# -- Additional containers to be added to the repo server pod # -- Additional containers to be added to the repo server pod
## Ref: https://argo-cd.readthedocs.io/en/stable/user-guide/config-management-plugins/ ## Ref: https://argo-cd.readthedocs.io/en/stable/user-guide/config-management-plugins/
## Note: Supports use of custom Helm templates
extraContainers: [] extraContainers: []
# - name: cmp # - name: cmp
# # Entrypoint should be Argo CD lightweight CMP server i.e. argocd-cmp-server # # Entrypoint should be Argo CD lightweight CMP server i.e. argocd-cmp-server
# command: [/var/run/argocd/argocd-cmp-server] # command: [/var/run/argocd/argocd-cmp-server]
# image: busybox # This can be off-the-shelf or custom-built image # # This can be off-the-shelf or custom-built image
# image: busybox
# securityContext: # securityContext:
# runAsNonRoot: true # runAsNonRoot: true
# runAsUser: 999 # runAsUser: 999
@ -2134,8 +2143,13 @@ applicationSet:
# name: secret-name # name: secret-name
# -- Additional containers to be added to the ApplicationSet controller pod # -- Additional containers to be added to the ApplicationSet controller pod
## Note: Supports use of custom Helm templates
extraContainers: [] extraContainers: []
# -- Init containers to add to the ApplicationSet controller pod
## Note: Supports use of custom Helm templates
initContainers: []
# -- List of extra mounts to add (normally used with extraVolumes) # -- List of extra mounts to add (normally used with extraVolumes)
extraVolumeMounts: [] extraVolumeMounts: []
@ -2382,6 +2396,14 @@ notifications:
# - secretRef: # - secretRef:
# name: secret-name # name: secret-name
# -- Additional containers to be added to the notifications controller pod
## Note: Supports use of custom Helm templates
extraContainers: []
# -- Init containers to add to the notifications controller pod
## Note: Supports use of custom Helm templates
initContainers: []
# -- List of extra mounts to add (normally used with extraVolumes) # -- List of extra mounts to add (normally used with extraVolumes)
extraVolumeMounts: [] extraVolumeMounts: []