From f438ad23fb0d9d5d52a7fe7fff95c3d2afc08efd Mon Sep 17 00:00:00 2001 From: Carlos Herrera <18551113+caherrera@users.noreply.github.com> Date: Fri, 8 Mar 2024 15:10:19 -0300 Subject: [PATCH 1/3] adding extraLabels --- operations/helm/charts/grafana-agent/templates/_helpers.tpl | 3 +++ operations/helm/charts/grafana-agent/values.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/operations/helm/charts/grafana-agent/templates/_helpers.tpl b/operations/helm/charts/grafana-agent/templates/_helpers.tpl index 7b2e825e8879..84f1d4a1e0f8 100644 --- a/operations/helm/charts/grafana-agent/templates/_helpers.tpl +++ b/operations/helm/charts/grafana-agent/templates/_helpers.tpl @@ -51,6 +51,9 @@ Common labels {{- define "grafana-agent.labels" -}} helm.sh/chart: {{ include "grafana-agent.chart" . }} {{ include "grafana-agent.selectorLabels" . }} +{{- with .Values.extraLabels }} +{{ toYaml . }} +{{- end }} {{- if index .Values "$chart_tests" }} app.kubernetes.io/version: "vX.Y.Z" app.kubernetes.io/managed-by: {{ .Release.Service }} diff --git a/operations/helm/charts/grafana-agent/values.yaml b/operations/helm/charts/grafana-agent/values.yaml index 588274fa05be..e7ce3e03d4de 100644 --- a/operations/helm/charts/grafana-agent/values.yaml +++ b/operations/helm/charts/grafana-agent/values.yaml @@ -5,6 +5,9 @@ nameOverride: null # resource names. fullnameOverride: null +# Apply extra labels to common labels. +extraLabels: {} + ## Global properties for image pulling override the values defined under `image.registry` and `configReloader.image.registry`. ## If you want to override only one image registry, use the specific fields but if you want to override them all, use `global.image.registry` global: From eeb60ddeb6aa9a6c82ad530192077fc8d5f0ae1f Mon Sep 17 00:00:00 2001 From: Carlos Herrera <18551113+caherrera@users.noreply.github.com> Date: Fri, 8 Mar 2024 15:25:15 -0300 Subject: [PATCH 2/3] adding extraLabels --- operations/helm/charts/grafana-agent/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/operations/helm/charts/grafana-agent/CHANGELOG.md b/operations/helm/charts/grafana-agent/CHANGELOG.md index a6a00a5f88f7..4924de35ab8a 100644 --- a/operations/helm/charts/grafana-agent/CHANGELOG.md +++ b/operations/helm/charts/grafana-agent/CHANGELOG.md @@ -10,6 +10,10 @@ internal API changes are not present. Unreleased ---------- +### Enhancements + +- Helm chart: Add `extraLabels: {}` value for adding extra labels to common labels. + ### Features - Allow setting nodePort for service. (@ryayon) From 3bb2c02fbde3dc0a60ec84db310aea298cf91e50 Mon Sep 17 00:00:00 2001 From: Carlos Herrera <18551113+caherrera@users.noreply.github.com> Date: Fri, 8 Mar 2024 17:46:14 -0300 Subject: [PATCH 3/3] README.md --- operations/helm/charts/grafana-agent/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/operations/helm/charts/grafana-agent/README.md b/operations/helm/charts/grafana-agent/README.md index 51ea7498b654..2e89952a03cf 100644 --- a/operations/helm/charts/grafana-agent/README.md +++ b/operations/helm/charts/grafana-agent/README.md @@ -102,6 +102,7 @@ use the older mode (called "static mode"), set the `agent.mode` value to | controller.volumeClaimTemplates | list | `[]` | volumeClaimTemplates to add when controller.type is 'statefulset'. | | controller.volumes.extra | list | `[]` | Extra volumes to add to the Grafana Agent pod. | | crds.create | bool | `true` | Whether to install CRDs for monitoring. | +| extraLabels | object | `{}` | Custom labels for all manifests | | fullnameOverride | string | `nil` | Overrides the chart's computed fullname. Used to change the full prefix of resource names. | | global.image.pullSecrets | list | `[]` | Optional set of global image pull secrets. | | global.image.registry | string | `""` | Global image registry to use if it needs to be overriden for some specific use cases (e.g local registries, custom images, ...) |