_labels.tpl 748 B

123456789101112131415161718192021222324
  1. {{/*
  2. Common labels shared across objects.
  3. */}}
  4. {{- define "common.labels" -}}
  5. helm.sh/chart: {{ include "common.names.chart" . }}
  6. {{ include "common.labels.selectorLabels" . }}
  7. {{- if .Chart.AppVersion }}
  8. app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
  9. {{- end }}
  10. app.kubernetes.io/managed-by: {{ .Release.Service }}
  11. {{- end }}
  12. {{/*
  13. Selector labels shared across objects.
  14. */}}
  15. {{- define "common.labels.selectorLabels" -}}
  16. app.kubernetes.io/name: {{ include "common.names.name" . }}
  17. app.kubernetes.io/instance: {{ include "common.names.releaseName" . }}
  18. {{ if hasKey .Values "extraSelectorLabels" }}
  19. {{ range $selector := .Values.extraSelectorLabels }}
  20. {{ printf "%s: %s" $selector.key $selector.value }}
  21. {{ end }}
  22. {{ end }}
  23. {{- end }}