diff --git a/operations/helm/charts/mimir-distributed/CHANGELOG.md b/operations/helm/charts/mimir-distributed/CHANGELOG.md index a3f3f6cc2b..1c65302d5d 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 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 diff --git a/operations/helm/charts/mimir-distributed/templates/_helpers.tpl b/operations/helm/charts/mimir-distributed/templates/_helpers.tpl index a661a8c84b..3a4aa37748 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 4685ace2db..8b99b3ad19 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 21fb5f4bfd..38ddf37eb3 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