library-chart/chart/templates/lib/chart/_labels.tpl

23 lines
740 B
Smarty

{{/* Common labels shared across objects */}}
{{- define "common.labels" -}}
helm.sh/chart: {{ include "common.names.chart" . }}
{{ include "common.labels.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- with .Values.global.labels }}
{{- range $k, $v := . }}
{{- $name := $k }}
{{- $value := tpl $v $ }}
{{ $name }}: {{ quote $value }}
{{- end }}
{{- end }}
{{- end -}}
{{/* Selector labels shared across objects */}}
{{- define "common.labels.selectorLabels" -}}
app.kubernetes.io/name: {{ include "common.names.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}