diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index 15fa92f4..7686f02e 100644 --- a/charts/argo-cd/Chart.yaml +++ b/charts/argo-cd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: 2.1.0 description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes. name: argo-cd -version: 3.14.0 +version: 3.15.0 home: https://github.com/argoproj/argo-helm icon: https://argoproj.github.io/argo-cd/assets/logo.png keywords: @@ -21,4 +21,4 @@ dependencies: condition: redis-ha.enabled annotations: artifacthub.io/changes: | - - "[Added]: Probe configuration for Dex server" + - "[Added]: Global configuration for pod annotations and labels" diff --git a/charts/argo-cd/README.md b/charts/argo-cd/README.md index 3f58dbb3..c3dabc56 100644 --- a/charts/argo-cd/README.md +++ b/charts/argo-cd/README.md @@ -142,6 +142,8 @@ NAME: my-release | global.image.imagePullPolicy | If defined, a imagePullPolicy applied to all ArgoCD deployments. | `"IfNotPresent"` | | global.image.repository | If defined, a repository applied to all ArgoCD deployments. | `"argoproj/argocd"` | | global.image.tag | If defined, a tag applied to all ArgoCD deployments. | `"v2.0.5"` | +| global.podAnnotations | Annotations for the all deployed pods | +| global.podLabels | Labels for the all deployed pods | | global.securityContext | Toggle and define securityContext | See [values.yaml](values.yaml) | | global.imagePullSecrets | If defined, uses a Secret to pull an image from a private Docker registry or repository. | `[]` | | global.hostAliases | Mapping between IP and hostnames that will be injected as entries in the pod's hosts files | `[]` | diff --git a/charts/argo-cd/templates/argocd-application-controller/deployment.yaml b/charts/argo-cd/templates/argocd-application-controller/deployment.yaml index 7902be76..fac40ab7 100755 --- a/charts/argo-cd/templates/argocd-application-controller/deployment.yaml +++ b/charts/argo-cd/templates/argocd-application-controller/deployment.yaml @@ -17,17 +17,15 @@ spec: replicas: {{ .Values.controller.replicas }} template: metadata: - {{- if .Values.controller.podAnnotations }} + {{- with (mergeOverwrite .Values.global.podAnnotations .Values.controller.podAnnotations) }} annotations: - {{- range $key, $value := .Values.controller.podAnnotations }} - {{ $key }}: {{ $value | quote }} - {{- end }} + {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 8 }} app.kubernetes.io/version: {{ default .Values.global.image.tag .Values.controller.image.tag | quote }} - {{- if .Values.controller.podLabels }} -{{- toYaml .Values.controller.podLabels | nindent 8 }} + {{- with (mergeOverwrite .Values.global.podLabels .Values.controller.podLabels) }} + {{- toYaml . | nindent 8 }} {{- end }} spec: {{- with .Values.global.imagePullSecrets }} diff --git a/charts/argo-cd/templates/argocd-repo-server/deployment.yaml b/charts/argo-cd/templates/argocd-repo-server/deployment.yaml index d89440a2..9b4c3400 100755 --- a/charts/argo-cd/templates/argocd-repo-server/deployment.yaml +++ b/charts/argo-cd/templates/argocd-repo-server/deployment.yaml @@ -16,17 +16,15 @@ spec: {{- end }} template: metadata: - {{- if .Values.repoServer.podAnnotations }} + {{- with (mergeOverwrite .Values.global.podAnnotations .Values.repoServer.podAnnotations) }} annotations: - {{- range $key, $value := .Values.repoServer.podAnnotations }} - {{ $key }}: {{ $value | quote }} - {{- end }} + {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "argo-cd.labels" (dict "context" . "component" .Values.repoServer.name "name" .Values.repoServer.name) | nindent 8 }} app.kubernetes.io/version: {{ default .Values.global.image.tag .Values.repoServer.image.tag | quote }} - {{- if .Values.repoServer.podLabels }} -{{- toYaml .Values.repoServer.podLabels | nindent 8 }} + {{- with (mergeOverwrite .Values.global.podLabels .Values.repoServer.podLabels) }} + {{- toYaml . | nindent 8 }} {{- end }} spec: {{- with .Values.global.imagePullSecrets }} diff --git a/charts/argo-cd/templates/argocd-server/deployment.yaml b/charts/argo-cd/templates/argocd-server/deployment.yaml index 3ef5bb62..9f941c96 100755 --- a/charts/argo-cd/templates/argocd-server/deployment.yaml +++ b/charts/argo-cd/templates/argocd-server/deployment.yaml @@ -16,17 +16,15 @@ spec: {{- end }} template: metadata: - {{- if .Values.server.podAnnotations }} + {{- with (mergeOverwrite .Values.global.podAnnotations .Values.server.podAnnotations) }} annotations: - {{- range $key, $value := .Values.server.podAnnotations }} - {{ $key }}: {{ $value | quote }} - {{- end }} + {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 8 }} app.kubernetes.io/version: {{ default .Values.global.image.tag .Values.server.image.tag | quote }} - {{- if .Values.server.podLabels }} -{{- toYaml .Values.server.podLabels | nindent 8 }} + {{- with (mergeOverwrite .Values.global.podLabels .Values.server.podLabels) }} + {{- toYaml . | nindent 8 }} {{- end }} spec: {{- with .Values.global.imagePullSecrets }} diff --git a/charts/argo-cd/templates/dex/deployment.yaml b/charts/argo-cd/templates/dex/deployment.yaml index 5063ebfe..97951d01 100755 --- a/charts/argo-cd/templates/dex/deployment.yaml +++ b/charts/argo-cd/templates/dex/deployment.yaml @@ -12,17 +12,15 @@ spec: {{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.dex.name) | nindent 6 }} template: metadata: - {{- if .Values.dex.podAnnotations }} + {{- with (mergeOverwrite .Values.global.podAnnotations .Values.dex.podAnnotations) }} annotations: - {{- range $key, $value := .Values.dex.podAnnotations }} - {{ $key }}: {{ $value | quote }} - {{- end }} + {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "argo-cd.labels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 8 }} app.kubernetes.io/version: {{ .Values.dex.image.tag | quote }} - {{- if .Values.dex.podLabels }} -{{- toYaml .Values.dex.podLabels | nindent 8 }} + {{- with (mergeOverwrite .Values.global.podLabels .Values.dex.podLabels) }} + {{- toYaml . | nindent 8 }} {{- end }} spec: {{- with .Values.global.imagePullSecrets }} diff --git a/charts/argo-cd/templates/redis/deployment.yaml b/charts/argo-cd/templates/redis/deployment.yaml index 5b5879a3..05d9f43d 100755 --- a/charts/argo-cd/templates/redis/deployment.yaml +++ b/charts/argo-cd/templates/redis/deployment.yaml @@ -13,17 +13,15 @@ spec: app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.redis.name }} template: metadata: - {{- if .Values.redis.podAnnotations }} + {{- with (mergeOverwrite .Values.global.podAnnotations .Values.redis.podAnnotations) }} annotations: - {{- range $key, $value := .Values.redis.podAnnotations }} - {{ $key }}: {{ $value | quote }} - {{- end }} + {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "argo-cd.labels" (dict "context" . "component" .Values.redis.name "name" .Values.redis.name) | nindent 8 }} app.kubernetes.io/version: {{ .Values.redis.image.tag | quote }} - {{- if .Values.redis.podLabels }} -{{- toYaml .Values.redis.podLabels | nindent 8 }} + {{- with (mergeOverwrite .Values.global.podLabels .Values.redis.podLabels) }} + {{- toYaml . | nindent 8 }} {{- end }} spec: {{- with .Values.global.imagePullSecrets }} diff --git a/charts/argo-cd/values.yaml b/charts/argo-cd/values.yaml index 5f5a7bf1..bc807eb1 100755 --- a/charts/argo-cd/values.yaml +++ b/charts/argo-cd/values.yaml @@ -10,6 +10,10 @@ global: repository: quay.io/argoproj/argocd tag: v2.1.0 imagePullPolicy: IfNotPresent + ## Annotations applied to all pods + podAnnotations: {} + ## Labels applied to all pods + podLabels: {} securityContext: {} # runAsUser: 999 # runAsGroup: 999