From 66320fe3058590f74068b3c8f8ddfb1c212bd816 Mon Sep 17 00:00:00 2001 From: free6om Date: Fri, 10 Nov 2023 15:01:29 +0800 Subject: [PATCH] chore: add name and instance labels to kafka and pulsar --- addons/kafka/templates/_helpers.tpl | 9 +++++++++ addons/pulsar/templates/_helpers.tpl | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/addons/kafka/templates/_helpers.tpl b/addons/kafka/templates/_helpers.tpl index 7d662b279..a5cf9b877 100644 --- a/addons/kafka/templates/_helpers.tpl +++ b/addons/kafka/templates/_helpers.tpl @@ -35,8 +35,17 @@ Common labels */}} {{- define "kafka.labels" -}} helm.sh/chart: {{ include "kafka.chart" . }} +{{ include "kafka.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} + +{{/* +Selector labels +*/}} +{{- define "kafka.selectorLabels" -}} +app.kubernetes.io/name: {{ include "kafka.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/addons/pulsar/templates/_helpers.tpl b/addons/pulsar/templates/_helpers.tpl index f2a48f9df..90630678f 100644 --- a/addons/pulsar/templates/_helpers.tpl +++ b/addons/pulsar/templates/_helpers.tpl @@ -35,12 +35,21 @@ Common labels */}} {{- define "pulsar.labels" -}} helm.sh/chart: {{ include "pulsar.chart" . }} +{{ include "pulsar.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} +{{/* +Selector labels +*/}} +{{- define "pulsar.selectorLabels" -}} +app.kubernetes.io/name: {{ include "pulsar.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + {{/* Create full image name */}}