From c49c322db546eb32fd8ce625a506001a1de12bb9 Mon Sep 17 00:00:00 2001 From: fabio trigari Date: Thu, 9 Jan 2025 14:31:08 +0100 Subject: [PATCH 1/3] Helm: add commonLabels (#9067) Signed-off-by: fabio trigari --- .../mimir-distributed/templates/_helpers.tpl | 14 ++++++++++++++ .../templates/minio/create-bucket-job.yaml | 3 +++ .../helm/charts/mimir-distributed/values.yaml | 4 ++++ 3 files changed, 21 insertions(+) diff --git a/operations/helm/charts/mimir-distributed/templates/_helpers.tpl b/operations/helm/charts/mimir-distributed/templates/_helpers.tpl index a661a8c84b3..3a4aa37748d 100644 --- a/operations/helm/charts/mimir-distributed/templates/_helpers.tpl +++ b/operations/helm/charts/mimir-distributed/templates/_helpers.tpl @@ -226,6 +226,17 @@ Params: {{- $resourceName -}} {{- end -}} +{{/* +Common Labels +Params: + ctx = . context +*/}} +{{- define "mimir.commonLabels" -}} +{{- with .ctx.Values.global.commonLabels }} +{{- toYaml . }} +{{- end }} +{{- end -}} + {{/* Resource labels Params: @@ -268,6 +279,9 @@ name: "{{ .component }}-{{ .rolloutZoneName }}" {{- /* Currently required for ro rollout-group: {{ .component }} zone: {{ .rolloutZoneName }} {{- end }} +{{- if .ctx.Values.global.commonLabels }} +{{ include "mimir.commonLabels" . }} +{{- end }} {{- end -}} {{/* diff --git a/operations/helm/charts/mimir-distributed/templates/minio/create-bucket-job.yaml b/operations/helm/charts/mimir-distributed/templates/minio/create-bucket-job.yaml index 4685ace2dbe..8b99b3ad19b 100644 --- a/operations/helm/charts/mimir-distributed/templates/minio/create-bucket-job.yaml +++ b/operations/helm/charts/mimir-distributed/templates/minio/create-bucket-job.yaml @@ -15,6 +15,9 @@ metadata: chart: {{ template "minio.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- if .Values.global.commonLabels }} + {{- include "mimir.commonLabels" (dict "ctx" . ) | nindent 4 -}} + {{- end }} {{- with .Values.minio.makeBucketJob.annotations }} annotations: {{ toYaml . | indent 4 }} diff --git a/operations/helm/charts/mimir-distributed/values.yaml b/operations/helm/charts/mimir-distributed/values.yaml index 21fb5f4bfd2..38ddf37eb3f 100644 --- a/operations/helm/charts/mimir-distributed/values.yaml +++ b/operations/helm/charts/mimir-distributed/values.yaml @@ -77,6 +77,10 @@ global: # scope: admin-api, alertmanager, compactor, distributor, gateway, ingester, memcached, nginx, overrides-exporter, querier, query-frontend, query-scheduler, ruler, store-gateway, tokengen, federation-frontend podLabels: {} + # -- Common labels for all object directly managed this chart. + # scope: * + commonLabels: {} + serviceAccount: # -- Whether to create a service account or not. In case 'create' is false, do set 'name' to an existing service account name. create: true From 863b56c5f86e6a655a2f351fba88265a1af0fb7e Mon Sep 17 00:00:00 2001 From: fabio trigari Date: Mon, 13 Jan 2025 13:59:14 +0100 Subject: [PATCH 2/3] Helm: Update changelog (#9067) Signed-off-by: fabio trigari --- operations/helm/charts/mimir-distributed/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/operations/helm/charts/mimir-distributed/CHANGELOG.md b/operations/helm/charts/mimir-distributed/CHANGELOG.md index a3f3f6cc2bc..0d46c6d9dcb 100644 --- a/operations/helm/charts/mimir-distributed/CHANGELOG.md +++ b/operations/helm/charts/mimir-distributed/CHANGELOG.md @@ -29,6 +29,7 @@ Entries should include a reference to the Pull Request that introduced the chang ## main / unreleased +* [FEATURE] Add common labels to all Mimir objects, which can be enabled via global.commonLabels. #10385 * [CHANGE] Memcached: Update to Memcached 1.6.34. #10318 * [ENHANCEMENT] Minio: update subchart to v5.4.0. #10346 * [ENHANCEMENT] Individual mimir components can override their container images via the *.image values. The component's image definitions always override the values set in global `image` or `enterprise.image`. #10340 From c771098f4b6d1a1d6d1b887470c2cfcd94eed26f Mon Sep 17 00:00:00 2001 From: fabio trigari Date: Mon, 13 Jan 2025 18:36:20 +0100 Subject: [PATCH 3/3] Helm: Update changelog as requested by the PR (#9067) Signed-off-by: fabio trigari --- operations/helm/charts/mimir-distributed/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operations/helm/charts/mimir-distributed/CHANGELOG.md b/operations/helm/charts/mimir-distributed/CHANGELOG.md index 0d46c6d9dcb..1c65302d5de 100644 --- a/operations/helm/charts/mimir-distributed/CHANGELOG.md +++ b/operations/helm/charts/mimir-distributed/CHANGELOG.md @@ -29,7 +29,7 @@ Entries should include a reference to the Pull Request that introduced the chang ## main / unreleased -* [FEATURE] Add common labels to all Mimir objects, which can be enabled via global.commonLabels. #10385 +* [FEATURE] Add common labels to all Mimir objects, which you can enable via global.commonLabels. #10385 * [CHANGE] Memcached: Update to Memcached 1.6.34. #10318 * [ENHANCEMENT] Minio: update subchart to v5.4.0. #10346 * [ENHANCEMENT] Individual mimir components can override their container images via the *.image values. The component's image definitions always override the values set in global `image` or `enterprise.image`. #10340