Skip to content

Commit 1b43943

Browse files
committed
Helm: add commonLabels (#9067)
Signed-off-by: fabio trigari <trigarifabio@gmail.com>
1 parent 3091c3a commit 1b43943

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

operations/helm/charts/mimir-distributed/templates/_helpers.tpl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,17 @@ Params:
216216
{{- $resourceName -}}
217217
{{- end -}}
218218

219+
{{/*
220+
Common Labels
221+
Params:
222+
ctx = . context
223+
*/}}
224+
{{- define "mimir.commonLabels" -}}
225+
{{- with .ctx.Values.global.commonLabels }}
226+
{{- toYaml . }}
227+
{{- end }}
228+
{{- end -}}
229+
219230
{{/*
220231
Resource labels
221232
Params:
@@ -258,6 +269,9 @@ name: "{{ .component }}-{{ .rolloutZoneName }}" {{- /* Currently required for ro
258269
rollout-group: {{ .component }}
259270
zone: {{ .rolloutZoneName }}
260271
{{- end }}
272+
{{- if .ctx.Values.global.commonLabels }}
273+
{{ include "mimir.commonLabels" . }}
274+
{{- end }}
261275
{{- end -}}
262276

263277
{{/*

operations/helm/charts/mimir-distributed/templates/minio/create-bucket-job.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ metadata:
1515
chart: {{ template "minio.chart" . }}
1616
release: {{ .Release.Name }}
1717
heritage: {{ .Release.Service }}
18+
{{- if .Values.global.commonLabels }}
19+
{{- include "mimir.commonLabels" (dict "ctx" . ) | nindent 4 -}}
20+
{{- end }}
1821
{{- with .Values.minio.makeBucketJob.annotations }}
1922
annotations:
2023
{{ toYaml . | indent 4 }}

operations/helm/charts/mimir-distributed/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ global:
7777
# scope: admin-api, alertmanager, compactor, distributor, gateway, ingester, memcached, nginx, overrides-exporter, querier, query-frontend, query-scheduler, ruler, store-gateway, tokengen, federation-frontend
7878
podLabels: {}
7979

80+
# -- Common labels for all object directly managed this chart.
81+
# scope: *
82+
commonLabels: {}
83+
8084
serviceAccount:
8185
# -- Whether to create a service account or not. In case 'create' is false, do set 'name' to an existing service account name.
8286
create: true

0 commit comments

Comments
 (0)