From 7ddcd377f31c9e6b3fd79cd18492986e3fdc21a4 Mon Sep 17 00:00:00 2001 From: antoinebourayne <38851970+antoinebourayne@users.noreply.github.com> Date: Wed, 24 Nov 2021 17:30:09 +0100 Subject: [PATCH] feat(argo-cd): add flag and labels for application labels (#1021) * add flag and labels for application labels Signed-off-by: Antoine Bourayne * upgrade chart version Signed-off-by: Antoine Bourayne Co-authored-by: Antoine Bourayne Co-authored-by: Marko Bevc --- charts/argo-cd/Chart.yaml | 4 ++-- charts/argo-cd/README.md | 2 ++ .../templates/argocd-application-controller/deployment.yaml | 6 ++++++ charts/argo-cd/values.yaml | 5 +++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index 5a2a8478..465c005c 100644 --- a/charts/argo-cd/Chart.yaml +++ b/charts/argo-cd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: v2.1.7 description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes. name: argo-cd -version: 3.26.10 +version: 3.26.11 home: https://github.com/argoproj/argo-helm icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png keywords: @@ -21,4 +21,4 @@ dependencies: condition: redis-ha.enabled annotations: artifacthub.io/changes: | - - "[Changed]: Update to app version 2.1.7" + - "[Changed]: add flag and labels for application labels" diff --git a/charts/argo-cd/README.md b/charts/argo-cd/README.md index 77b4ae59..785d38bd 100644 --- a/charts/argo-cd/README.md +++ b/charts/argo-cd/README.md @@ -256,6 +256,8 @@ NAME: my-release | controller.livenessProbe.timeoutSeconds | int | `1` | Number of seconds after which the [probe] times out | | controller.logFormat | string | `"text"` | Application controller log format. Either `text` or `json` | | controller.logLevel | string | `"info"` | Application controller log level | +| controller.metrics.applicationLabels.enabled | bool | `false` | Enables additional labels in argocd_app_labels metric | +| controller.metrics.applicationLabels.labels | object | `{}` | Additional labels | | controller.metrics.enabled | bool | `false` | Deploy metrics service | | controller.metrics.rules.enabled | bool | `false` | Deploy a PrometheusRule for the application controller | | controller.metrics.rules.spec | list | `[]` | PrometheusRule.Spec for the application controller | diff --git a/charts/argo-cd/templates/argocd-application-controller/deployment.yaml b/charts/argo-cd/templates/argocd-application-controller/deployment.yaml index 763608d0..8ec4d8c9 100755 --- a/charts/argo-cd/templates/argocd-application-controller/deployment.yaml +++ b/charts/argo-cd/templates/argocd-application-controller/deployment.yaml @@ -54,6 +54,12 @@ spec: - {{ .Values.controller.logFormat }} - --loglevel - {{ .Values.controller.logLevel }} + {{- if .Values.controller.metrics.applicationLabels.enabled }} + - --metrics-application-labels + {{- range .Values.controller.metrics.applicationLabels.labels }} + - {{- toYaml . | nindent 8 }} + {{- end }} + {{- end }} {{- if or (and .Values.redis.enabled (not $redisHa.enabled)) (and $redisHa.enabled $redisHa.haproxy.enabled) }} - --redis - {{ template "argo-cd.redis.fullname" . }}:{{ .Values.redis.servicePort }} diff --git a/charts/argo-cd/values.yaml b/charts/argo-cd/values.yaml index 0940623f..41e26108 100755 --- a/charts/argo-cd/values.yaml +++ b/charts/argo-cd/values.yaml @@ -215,6 +215,11 @@ controller: metrics: # -- Deploy metrics service enabled: false + applicationLabels: + # -- Enables additional labels in argocd_app_labels metric + enabled: false + # -- Additional labels + labels: {} service: # -- Metrics service annotations annotations: {}