From 025c7796f2e168e12502ed23437fbae8d7c87048 Mon Sep 17 00:00:00 2001 From: Joffrey Janiec Date: Mon, 2 Mar 2020 15:10:42 +0100 Subject: [PATCH] Support for labels & annotations for dex & redis --- charts/argo-cd/Chart.yaml | 2 +- charts/argo-cd/README.md | 4 ++++ charts/argo-cd/templates/dex/deployment.yaml | 9 +++++++++ charts/argo-cd/templates/redis/deployment.yaml | 11 ++++++++++- charts/argo-cd/values.yaml | 16 ++++++++++++++++ 5 files changed, 40 insertions(+), 2 deletions(-) diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index 160d33ba..25371c42 100644 --- a/charts/argo-cd/Chart.yaml +++ b/charts/argo-cd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "1.4.2" description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes. name: argo-cd -version: 1.8.3 +version: 1.8.4 home: https://github.com/argoproj/argo-helm icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png keywords: diff --git a/charts/argo-cd/README.md b/charts/argo-cd/README.md index da37209b..a6fcffce 100644 --- a/charts/argo-cd/README.md +++ b/charts/argo-cd/README.md @@ -225,6 +225,8 @@ Helm v3 has removed the `install-crds` hook so CRDs are now populated by files i | dex.name | Dex name | `"dex-server"` | | dex.env | Environment variables for the Dex server. | `[]` | | dex.nodeSelector | Dex node selector https://kubernetes.io/docs/user-guide/node-selection/ | `{}` | +| dex.podAnnotations | Annotations for the Dex server pods | `{}` | +| dex.podLabels | Labels for the Dex server pods | `{}` | | dex.priorityClassName | Priority class for dex | `""` | | dex.resources | Resource limits and requests for dex | `{}` | | dex.serviceAccount.create | Create dex service account | `true` | @@ -248,6 +250,8 @@ Helm v3 has removed the `install-crds` hook so CRDs are now populated by files i | redis.name | Redis name | `"redis"` | | redis.env | Environment variables for the Redis server. | `[]` | | redis.nodeSelector | Redis node selector https://kubernetes.io/docs/user-guide/node-selection/ | `{}` | +| redis.podAnnotations | Annotations for the Redis server pods | `{}` | +| redis.podLabels | Labels for the Redis server pods | `{}` | | redis.priorityClassName | Priority class for redis | `""` | | redis.resources | Resource limits and requests for redis | `{}` | | redis.servicePort | Redis service port | `6379` | diff --git a/charts/argo-cd/templates/dex/deployment.yaml b/charts/argo-cd/templates/dex/deployment.yaml index fd8c606a..a8ab902b 100755 --- a/charts/argo-cd/templates/dex/deployment.yaml +++ b/charts/argo-cd/templates/dex/deployment.yaml @@ -18,6 +18,12 @@ spec: app.kubernetes.io/instance: {{ .Release.Name }} template: metadata: + {{- if .Values.dex.podAnnotations }} + annotations: + {{- range $key, $value := .Values.dex.podAnnotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- end }} labels: app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.dex.name }} helm.sh/chart: {{ include "argo-cd.chart" . }} @@ -26,6 +32,9 @@ spec: app.kubernetes.io/part-of: argocd app.kubernetes.io/component: {{ .Values.dex.name }} app.kubernetes.io/version: {{ .Values.dex.image.tag }} + {{- if .Values.dex.podLabels }} +{{- toYaml .Values.dex.podLabels | nindent 8 }} + {{- end }} spec: {{- if .Values.global.securityContext }} securityContext: {{- toYaml .Values.global.securityContext | nindent 8 }} diff --git a/charts/argo-cd/templates/redis/deployment.yaml b/charts/argo-cd/templates/redis/deployment.yaml index 9358166e..146afd8b 100755 --- a/charts/argo-cd/templates/redis/deployment.yaml +++ b/charts/argo-cd/templates/redis/deployment.yaml @@ -17,6 +17,12 @@ spec: app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.redis.name }} template: metadata: + {{- if .Values.redis.podAnnotations }} + annotations: + {{- range $key, $value := .Values.redis.podAnnotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- end }} labels: app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.redis.name }} helm.sh/chart: {{ include "argo-cd.chart" . }} @@ -24,7 +30,10 @@ spec: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/part-of: argocd app.kubernetes.io/component: {{ .Values.redis.name }} - app.kubernetes.io/version: {{ .Values.redis.image.tag }} + app.kubernetes.io/version: {{ .Values.redis.image.tag }} + {{- if .Values.redis.podLabels }} +{{- toYaml .Values.redis.podLabels | nindent 8 }} + {{- end }} spec: automountServiceAccountToken: false {{- if .Values.global.securityContext }} diff --git a/charts/argo-cd/values.yaml b/charts/argo-cd/values.yaml index e88c2f8c..6003020c 100755 --- a/charts/argo-cd/values.yaml +++ b/charts/argo-cd/values.yaml @@ -177,6 +177,14 @@ dex: ## env: [] + ## Annotations to be added to the Dex server pods + ## + podAnnotations: {} + + ## Labels to be added to the Dex server pods + ## + podLabels: {} + serviceAccount: create: true name: argocd-dex-server @@ -238,6 +246,14 @@ redis: ## env: [] + ## Annotations to be added to the Redis server pods + ## + podAnnotations: {} + + ## Labels to be added to the Redis server pods + ## + podLabels: {} + ## Node selectors and tolerations for server scheduling to nodes with taints ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ ##