From 1b3bb1d4958cb49cd778a3fd753a7057e7562679 Mon Sep 17 00:00:00 2001 From: Juan Ariza Toledano Date: Mon, 28 Aug 2023 13:10:35 +0200 Subject: [PATCH] [bitnami/clickhouse] Support for customizing standard labels (#18461) --- bitnami/clickhouse/Chart.lock | 6 +-- bitnami/clickhouse/Chart.yaml | 2 +- .../clickhouse/templates/configmap-extra.yaml | 5 +-- .../templates/configmap-users-extra.yaml | 5 +-- bitnami/clickhouse/templates/configmap.yaml | 5 +-- .../templates/ingress-tls-secrets.yaml | 12 ++---- bitnami/clickhouse/templates/ingress.yaml | 16 +++----- .../templates/init-scripts-secret.yaml | 5 +-- .../clickhouse/templates/prometheusrule.yaml | 11 +----- .../templates/scripts-configmap.yaml | 5 +-- bitnami/clickhouse/templates/secret.yaml | 5 +-- .../clickhouse/templates/service-account.yaml | 14 ++----- .../templates/service-external-access.yaml | 12 ++---- .../templates/service-headless.yaml | 17 +++------ bitnami/clickhouse/templates/service.yaml | 17 +++------ .../clickhouse/templates/servicemonitor.yaml | 22 ++++------- .../templates/start-scripts-secret.yaml | 5 +-- bitnami/clickhouse/templates/statefulset.yaml | 37 ++++++------------- bitnami/clickhouse/templates/tls-secret.yaml | 5 +-- 19 files changed, 58 insertions(+), 148 deletions(-) diff --git a/bitnami/clickhouse/Chart.lock b/bitnami/clickhouse/Chart.lock index 9792281a19..d956882d90 100644 --- a/bitnami/clickhouse/Chart.lock +++ b/bitnami/clickhouse/Chart.lock @@ -4,6 +4,6 @@ dependencies: version: 11.4.11 - name: common repository: oci://registry-1.docker.io/bitnamicharts - version: 2.8.0 -digest: sha256:63d2b26d75270dc04ffaa7ab77c5a066c43fed92a84d381bcaffea0d390081fa -generated: "2023-08-18T16:20:21.293473622Z" + version: 2.9.0 +digest: sha256:55b494b839c8ea02a7754c61e80794e3bb3de1cb3a1600cf2abe361d7a9156b3 +generated: "2023-08-23T15:56:41.338771+02:00" diff --git a/bitnami/clickhouse/Chart.yaml b/bitnami/clickhouse/Chart.yaml index b33eaee09a..6d0c365425 100644 --- a/bitnami/clickhouse/Chart.yaml +++ b/bitnami/clickhouse/Chart.yaml @@ -33,4 +33,4 @@ maintainers: name: clickhouse sources: - https://github.com/bitnami/charts/tree/main/bitnami/clickhouse -version: 3.6.9 +version: 3.7.0 diff --git a/bitnami/clickhouse/templates/configmap-extra.yaml b/bitnami/clickhouse/templates/configmap-extra.yaml index d9dae5e6ae..153cf4d501 100644 --- a/bitnami/clickhouse/templates/configmap-extra.yaml +++ b/bitnami/clickhouse/templates/configmap-extra.yaml @@ -9,11 +9,8 @@ kind: ConfigMap metadata: name: {{ printf "%s-extra" (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: clickhouse - {{- 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/clickhouse/templates/configmap-users-extra.yaml b/bitnami/clickhouse/templates/configmap-users-extra.yaml index 35c81769fb..056d2d0262 100644 --- a/bitnami/clickhouse/templates/configmap-users-extra.yaml +++ b/bitnami/clickhouse/templates/configmap-users-extra.yaml @@ -9,11 +9,8 @@ kind: ConfigMap metadata: name: {{ printf "%s-users-extra" (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: clickhouse - {{- 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/clickhouse/templates/configmap.yaml b/bitnami/clickhouse/templates/configmap.yaml index 9d71579d5e..2462712b5d 100644 --- a/bitnami/clickhouse/templates/configmap.yaml +++ b/bitnami/clickhouse/templates/configmap.yaml @@ -9,11 +9,8 @@ kind: ConfigMap 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: clickhouse - {{- 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/clickhouse/templates/ingress-tls-secrets.yaml b/bitnami/clickhouse/templates/ingress-tls-secrets.yaml index ea1c50e90c..6ef20e36a8 100644 --- a/bitnami/clickhouse/templates/ingress-tls-secrets.yaml +++ b/bitnami/clickhouse/templates/ingress-tls-secrets.yaml @@ -11,12 +11,9 @@ kind: Secret metadata: name: {{ .name }} 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: kubernetes.io/tls data: @@ -34,10 +31,7 @@ kind: Secret metadata: name: {{ $secretName }} 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 }} diff --git a/bitnami/clickhouse/templates/ingress.yaml b/bitnami/clickhouse/templates/ingress.yaml index 59ed303bb5..6cbed539ea 100644 --- a/bitnami/clickhouse/templates/ingress.yaml +++ b/bitnami/clickhouse/templates/ingress.yaml @@ -9,17 +9,11 @@ kind: Ingress metadata: name: {{ include "common.names.fullname" . }} 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 }} - annotations: - {{- if .Values.ingress.annotations }} - {{- include "common.tplvalues.render" (dict "value" .Values.ingress.annotations "context" $) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- if or .Values.ingress.annotations .Values.commonAnnotations }} + {{- $annotations := merge .Values.ingress.annotations .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} + {{- end }} spec: {{- if and .Values.ingress.ingressClassName (eq "true" (include "common.ingress.supportsIngressClassname" .)) }} ingressClassName: {{ .Values.ingress.ingressClassName | quote }} diff --git a/bitnami/clickhouse/templates/init-scripts-secret.yaml b/bitnami/clickhouse/templates/init-scripts-secret.yaml index 1e64f3f6f7..3236709302 100644 --- a/bitnami/clickhouse/templates/init-scripts-secret.yaml +++ b/bitnami/clickhouse/templates/init-scripts-secret.yaml @@ -9,11 +9,8 @@ kind: Secret metadata: name: {{ printf "%s-init-scripts" (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: clickhouse - {{- 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/clickhouse/templates/prometheusrule.yaml b/bitnami/clickhouse/templates/prometheusrule.yaml index 2e743fcae2..dc2d05d3a5 100644 --- a/bitnami/clickhouse/templates/prometheusrule.yaml +++ b/bitnami/clickhouse/templates/prometheusrule.yaml @@ -8,16 +8,9 @@ apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: name: {{ include "common.names.fullname" . }} - {{- if .Values.metrics.prometheusRule.namespace }} - namespace: {{ .Values.metrics.prometheusRule.namespace }} - {{- else }} - namespace: {{ .Release.Namespace }} - {{- end }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + namespace: {{ default .Release.Namespace .Values.metrics.prometheusRule.namespace | quote }} + 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.metrics.prometheusRule.additionalLabels }} {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.prometheusRule.additionalLabels "context" $ ) | nindent 4 }} {{- end }} diff --git a/bitnami/clickhouse/templates/scripts-configmap.yaml b/bitnami/clickhouse/templates/scripts-configmap.yaml index 0d563dc9e6..86aa34dcdb 100644 --- a/bitnami/clickhouse/templates/scripts-configmap.yaml +++ b/bitnami/clickhouse/templates/scripts-configmap.yaml @@ -8,11 +8,8 @@ kind: ConfigMap metadata: name: {{ printf "%s-scripts" (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: clickhouse - {{- 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/clickhouse/templates/secret.yaml b/bitnami/clickhouse/templates/secret.yaml index eb12299db4..16068010ad 100644 --- a/bitnami/clickhouse/templates/secret.yaml +++ b/bitnami/clickhouse/templates/secret.yaml @@ -9,11 +9,8 @@ kind: Secret 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: clickhouse - {{- 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/clickhouse/templates/service-account.yaml b/bitnami/clickhouse/templates/service-account.yaml index 2e0eb37f7b..727884fb32 100644 --- a/bitnami/clickhouse/templates/service-account.yaml +++ b/bitnami/clickhouse/templates/service-account.yaml @@ -9,19 +9,11 @@ kind: ServiceAccount metadata: name: {{ include "clickhouse.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: clickhouse - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if or .Values.serviceAccount.annotations .Values.commonAnnotations }} - 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 }} + {{- $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/clickhouse/templates/service-external-access.yaml b/bitnami/clickhouse/templates/service-external-access.yaml index 81b9db2d18..9f9b98e5bc 100644 --- a/bitnami/clickhouse/templates/service-external-access.yaml +++ b/bitnami/clickhouse/templates/service-external-access.yaml @@ -15,15 +15,10 @@ kind: Service metadata: name: {{ printf "%s-external" $targetPod | trunc 63 | trimSuffix "-" }} namespace: {{ $.Release.Namespace | quote }} - labels: {{- include "common.labels.standard" $ | nindent 4 }} + {{- $labels := merge $.Values.externalAccess.service.labels $.Values.commonLabels }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }} app.kubernetes.io/component: clickhouse pod: {{ $targetPod }} - {{- if $.Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" $.Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if $.Values.externalAccess.service.labels }} - {{- include "common.tplvalues.render" ( dict "value" $.Values.externalAccess.service.labels "context" $) | nindent 4 }} - {{- end }} {{- if or $.Values.externalAccess.service.annotations $.Values.commonAnnotations $.Values.externalAccess.service.loadBalancerAnnotations }} annotations: {{- if and (not (empty $.Values.externalAccess.service.loadBalancerAnnotations)) (eq (len $.Values.externalAccess.service.loadBalancerAnnotations) $totalNodes) }} @@ -148,7 +143,8 @@ spec: {{- if $.Values.externalAccess.service.extraPorts }} {{- include "common.tplvalues.render" (dict "value" $.Values.externalAccess.service.extraPorts "context" $) | nindent 4 }} {{- end }} - selector: {{- include "common.labels.matchLabels" $ | nindent 4 }} + {{- $podLabels := merge $.Values.podLabels $.Values.commonLabels }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: clickhouse statefulset.kubernetes.io/pod-name: {{ $targetPod }} --- diff --git a/bitnami/clickhouse/templates/service-headless.yaml b/bitnami/clickhouse/templates/service-headless.yaml index 47380c896d..119fb4402d 100644 --- a/bitnami/clickhouse/templates/service-headless.yaml +++ b/bitnami/clickhouse/templates/service-headless.yaml @@ -8,19 +8,11 @@ kind: Service metadata: name: {{ include "clickhouse.headlessServiceName" . }} 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: clickhouse - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if or .Values.service.headless.annotations .Values.commonAnnotations }} - annotations: - {{- if .Values.service.headless.annotations }} - {{- include "common.tplvalues.render" (dict "value" .Values.service.headless.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.annotations .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} {{- end }} spec: type: ClusterIP @@ -72,5 +64,6 @@ 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 }} + {{- $podLabels := merge .Values.podLabels .Values.commonLabels }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: clickhouse diff --git a/bitnami/clickhouse/templates/service.yaml b/bitnami/clickhouse/templates/service.yaml index 743a2e18b5..416acca8a7 100644 --- a/bitnami/clickhouse/templates/service.yaml +++ b/bitnami/clickhouse/templates/service.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: clickhouse - {{- 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 }} @@ -155,5 +147,6 @@ 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 }} + {{- $podLabels := merge .Values.podLabels .Values.commonLabels }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: clickhouse diff --git a/bitnami/clickhouse/templates/servicemonitor.yaml b/bitnami/clickhouse/templates/servicemonitor.yaml index 8fe7320987..0bbdfd72f6 100644 --- a/bitnami/clickhouse/templates/servicemonitor.yaml +++ b/bitnami/clickhouse/templates/servicemonitor.yaml @@ -9,25 +9,17 @@ kind: ServiceMonitor metadata: name: {{ include "common.names.fullname" . }} namespace: {{ default (include "common.names.namespace" .) .Values.metrics.serviceMonitor.namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- $labels := merge .Values.metrics.serviceMonitor.labels .Values.commonLabels }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }} app.kubernetes.io/component: clickhouse - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.labels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.serviceMonitor.labels "context" $ ) | nindent 4 }} - {{- end }} - annotations: - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.annotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.serviceMonitor.annotations "context" $ ) | nindent 4 }} - {{- end }} + {{- if or .Values.metrics.serviceMonitor.annotations .Values.commonAnnotations }} + {{- $annotations := merge .Values.metrics.serviceMonitor.annotations .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} + {{- end }} spec: jobLabel: {{ .Values.metrics.serviceMonitor.jobLabel | quote }} 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/clickhouse/templates/start-scripts-secret.yaml b/bitnami/clickhouse/templates/start-scripts-secret.yaml index 49fcf72f57..c579f2e468 100644 --- a/bitnami/clickhouse/templates/start-scripts-secret.yaml +++ b/bitnami/clickhouse/templates/start-scripts-secret.yaml @@ -9,11 +9,8 @@ kind: Secret metadata: name: {{ printf "%s-start-scripts" (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: clickhouse - {{- 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/clickhouse/templates/statefulset.yaml b/bitnami/clickhouse/templates/statefulset.yaml index ec449b4148..3dfd2145a9 100644 --- a/bitnami/clickhouse/templates/statefulset.yaml +++ b/bitnami/clickhouse/templates/statefulset.yaml @@ -10,19 +10,17 @@ kind: StatefulSet metadata: name: {{ printf "%s-shard%d" (include "common.names.fullname" $ ) $i }} 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: clickhouse - {{- 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: {{ $.Values.replicaCount }} podManagementPolicy: {{ $.Values.podManagementPolicy | quote }} + {{- $podLabels := merge $.Values.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: clickhouse serviceName: {{ printf "%s-headless" (include "common.names.fullname" $) }} {{- if $.Values.updateStrategy }} @@ -40,11 +38,8 @@ spec: {{- if and $.Values.metrics.enabled $.Values.metrics.podAnnotations }} {{- include "common.tplvalues.render" (dict "value" $.Values.metrics.podAnnotations "context" $) | nindent 8 }} {{- end }} - labels: {{- include "common.labels.standard" $ | nindent 8 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} app.kubernetes.io/component: clickhouse - {{- if $.Values.podLabels }} - {{- include "common.tplvalues.render" (dict "value" $.Values.podLabels "context" $) | nindent 8 }} - {{- end }} shard: {{ $i | quote }} spec: serviceAccountName: {{ template "clickhouse.serviceAccountName" $ }} @@ -56,8 +51,8 @@ spec: affinity: {{- include "common.tplvalues.render" ( dict "value" $.Values.affinity "context" $) | nindent 8 }} {{- else }} affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" $.Values.podAffinityPreset "component" "clickhouse" "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" $.Values.podAntiAffinityPreset "component" "clickhouse" "context" $) | nindent 10 }} + podAffinity: {{- include "common.affinities.pods" (dict "type" $.Values.podAffinityPreset "component" "clickhouse" "customLabels" $podLabels "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" $.Values.podAntiAffinityPreset "component" "clickhouse" "customLabels" $podLabels "context" $) | nindent 10 }} nodeAffinity: {{- include "common.affinities.nodes" (dict "type" $.Values.nodeAffinityPreset.type "key" $.Values.nodeAffinityPreset.key "values" $.Values.nodeAffinityPreset.values) | nindent 10 }} {{- end }} {{- if $.Values.nodeSelector }} @@ -408,21 +403,13 @@ spec: volumeClaimTemplates: - metadata: name: data - annotations: - {{- if $.Values.persistence.annotations }} - {{- include "common.tplvalues.render" (dict "value" $.Values.persistence.annotations "context" $) | nindent 10 }} - {{- end }} - {{- if $.Values.commonAnnotations }} - {{- include "common.tplvalues.render" (dict "value" $.Values.commonAnnotations "context" $) | nindent 10 }} - {{- end }} - labels: {{- include "common.labels.matchLabels" $ | nindent 10 }} + {{- if or $.Values.persistence.annotations $.Values.commonAnnotations }}} + {{- $claimAnnotations := merge $.Values.persistence.annotations $.Values.commonLabels }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $claimAnnotations "context" $ ) | nindent 10 }} + {{- end }} + {{- $claimLabels := merge $.Values.persistence.labels $.Values.commonLabels }} + labels: {{- include "common.labels.matchLabels" ( dict "customLabels" $claimLabels "context" $ ) | nindent 10 }} app.kubernetes.io/component: clickhouse - {{- if $.Values.commonLabels }} - {{- include "common.tplvalues.render" (dict "value" $.Values.commonLabels "context" $) | nindent 10 }} - {{- end }} - {{- if $.Values.persistence.labels }} - {{- include "common.tplvalues.render" (dict "value" $.Values.persistence.labels "context" $) | nindent 10 }} - {{- end }} spec: accessModes: {{- range $.Values.persistence.accessModes }} diff --git a/bitnami/clickhouse/templates/tls-secret.yaml b/bitnami/clickhouse/templates/tls-secret.yaml index 2c068a197c..04b188e148 100644 --- a/bitnami/clickhouse/templates/tls-secret.yaml +++ b/bitnami/clickhouse/templates/tls-secret.yaml @@ -17,10 +17,7 @@ kind: Secret metadata: name: {{ $secretName }} 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 }}