Skip to content

Commit

Permalink
Helm: add commonLabels (grafana#9067)
Browse files Browse the repository at this point in the history
Signed-off-by: fabio trigari <[email protected]>
  • Loading branch information
ftrigari committed Oct 26, 2024
1 parent 97a7589 commit 316f1bb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
13 changes: 13 additions & 0 deletions operations/helm/charts/mimir-distributed/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,17 @@ Params:
{{- $resourceName -}}
{{- end -}}

{{/*
Common Labels
Params:
ctx = . context
*/}}
{{- define "mimir.commonLabels" -}}
{{- if .ctx.Values.global.commonLabels }}
{{- toYaml .ctx.Values.global.commonLabels }}
{{- end }}
{{- end -}}

{{/*
Resource labels
Params:
Expand Down Expand Up @@ -244,6 +255,7 @@ name: "{{ .component }}-{{ .rolloutZoneName }}" {{- /* Currently required for ro
rollout-group: {{ .component }}
zone: {{ .rolloutZoneName }}
{{- end }}
{{ include "mimir.commonLabels" (dict "ctx" .ctx ) }}
{{- end -}}

{{/*
Expand Down Expand Up @@ -297,6 +309,7 @@ name: "{{ .component }}-{{ .rolloutZoneName }}" {{- /* Currently required for ro
rollout-group: {{ .component }}
zone: {{ .rolloutZoneName }}
{{- end }}
{{ include "mimir.commonLabels" (dict "ctx" .ctx ) }}
{{- end -}}

{{/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ metadata:
chart: {{ template "minio.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- include "mimir.commonLabels" (dict "ctx" . ) | nindent 4 -}}
{{- with .Values.minio.makeBucketJob.annotations }}
annotations:
{{ toYaml . | indent 4 }}
Expand All @@ -28,6 +29,7 @@ spec:
{{- if .Values.minio.podLabels }}
{{ toYaml .Values.minio.podLabels | indent 8 }}
{{- end }}
{{- include "mimir.commonLabels" (dict "ctx" . ) | nindent 8 -}}
{{- if .Values.minio.makeBucketJob.podAnnotations }}
annotations:
{{ toYaml .Values.minio.makeBucketJob.podAnnotations | indent 8 }}
Expand Down
4 changes: 4 additions & 0 deletions operations/helm/charts/mimir-distributed/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
Expand Down

0 comments on commit 316f1bb

Please sign in to comment.