diff --git a/bitnami/kafka/Chart.yaml b/bitnami/kafka/Chart.yaml index b674f5cbd8..ca878535b8 100644 --- a/bitnami/kafka/Chart.yaml +++ b/bitnami/kafka/Chart.yaml @@ -42,4 +42,4 @@ maintainers: name: kafka sources: - https://github.com/bitnami/charts/tree/main/bitnami/kafka -version: 25.0.1 +version: 25.1.0 diff --git a/bitnami/kafka/README.md b/bitnami/kafka/README.md index 012174a1bc..705987fd8d 100644 --- a/bitnami/kafka/README.md +++ b/bitnami/kafka/README.md @@ -925,16 +925,16 @@ extraDeploy: kind: Deployment metadata: name: {{ include "common.names.fullname" . }}-connect - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: connector spec: replicas: 1 selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }} app.kubernetes.io/component: connector template: metadata: - labels: {{- include "common.labels.standard" . | nindent 8 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 8 }} app.kubernetes.io/component: connector spec: containers: @@ -956,7 +956,7 @@ extraDeploy: kind: ConfigMap metadata: name: {{ include "common.names.fullname" . }}-connect - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: connector data: connect-standalone.properties: |- @@ -970,14 +970,14 @@ extraDeploy: kind: Service metadata: name: {{ include "common.names.fullname" . }}-connect - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: connector spec: ports: - protocol: TCP port: 8083 targetPort: connector - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: connector ``` @@ -1424,4 +1424,4 @@ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and -limitations under the License. \ No newline at end of file +limitations under the License. diff --git a/bitnami/kafka/templates/broker/configmap.yaml b/bitnami/kafka/templates/broker/configmap.yaml index 2b6129e38e..12a231c9f2 100644 --- a/bitnami/kafka/templates/broker/configmap.yaml +++ b/bitnami/kafka/templates/broker/configmap.yaml @@ -10,12 +10,9 @@ kind: ConfigMap metadata: name: {{ printf "%s-broker-configuration" (include "common.names.fullname" .) }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: broker app.kubernetes.io/part-of: kafka - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} diff --git a/bitnami/kafka/templates/broker/pdb.yaml b/bitnami/kafka/templates/broker/pdb.yaml index 5892055e9b..1b07fd9e6c 100644 --- a/bitnami/kafka/templates/broker/pdb.yaml +++ b/bitnami/kafka/templates/broker/pdb.yaml @@ -10,12 +10,9 @@ kind: PodDisruptionBudget metadata: name: {{ include "common.names.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: broker app.kubernetes.io/part-of: kafka - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} @@ -26,8 +23,9 @@ spec: {{- if .Values.broker.pdb.maxUnavailable }} maxUnavailable: {{ .Values.broker.pdb.maxUnavailable }} {{- end }} + {{- $podLabels := merge .Values.worker.podLabels .Values.commonLabels }} selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} app.kubernetes.io/component: broker app.kubernetes.io/part-of: kafka {{- end }} diff --git a/bitnami/kafka/templates/broker/statefulset.yaml b/bitnami/kafka/templates/broker/statefulset.yaml index 17beca3a8f..4603840d02 100644 --- a/bitnami/kafka/templates/broker/statefulset.yaml +++ b/bitnami/kafka/templates/broker/statefulset.yaml @@ -10,32 +10,27 @@ kind: StatefulSet metadata: name: {{ printf "%s-broker" (include "common.names.fullname" .) }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: broker app.kubernetes.io/part-of: kafka - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} spec: podManagementPolicy: {{ .Values.broker.podManagementPolicy }} replicas: {{ .Values.broker.replicaCount }} + {{- $podLabels := merge .Values.worker.podLabels .Values.commonLabels }} selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} app.kubernetes.io/component: broker app.kubernetes.io/part-of: kafka serviceName: {{ printf "%s-broker-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} updateStrategy: {{- include "common.tplvalues.render" (dict "value" .Values.broker.updateStrategy "context" $ ) | nindent 4 }} template: metadata: - labels: {{- include "common.labels.standard" . | nindent 8 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} app.kubernetes.io/component: broker app.kubernetes.io/part-of: kafka - {{- if .Values.broker.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.broker.podLabels "context" $) | nindent 8 }} - {{- end }} annotations: {{- if (include "kafka.broker.createConfigmap" .) }} checksum/configuration: {{ include (print $.Template.BasePath "/broker/configmap.yaml") . | sha256sum }} @@ -66,8 +61,8 @@ spec: affinity: {{- include "common.tplvalues.render" (dict "value" .Values.broker.affinity "context" $) | nindent 8 }} {{- else }} affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.broker.podAffinityPreset "component" "kafka" "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.broker.podAntiAffinityPreset "component" "kafka" "context" $) | nindent 10 }} + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.broker.podAffinityPreset "component" "kafka" "customLabels" $podLabels "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.broker.podAntiAffinityPreset "component" "kafka" "customLabels" $podLabels "context" $) | nindent 10 }} nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.broker.nodeAffinityPreset.type "key" .Values.broker.nodeAffinityPreset.key "values" .Values.broker.nodeAffinityPreset.values) | nindent 10 }} {{- end }} {{- if .Values.broker.nodeSelector }} diff --git a/bitnami/kafka/templates/broker/svc-external-access.yaml b/bitnami/kafka/templates/broker/svc-external-access.yaml index 5db705de83..fdf5450ba9 100644 --- a/bitnami/kafka/templates/broker/svc-external-access.yaml +++ b/bitnami/kafka/templates/broker/svc-external-access.yaml @@ -13,25 +13,18 @@ kind: Service metadata: name: {{ printf "%s-%d-external" (include "common.names.fullname" $) $i | trunc 63 | trimSuffix "-" }} namespace: {{ include "common.names.namespace" $ | quote }} - labels: {{- include "common.labels.standard" $ | nindent 4 }} + {{- $labels := merge $.Values.externalAccess.broker.service.labels $.Values.commonLabels }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }} app.kubernetes.io/component: kafka pod: {{ $targetPod }} - {{- if $.Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" $.Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if $.Values.externalAccess.broker.service.labels }} - {{- include "common.tplvalues.render" ( dict "value" $.Values.externalAccess.broker.service.labels "context" $) | nindent 4 }} - {{- end }} {{- if or $.Values.externalAccess.broker.service.annotations $.Values.commonAnnotations $.Values.externalAccess.broker.service.loadBalancerAnnotations }} annotations: {{- if and (not (empty $.Values.externalAccess.broker.service.loadBalancerAnnotations)) (eq (len $.Values.externalAccess.broker.service.loadBalancerAnnotations) $replicaCount) }} {{ include "common.tplvalues.render" ( dict "value" (index $.Values.externalAccess.broker.service.loadBalancerAnnotations $i) "context" $) | nindent 4 }} {{- end }} - {{- if $.Values.externalAccess.broker.service.annotations }} - {{- include "common.tplvalues.render" ( dict "value" $.Values.externalAccess.broker.service.annotations "context" $) | nindent 4 }} - {{- end }} - {{- if $.Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- if or $.Values.externalAccess.broker.service.annotations $.Values.commonAnnotations }} + {{- $annotations := merge $.Values.externalAccess.broker.service.annotations $.Values.commonAnnotations }} + {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} {{- end }} {{- end }} spec: @@ -60,7 +53,8 @@ spec: {{- if and (eq $.Values.externalAccess.broker.service.type "NodePort") (le (add $i 1) (len $.Values.externalAccess.broker.service.externalIPs)) }} externalIPs: [{{ index $.Values.externalAccess.broker.service.externalIPs $i | quote }}] {{- end }} - selector: {{- include "common.labels.matchLabels" $ | nindent 4 }} + {{- $podLabels := merge $.Values.worker.podLabels $.Values.commonLabels }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: kafka app.kubernetes.io/component: broker statefulset.kubernetes.io/pod-name: {{ $targetPod }} diff --git a/bitnami/kafka/templates/broker/svc-headless.yaml b/bitnami/kafka/templates/broker/svc-headless.yaml index f1282037b2..e3d67e49ca 100644 --- a/bitnami/kafka/templates/broker/svc-headless.yaml +++ b/bitnami/kafka/templates/broker/svc-headless.yaml @@ -10,23 +10,13 @@ kind: Service metadata: name: {{ printf "%s-broker-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- $labels := merge .Values.externalAccess.broker.service.labels .Values.commonLabels }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }} app.kubernetes.io/component: broker app.kubernetes.io/part-of: kafka - {{- if .Values.service.headless.broker.labels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.service.headless.broker.labels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if or .Values.service.headless.broker.annotations .Values.commonAnnotations }} - annotations: - {{- if .Values.service.headless.broker.annotations }} - {{- include "common.tplvalues.render" (dict "value" .Values.service.headless.broker.annotations "context" $) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} - {{- end }} + {{- $annotations := merge .Values.service.headless.broker.annotations .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} {{- end }} spec: type: ClusterIP @@ -41,7 +31,8 @@ spec: port: {{ .Values.service.ports.client }} protocol: TCP targetPort: client - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} - app.kubernetes.io/component: broker + {{- $podLabels := merge .Values.worker.podLabels .Values.commonLabels }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} + app.kubernetes.io/component: broker app.kubernetes.io/part-of: kafka {{- end }} diff --git a/bitnami/kafka/templates/controller-eligible/configmap.yaml b/bitnami/kafka/templates/controller-eligible/configmap.yaml index 53912b5285..ed77b65331 100644 --- a/bitnami/kafka/templates/controller-eligible/configmap.yaml +++ b/bitnami/kafka/templates/controller-eligible/configmap.yaml @@ -10,12 +10,9 @@ kind: ConfigMap metadata: name: {{ printf "%s-controller-configuration" (include "common.names.fullname" .) }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: controller-eligible app.kubernetes.io/part-of: kafka - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} diff --git a/bitnami/kafka/templates/controller-eligible/pdb.yaml b/bitnami/kafka/templates/controller-eligible/pdb.yaml index 6056b0a745..6977704cd6 100644 --- a/bitnami/kafka/templates/controller-eligible/pdb.yaml +++ b/bitnami/kafka/templates/controller-eligible/pdb.yaml @@ -10,12 +10,9 @@ kind: PodDisruptionBudget metadata: name: {{ printf "%s-controller" (include "common.names.fullname" .) }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: controller-eligible app.kubernetes.io/part-of: kafka - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} @@ -26,8 +23,9 @@ spec: {{- if .Values.controller.pdb.maxUnavailable }} maxUnavailable: {{ .Values.controller.pdb.maxUnavailable }} {{- end }} + {{- $podLabels := merge .Values.controller.podLabels .Values.commonLabels }} selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} app.kubernetes.io/component: controller-only app.kubernetes.io/part-of: kafka {{- end }} diff --git a/bitnami/kafka/templates/controller-eligible/statefulset.yaml b/bitnami/kafka/templates/controller-eligible/statefulset.yaml index f4a29b46f7..072a14b2b1 100644 --- a/bitnami/kafka/templates/controller-eligible/statefulset.yaml +++ b/bitnami/kafka/templates/controller-eligible/statefulset.yaml @@ -10,32 +10,27 @@ kind: StatefulSet metadata: name: {{ printf "%s-controller" (include "common.names.fullname" .) }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: controller-eligible app.kubernetes.io/part-of: kafka - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} spec: podManagementPolicy: {{ .Values.controller.podManagementPolicy }} replicas: {{ .Values.controller.replicaCount }} + {{- $podLabels := merge .Values.controller.podLabels .Values.commonLabels }} selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} app.kubernetes.io/component: controller-eligible app.kubernetes.io/part-of: kafka serviceName: {{ printf "%s-controller-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} updateStrategy: {{- include "common.tplvalues.render" (dict "value" .Values.controller.updateStrategy "context" $ ) | nindent 4 }} template: metadata: - labels: {{- include "common.labels.standard" . | nindent 8 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} app.kubernetes.io/component: controller-eligible app.kubernetes.io/part-of: kafka - {{- if .Values.controller.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.controller.podLabels "context" $) | nindent 8 }} - {{- end }} annotations: {{- if (include "kafka.controller.createConfigmap" .) }} checksum/configuration: {{ include (print $.Template.BasePath "/controller-eligible/configmap.yaml") . | sha256sum }} @@ -66,8 +61,8 @@ spec: affinity: {{- include "common.tplvalues.render" (dict "value" .Values.controller.affinity "context" $) | nindent 8 }} {{- else }} affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.controller.podAffinityPreset "component" "kafka" "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.controller.podAntiAffinityPreset "component" "kafka" "context" $) | nindent 10 }} + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.controller.podAffinityPreset "component" "kafka" "customLabels" $podLabels "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.controller.podAntiAffinityPreset "component" "kafka" "customLabels" $podLabels "context" $) | nindent 10 }} nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.controller.nodeAffinityPreset.type "key" .Values.controller.nodeAffinityPreset.key "values" .Values.controller.nodeAffinityPreset.values) | nindent 10 }} {{- end }} {{- if .Values.controller.nodeSelector }} diff --git a/bitnami/kafka/templates/controller-eligible/svc-external-access.yaml b/bitnami/kafka/templates/controller-eligible/svc-external-access.yaml index b5b54d8703..f314ce98a1 100644 --- a/bitnami/kafka/templates/controller-eligible/svc-external-access.yaml +++ b/bitnami/kafka/templates/controller-eligible/svc-external-access.yaml @@ -14,25 +14,18 @@ kind: Service metadata: name: {{ printf "%s-controller-%d-external" $fullname $i | trunc 63 | trimSuffix "-" }} namespace: {{ include "common.names.namespace" $ | quote }} - labels: {{- include "common.labels.standard" $ | nindent 4 }} + {{- $labels := merge $.Values.externalAccess.controller.service.labels $.Values.commonLabels }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }} app.kubernetes.io/component: kafka pod: {{ $targetPod }} - {{- if $.Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" $.Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if $.Values.externalAccess.controller.service.labels }} - {{- include "common.tplvalues.render" ( dict "value" $.Values.externalAccess.controller.service.labels "context" $) | nindent 4 }} - {{- end }} {{- if or $.Values.externalAccess.controller.service.annotations $.Values.commonAnnotations $.Values.externalAccess.controller.service.loadBalancerAnnotations }} annotations: {{- if and (not (empty $.Values.externalAccess.controller.service.loadBalancerAnnotations)) (eq (len $.Values.externalAccess.controller.service.loadBalancerAnnotations) $replicaCount) }} {{ include "common.tplvalues.render" ( dict "value" (index $.Values.externalAccess.controller.service.loadBalancerAnnotations $i) "context" $) | nindent 4 }} {{- end }} - {{- if $.Values.externalAccess.controller.service.annotations }} - {{- include "common.tplvalues.render" ( dict "value" $.Values.externalAccess.controller.service.annotations "context" $) | nindent 4 }} - {{- end }} - {{- if $.Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- if or $.Values.externalAccess.controller.service.annotations $.Values.commonAnnotations }} + {{- $annotations := merge $.Values.externalAccess.controller.service.annotations $.Values.commonAnnotations }} + {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} {{- end }} {{- end }} spec: @@ -61,7 +54,8 @@ spec: {{- if and (eq $.Values.externalAccess.controller.service.type "NodePort") (le (add $i 1) (len $.Values.externalAccess.controller.service.externalIPs)) }} externalIPs: [{{ index $.Values.externalAccess.controller.service.externalIPs $i | quote }}] {{- end }} - selector: {{- include "common.labels.matchLabels" $ | nindent 4 }} + {{- $podLabels := merge $.Values.controller.podLabels $.Values.commonLabels }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: kafka app.kubernetes.io/component: controller-eligible statefulset.kubernetes.io/pod-name: {{ $targetPod }} diff --git a/bitnami/kafka/templates/controller-eligible/svc-headless.yaml b/bitnami/kafka/templates/controller-eligible/svc-headless.yaml index 764397e08c..91455df329 100644 --- a/bitnami/kafka/templates/controller-eligible/svc-headless.yaml +++ b/bitnami/kafka/templates/controller-eligible/svc-headless.yaml @@ -10,23 +10,13 @@ kind: Service metadata: name: {{ printf "%s-controller-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- $labels := merge .Values.service.headless.controller.labels .Values.commonLabels }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }} app.kubernetes.io/component: controller-eligible app.kubernetes.io/part-of: kafka - {{- if .Values.service.headless.controller.labels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.service.headless.controller.labels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if or .Values.service.headless.controller.annotations .Values.commonAnnotations }} - annotations: - {{- if .Values.service.headless.controller.annotations }} - {{- include "common.tplvalues.render" (dict "value" .Values.service.headless.controller.annotations "context" $) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} - {{- end }} + {{- $annotations := merge .Values.service.headless.controller.annotations .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} {{- end }} spec: type: ClusterIP @@ -49,7 +39,8 @@ spec: port: {{ .Values.service.ports.controller }} targetPort: controller {{- end }} - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} + {{- $podLabels := merge .Values.controller.podLabels .Values.commonLabels }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: controller-eligible app.kubernetes.io/part-of: kafka {{- end }} diff --git a/bitnami/kafka/templates/log4j-configmap.yaml b/bitnami/kafka/templates/log4j-configmap.yaml index 43caadd0de..0c29a2a192 100644 --- a/bitnami/kafka/templates/log4j-configmap.yaml +++ b/bitnami/kafka/templates/log4j-configmap.yaml @@ -9,11 +9,8 @@ kind: ConfigMap metadata: name: {{- printf "%s-log4j-configuration" (include "common.names.fullname" .) -}} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: kafka - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} diff --git a/bitnami/kafka/templates/metrics/deployment.yaml b/bitnami/kafka/templates/metrics/deployment.yaml index 51497c5ab3..bbcea7fba9 100644 --- a/bitnami/kafka/templates/metrics/deployment.yaml +++ b/bitnami/kafka/templates/metrics/deployment.yaml @@ -13,30 +13,24 @@ kind: Deployment metadata: name: {{ include "kafka.metrics.kafka.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: cluster-metrics - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} spec: replicas: 1 + {{- $podLabels := merge .Values.metrics.kafka.podLabels .Values.commonLabels }} selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} app.kubernetes.io/component: cluster-metrics template: metadata: - labels: {{- include "common.labels.standard" . | nindent 8 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} app.kubernetes.io/component: cluster-metrics - {{- if .Values.metrics.kafka.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.metrics.kafka.podLabels "context" $) | nindent 8 }} - {{- end }} - annotations: - {{- if .Values.metrics.kafka.podAnnotations }} - {{- include "common.tplvalues.render" (dict "value" .Values.metrics.kafka.podAnnotations "context" $) | nindent 8 }} - {{- end }} + {{- if .Values.metrics.kafka.podAnnotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.kafka.podAnnotations "context" $) | nindent 8 }} + {{- end }} spec: {{- include "kafka.imagePullSecrets" . | nindent 6 }} {{- if .Values.metrics.kafka.hostAliases }} @@ -46,8 +40,8 @@ spec: affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.kafka.affinity "context" $) | nindent 8 }} {{- else }} affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.metrics.kafka.podAffinityPreset "component" "metrics" "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.metrics.kafka.podAntiAffinityPreset "component" "metrics" "context" $) | nindent 10 }} + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.metrics.kafka.podAffinityPreset "component" "metrics" "customLabels" $podLabels "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.metrics.kafka.podAntiAffinityPreset "component" "metrics" "customLabels" $podLabels "context" $) | nindent 10 }} nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.metrics.kafka.nodeAffinityPreset.type "key" .Values.metrics.kafka.nodeAffinityPreset.key "values" .Values.metrics.kafka.nodeAffinityPreset.values) | nindent 10 }} {{- end }} {{- if .Values.metrics.kafka.nodeSelector }} diff --git a/bitnami/kafka/templates/metrics/jmx-configmap.yaml b/bitnami/kafka/templates/metrics/jmx-configmap.yaml index 2240f0aaa8..64fad25651 100644 --- a/bitnami/kafka/templates/metrics/jmx-configmap.yaml +++ b/bitnami/kafka/templates/metrics/jmx-configmap.yaml @@ -9,11 +9,8 @@ kind: ConfigMap metadata: name: {{ printf "%s-jmx-configuration" (include "common.names.fullname" .) }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: metrics - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} diff --git a/bitnami/kafka/templates/metrics/jmx-servicemonitor.yaml b/bitnami/kafka/templates/metrics/jmx-servicemonitor.yaml index 77b4e7e68f..ddbae1d588 100644 --- a/bitnami/kafka/templates/metrics/jmx-servicemonitor.yaml +++ b/bitnami/kafka/templates/metrics/jmx-servicemonitor.yaml @@ -8,19 +8,10 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: {{ printf "%s-jmx-metrics" (include "common.names.fullname" .) }} - {{- if .Values.metrics.serviceMonitor.namespace }} - namespace: {{ .Values.metrics.serviceMonitor.namespace }} - {{- else }} - namespace: {{ include "common.names.namespace" . | quote }} - {{- end }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + namespace: {{ default (include "common.names.namespace" .) .Values.metrics.serviceMonitor.namespace | quote }} + {{- $labels := merge .Values.metrics.serviceMonitor.labels .Values.commonLabels }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }} app.kubernetes.io/component: metrics - {{- if .Values.metrics.serviceMonitor.labels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.serviceMonitor.labels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} @@ -29,7 +20,7 @@ spec: jobLabel: {{ .Values.metrics.serviceMonitor.jobLabel }} {{- end }} selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }} {{- if .Values.metrics.serviceMonitor.selector }} {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.selector "context" $) | nindent 6 }} {{- end }} diff --git a/bitnami/kafka/templates/metrics/jmx-svc.yaml b/bitnami/kafka/templates/metrics/jmx-svc.yaml index 4924df27dd..3be835f449 100644 --- a/bitnami/kafka/templates/metrics/jmx-svc.yaml +++ b/bitnami/kafka/templates/metrics/jmx-svc.yaml @@ -9,19 +9,11 @@ kind: Service metadata: name: {{ printf "%s-jmx-metrics" (include "common.names.fullname" .) }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: metrics - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if or .Values.metrics.jmx.service.annotations .Values.commonAnnotations }} - annotations: - {{- if .Values.metrics.jmx.service.annotations }} - {{ include "common.tplvalues.render" ( dict "value" .Values.metrics.jmx.service.annotations "context" $) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} + {{- $annotations := merge .Values.metrics.jmx.service.annotations .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} {{- end }} spec: type: ClusterIP @@ -34,6 +26,6 @@ spec: port: {{ .Values.metrics.jmx.service.ports.metrics }} protocol: TCP targetPort: metrics - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: kafka {{- end }} diff --git a/bitnami/kafka/templates/metrics/prometheusrule.yaml b/bitnami/kafka/templates/metrics/prometheusrule.yaml index 8bbe041a77..ac26dd7d61 100644 --- a/bitnami/kafka/templates/metrics/prometheusrule.yaml +++ b/bitnami/kafka/templates/metrics/prometheusrule.yaml @@ -9,14 +9,9 @@ kind: PrometheusRule metadata: name: {{ include "common.names.fullname" . }} namespace: {{ default (include "common.names.namespace" .) .Values.metrics.prometheusRule.namespace }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- $labels := merge .Values.metrics.prometheusRule.labels .Values.commonLabels }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }} app.kubernetes.io/component: metrics - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" .) | nindent 4 }} - {{- end }} - {{- if .Values.metrics.prometheusRule.labels }} - {{- include "common.tplvalues.render" (dict "value" .Values.metrics.prometheusRule.labels "context" .) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" .) | nindent 4 }} {{- end }} diff --git a/bitnami/kafka/templates/metrics/serviceaccount.yaml b/bitnami/kafka/templates/metrics/serviceaccount.yaml index 140024cd86..f7678e3a60 100644 --- a/bitnami/kafka/templates/metrics/serviceaccount.yaml +++ b/bitnami/kafka/templates/metrics/serviceaccount.yaml @@ -9,11 +9,8 @@ kind: ServiceAccount metadata: name: {{ template "kafka.metrics.kafka.serviceAccountName" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: cluster-metrics - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} diff --git a/bitnami/kafka/templates/metrics/servicemonitor.yaml b/bitnami/kafka/templates/metrics/servicemonitor.yaml index 5f3486dca7..61b70ab659 100644 --- a/bitnami/kafka/templates/metrics/servicemonitor.yaml +++ b/bitnami/kafka/templates/metrics/servicemonitor.yaml @@ -8,19 +8,10 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: {{ printf "%s-metrics" (include "common.names.fullname" .) }} - {{- if .Values.metrics.serviceMonitor.namespace }} - namespace: {{ .Values.metrics.serviceMonitor.namespace }} - {{- else }} - namespace: {{ include "common.names.namespace" . | quote }} - {{- end }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + namespace: {{ default (include "common.names.namespace" .) .Values.metrics.serviceMonitor.namespace | quote }} + {{- $labels := merge .Values.metrics.serviceMonitor.labels .Values.commonLabels }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }} app.kubernetes.io/component: cluster-metrics - {{- if .Values.metrics.serviceMonitor.labels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.serviceMonitor.labels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} @@ -29,7 +20,7 @@ spec: jobLabel: {{ .Values.metrics.serviceMonitor.jobLabel }} {{- end }} selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }} {{- if .Values.metrics.serviceMonitor.selector }} {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.selector "context" $) | nindent 6 }} {{- end }} diff --git a/bitnami/kafka/templates/metrics/svc.yaml b/bitnami/kafka/templates/metrics/svc.yaml index 4bda625e2e..d0c166366c 100644 --- a/bitnami/kafka/templates/metrics/svc.yaml +++ b/bitnami/kafka/templates/metrics/svc.yaml @@ -9,19 +9,11 @@ kind: Service metadata: name: {{ printf "%s-metrics" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: cluster-metrics - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if or .Values.metrics.kafka.service.annotations .Values.commonAnnotations }} - annotations: - {{- if .Values.metrics.kafka.service.annotations }} - {{ include "common.tplvalues.render" ( dict "value" .Values.metrics.kafka.service.annotations "context" $) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} + {{- $annotations := merge .Values.metrics.kafka.service.annotations .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} {{- end }} spec: type: ClusterIP @@ -34,6 +26,7 @@ spec: port: {{ .Values.metrics.kafka.service.ports.metrics }} protocol: TCP targetPort: metrics - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} + {{- $podLabels := merge .Values.metrics.kafka.podLabels .Values.commonLabels }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: cluster-metrics {{- end }} diff --git a/bitnami/kafka/templates/network-policy/networkpolicy-egress.yaml b/bitnami/kafka/templates/network-policy/networkpolicy-egress.yaml index 25caa9e946..47b8ec1d00 100644 --- a/bitnami/kafka/templates/network-policy/networkpolicy-egress.yaml +++ b/bitnami/kafka/templates/network-policy/networkpolicy-egress.yaml @@ -9,17 +9,13 @@ apiVersion: {{ include "common.capabilities.networkPolicy.apiVersion" . }} metadata: name: {{ printf "%s-egress" (include "common.names.fullname" .) }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} spec: podSelector: - matchLabels: - {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }} policyTypes: - Egress egress: diff --git a/bitnami/kafka/templates/network-policy/networkpolicy-ingress.yaml b/bitnami/kafka/templates/network-policy/networkpolicy-ingress.yaml index 0d8137d58f..47314bfcc6 100644 --- a/bitnami/kafka/templates/network-policy/networkpolicy-ingress.yaml +++ b/bitnami/kafka/templates/network-policy/networkpolicy-ingress.yaml @@ -9,17 +9,13 @@ apiVersion: {{ include "common.capabilities.networkPolicy.apiVersion" . }} metadata: name: {{ printf "%s-ingress" (include "common.names.fullname" .) }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} spec: podSelector: - matchLabels: - {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }} policyTypes: - Ingress ingress: @@ -40,8 +36,7 @@ spec: - port: {{ .Values.listeners.interbroker.containerPort }} from: - podSelector: - matchLabels: - {{- include "common.labels.matchLabels" . | nindent 14 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 14 }} # Allow External connection {{- if .Values.externalAccess.enabled }} - ports: diff --git a/bitnami/kafka/templates/provisioning/job.yaml b/bitnami/kafka/templates/provisioning/job.yaml index 29a268d7a6..daec23de6b 100644 --- a/bitnami/kafka/templates/provisioning/job.yaml +++ b/bitnami/kafka/templates/provisioning/job.yaml @@ -9,11 +9,8 @@ apiVersion: batch/v1 metadata: name: {{ printf "%s-provisioning" (include "common.names.fullname" .) }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: kafka-provisioning - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} annotations: helm.sh/hook: post-install,post-upgrade helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded @@ -23,15 +20,12 @@ metadata: spec: template: metadata: - labels: {{- include "common.labels.standard" . | nindent 8 }} + {{- $podLabels := merge .Values.provisioning.podLabels .Values.commonLabels }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} app.kubernetes.io/component: kafka-provisioning - {{- if .Values.provisioning.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.provisioning.podLabels "context" $) | nindent 8 }} - {{- end }} - annotations: - {{- if .Values.provisioning.podAnnotations }} - {{- include "common.tplvalues.render" (dict "value" .Values.provisioning.podAnnotations "context" $) | nindent 8 }} - {{- end }} + {{- if .Values.provisioning.podAnnotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.provisioning.podAnnotations "context" $) | nindent 8 }} + {{- end }} spec: serviceAccountName: {{ template "kafka.provisioning.serviceAccountName" . }} enableServiceLinks: {{ .Values.provisioning.enableServiceLinks }} diff --git a/bitnami/kafka/templates/provisioning/serviceaccount.yaml b/bitnami/kafka/templates/provisioning/serviceaccount.yaml index 1b3a017685..dbc1776e50 100644 --- a/bitnami/kafka/templates/provisioning/serviceaccount.yaml +++ b/bitnami/kafka/templates/provisioning/serviceaccount.yaml @@ -9,10 +9,7 @@ kind: ServiceAccount metadata: name: {{ template "kafka.provisioning.serviceAccountName" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} diff --git a/bitnami/kafka/templates/provisioning/tls-secret.yaml b/bitnami/kafka/templates/provisioning/tls-secret.yaml index 3406ded429..2da219d189 100644 --- a/bitnami/kafka/templates/provisioning/tls-secret.yaml +++ b/bitnami/kafka/templates/provisioning/tls-secret.yaml @@ -9,10 +9,7 @@ kind: Secret metadata: name: {{ template "kafka.client.passwordsSecretName" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} diff --git a/bitnami/kafka/templates/rbac/role.yaml b/bitnami/kafka/templates/rbac/role.yaml index 478d161f59..3c55fd757a 100644 --- a/bitnami/kafka/templates/rbac/role.yaml +++ b/bitnami/kafka/templates/rbac/role.yaml @@ -9,11 +9,8 @@ kind: Role metadata: name: {{ include "common.names.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: kafka - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} diff --git a/bitnami/kafka/templates/rbac/rolebinding.yaml b/bitnami/kafka/templates/rbac/rolebinding.yaml index 810626be0d..ef6b4b10b4 100644 --- a/bitnami/kafka/templates/rbac/rolebinding.yaml +++ b/bitnami/kafka/templates/rbac/rolebinding.yaml @@ -9,11 +9,8 @@ kind: RoleBinding metadata: name: {{ include "common.names.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: kafka - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} diff --git a/bitnami/kafka/templates/rbac/serviceaccount.yaml b/bitnami/kafka/templates/rbac/serviceaccount.yaml index 29036b96f0..1d89f8fcab 100644 --- a/bitnami/kafka/templates/rbac/serviceaccount.yaml +++ b/bitnami/kafka/templates/rbac/serviceaccount.yaml @@ -9,17 +9,11 @@ kind: ServiceAccount metadata: name: {{ template "kafka.serviceAccountName" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: kafka - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - annotations: - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.serviceAccount.annotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.serviceAccount.annotations "context" $ ) | nindent 4 }} - {{- end }} + {{- if or .Values.serviceAccount.annotations .Values.commonAnnotations }} + {{- $annotations := merge .Values.serviceAccount.annotations .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} + {{- end }} automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }} {{- end }} diff --git a/bitnami/kafka/templates/scripts-configmap.yaml b/bitnami/kafka/templates/scripts-configmap.yaml index d7650d2429..f46db21436 100644 --- a/bitnami/kafka/templates/scripts-configmap.yaml +++ b/bitnami/kafka/templates/scripts-configmap.yaml @@ -11,10 +11,7 @@ kind: ConfigMap metadata: name: {{ printf "%s-scripts" $fullname }} namespace: {{ $releaseNamespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} diff --git a/bitnami/kafka/templates/secrets.yaml b/bitnami/kafka/templates/secrets.yaml index 1008552c03..2deddb12fc 100644 --- a/bitnami/kafka/templates/secrets.yaml +++ b/bitnami/kafka/templates/secrets.yaml @@ -10,10 +10,7 @@ kind: Secret metadata: name: {{ $secretName }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} @@ -72,12 +69,9 @@ kind: Secret metadata: name: {{ include "common.names.fullname" $ }}-svcbind-user-{{ $i }} namespace: {{ $.Release.Namespace | quote }} - labels: {{- include "common.labels.standard" $ | nindent 4 }} - {{- if $.Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $.Values.commonLabels "context" $ ) | nindent 4 }} {{- if $.Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} type: servicebinding.io/kafka data: @@ -96,10 +90,7 @@ kind: Secret metadata: name: {{ include "common.names.fullname" . }}-svcbind namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} @@ -120,10 +111,7 @@ kind: Secret metadata: name: {{ printf "%s-kraft-cluster-id" (include "common.names.fullname" .) }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} diff --git a/bitnami/kafka/templates/svc.yaml b/bitnami/kafka/templates/svc.yaml index 82c292162f..1ec93bdf96 100644 --- a/bitnami/kafka/templates/svc.yaml +++ b/bitnami/kafka/templates/svc.yaml @@ -8,19 +8,11 @@ kind: Service metadata: name: {{ template "common.names.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: kafka - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if or .Values.service.annotations .Values.commonAnnotations }} - annotations: - {{- if .Values.service.annotations }} - {{ include "common.tplvalues.render" ( dict "value" .Values.service.annotations "context" $) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} + {{- $annotations := merge .Values.service.annotations .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} {{- end }} spec: type: {{ .Values.service.type }} @@ -64,7 +56,7 @@ spec: {{- if .Values.service.extraPorts }} {{- include "common.tplvalues.render" (dict "value" .Values.service.extraPorts "context" $) | nindent 4 }} {{- end }} - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: kafka {{- if and .Values.kraft.enabled .Values.controller.controllerOnly }} app.kubernetes.io/component: broker diff --git a/bitnami/kafka/templates/tls-secret.yaml b/bitnami/kafka/templates/tls-secret.yaml index be0eb01325..ecf2362d93 100644 --- a/bitnami/kafka/templates/tls-secret.yaml +++ b/bitnami/kafka/templates/tls-secret.yaml @@ -30,10 +30,7 @@ kind: Secret metadata: name: {{ $secretName }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} @@ -50,10 +47,7 @@ kind: Secret metadata: name: {{ printf "%s-tls-passwords" (include "common.names.fullname" .) }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} @@ -72,10 +66,7 @@ kind: Secret metadata: name: {{ printf "%s-zookeeper-tls-passwords" (include "common.names.fullname" .) }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }}