diff --git a/charts/victoria-metrics-common/CHANGELOG.md b/charts/victoria-metrics-common/CHANGELOG.md index f2142b1be..0d07c422d 100644 --- a/charts/victoria-metrics-common/CHANGELOG.md +++ b/charts/victoria-metrics-common/CHANGELOG.md @@ -2,7 +2,7 @@ ## Next release -- TODO +- Added vm.podLabels template ## 0.0.16 diff --git a/charts/victoria-metrics-common/Chart.yaml b/charts/victoria-metrics-common/Chart.yaml index 8ff06c4bd..2dd47cdda 100644 --- a/charts/victoria-metrics-common/Chart.yaml +++ b/charts/victoria-metrics-common/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 type: library description: Victoria Metrics Common - contains shared templates for all Victoria Metrics helm charts name: victoria-metrics-common -version: 0.0.16 +version: 0.0.17 sources: - https://github.com/VictoriaMetrics/helm-charts kubeVersion: ">=1.23.0-0" diff --git a/charts/victoria-metrics-common/templates/_helpers.tpl b/charts/victoria-metrics-common/templates/_helpers.tpl index e6d27de1d..fe450915c 100644 --- a/charts/victoria-metrics-common/templates/_helpers.tpl +++ b/charts/victoria-metrics-common/templates/_helpers.tpl @@ -138,6 +138,15 @@ If release name contains chart name it will be used as a full name. {{- toYaml $labels -}} {{- end -}} +{{- define "vm.podLabels" -}} + {{- include "vm.validate.args" . -}} + {{- $Release := (.helm).Release | default .Release -}} + {{- $labels := fromYaml (include "vm.selectorLabels" .) -}} + {{- $labels = mergeOverwrite $labels (.extraLabels | default dict) -}} + {{- $_ := set $labels "app.kubernetes.io/managed-by" $Release.Service -}} + {{- toYaml $labels -}} +{{- end -}} + {{- /* Common labels */ -}} {{- define "vm.labels" -}} {{- include "vm.validate.args" . -}}