From f3c2fa17842d6134c84c4027d90183e9014584f1 Mon Sep 17 00:00:00 2001 From: Arun Anandhan Date: Mon, 4 Oct 2021 16:19:30 -0600 Subject: [PATCH] feat(argo-cd): Create optional annotations and labels for redis service (#955) * Create optional serviceAnnotations value for redis in helm chart Signed-off-by: arunkumar.anandhan * Uncomment accidentally commented lines Signed-off-by: arunkumar.anandhan * update chart version Signed-off-by: arunkumar.anandhan * update service annotation key for redis Signed-off-by: arunkumar.anandhan * Update L24 with appropriate description Signed-off-by: arunkumar.anandhan * Move redis.service key occurence in values Signed-off-by: Marco Kilchhofer * Also implement additional labels Signed-off-by: Marco Kilchhofer * Add documentation - Changelog annotations - Add new values to README Signed-off-by: Marco Kilchhofer * fix: Use correct value for redis service targetPort Signed-off-by: Marco Kilchhofer Co-authored-by: Marco Kilchhofer --- charts/argo-cd/Chart.yaml | 6 ++++-- charts/argo-cd/README.md | 2 ++ charts/argo-cd/templates/redis/service.yaml | 9 ++++++++- charts/argo-cd/values.yaml | 4 ++++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index a68ababd..5ca4d16b 100644 --- a/charts/argo-cd/Chart.yaml +++ b/charts/argo-cd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: 2.1.2 description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes. name: argo-cd -version: 3.22.1 +version: 3.23.0 home: https://github.com/argoproj/argo-helm icon: https://argoproj.github.io/argo-cd/assets/logo.png keywords: @@ -21,4 +21,6 @@ dependencies: condition: redis-ha.enabled annotations: artifacthub.io/changes: | - - "[Fixed]: repoServer.extraContainers unused" + - "[Added]: Ability to provide annotations on redis service" + - "[Added]: Ability to provide additional labels on redis service" + - "[Fixed]: Use correct value for redis service targetPort" diff --git a/charts/argo-cd/README.md b/charts/argo-cd/README.md index 95a938dc..81b8058a 100644 --- a/charts/argo-cd/README.md +++ b/charts/argo-cd/README.md @@ -475,6 +475,8 @@ through `xxx.extraArgs` | redis.resources | Resource limits and requests for redis | `{}` | | redis.securityContext | Redis Pod Security Context | See [values.yaml](values.yaml) | | redis.servicePort | Redis service port | `6379` | +| redis.service.annotations | Redis service annotations | `{}` | +| redis.service.labels | Additional redis service labels | `{}` | | redis.tolerations | [Tolerations for use with node taints](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) | `[]` | | redis.metrics.enabled | Deploy metrics service and redis-exporter sidecar | `false` | | redis.metrics.image.repository | redis-exporter image repository | `quay.io/bitnami/redis-exporter` | diff --git a/charts/argo-cd/templates/redis/service.yaml b/charts/argo-cd/templates/redis/service.yaml index cf1f98bf..e02e33f2 100644 --- a/charts/argo-cd/templates/redis/service.yaml +++ b/charts/argo-cd/templates/redis/service.yaml @@ -6,10 +6,17 @@ metadata: name: {{ template "argo-cd.redis.fullname" . }} labels: {{- include "argo-cd.labels" (dict "context" . "component" .Values.redis.name "name" .Values.redis.name) | nindent 4 }} + {{- with .Values.redis.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.redis.service.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} spec: ports: - port: {{ .Values.redis.servicePort }} - targetPort: {{ .Values.redis.servicePort }} + targetPort: {{ .Values.redis.containerPort }} selector: {{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.redis.name) | nindent 4 }} {{- end }} \ No newline at end of file diff --git a/charts/argo-cd/values.yaml b/charts/argo-cd/values.yaml index d914eacf..46ba167a 100755 --- a/charts/argo-cd/values.yaml +++ b/charts/argo-cd/values.yaml @@ -451,6 +451,10 @@ redis: ## Additional containers to be added to the redis pod. extraContainers: [] + service: + annotations: {} + labels: {} + metrics: enabled: false image: