From dedcb74ab356d03f23105d0587f00151e2a429cf Mon Sep 17 00:00:00 2001 From: Prashant Shahi Date: Fri, 8 Nov 2024 20:50:20 +0530 Subject: [PATCH] chore(clickhouse): support custom labels and pod labels (#550) #### Chores - clickhouse: support custom labels and pod labels - bump up chart version: clickhouse 24.1.9 --------- Signed-off-by: Prashant Shahi --- charts/clickhouse/Chart.yaml | 2 +- .../clickhouse-instance/clickhouse-instance.yaml | 6 ++++++ .../templates/clickhouse-operator/deployment.yaml | 6 ++++++ charts/clickhouse/values.yaml | 10 ++++++++-- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/charts/clickhouse/Chart.yaml b/charts/clickhouse/Chart.yaml index 2bfac567..1b015d56 100644 --- a/charts/clickhouse/Chart.yaml +++ b/charts/clickhouse/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: clickhouse description: A Helm chart for ClickHouse type: application -version: 24.1.8 +version: 24.1.9 appVersion: "24.1.2" icon: https://github.com/ClickHouse/clickhouse-docs/raw/84f38d893eb7e561c7296279d7953b6a508ec413/static/img/clickhouse-logo.svg sources: diff --git a/charts/clickhouse/templates/clickhouse-instance/clickhouse-instance.yaml b/charts/clickhouse/templates/clickhouse-instance/clickhouse-instance.yaml index 93b6bd8a..de9826a8 100644 --- a/charts/clickhouse/templates/clickhouse-instance/clickhouse-instance.yaml +++ b/charts/clickhouse/templates/clickhouse-instance/clickhouse-instance.yaml @@ -5,6 +5,9 @@ metadata: namespace: {{ include "clickhouse.namespace" . }} labels: {{- include "clickhouse.labels" . | nindent 4 }} + {{- if .Values.labels }} + {{- toYaml .Values.labels | nindent 4 }} + {{- end }} {{- if .Values.annotations }} annotations: {{- toYaml .Values.annotations | nindent 4 }} @@ -131,6 +134,9 @@ spec: metadata: labels: {{- include "clickhouse.labels" . | nindent 12 }} + {{- if .Values.podLabels }} + {{- toYaml .Values.podLabels | nindent 12 }} + {{- end }} {{- with .Values.podAnnotations }} annotations: {{- toYaml . | nindent 12 }} diff --git a/charts/clickhouse/templates/clickhouse-operator/deployment.yaml b/charts/clickhouse/templates/clickhouse-operator/deployment.yaml index a036fc73..cfa7acc6 100644 --- a/charts/clickhouse/templates/clickhouse-operator/deployment.yaml +++ b/charts/clickhouse/templates/clickhouse-operator/deployment.yaml @@ -5,6 +5,9 @@ metadata: namespace: {{ include "clickhouse.namespace" . }} labels: {{- include "clickhouseOperator.labels" . | nindent 4 }} + {{- if .Values.clickhouseOperator.labels }} + {{- toYaml .Values.clickhouseOperator.labels | nindent 4 }} + {{- end }} {{- if .Values.clickhouseOperator.annotations }} annotations: {{- toYaml .Values.clickhouseOperator.annotations | nindent 4 }} @@ -27,6 +30,9 @@ spec: checksum/usersd-files: {{ include (print $.Template.BasePath "/clickhouse-operator/configmaps/etc-usersd-files.yaml") . | sha256sum }} labels: {{- include "clickhouseOperator.selectorLabels" . | nindent 8 }} + {{- if .Values.clickhouseOperator.podLabels }} + {{- toYaml .Values.clickhouseOperator.podLabels | nindent 8 }} + {{- end }} spec: {{- include "clickhouseOperator.imagePullSecrets" . | indent 6 }} serviceAccountName: {{ include "clickhouseOperator.serviceAccountName" . }} diff --git a/charts/clickhouse/values.yaml b/charts/clickhouse/values.yaml index 4d32c9b1..9715d380 100644 --- a/charts/clickhouse/values.yaml +++ b/charts/clickhouse/values.yaml @@ -178,7 +178,10 @@ image: # If global.imagePullSecrets is set as well, it will merged. imagePullSecrets: [] # - "clickhouse-pull-secret" - +# ClickHouse instance labels +labels: {} +# ClickHouse pod labels +podLabels: {} # -- ClickHouse instance annotations. annotations: {} @@ -487,9 +490,12 @@ clickhouseOperator: # If not set and create is true, a name is generated using the fullname template name: + # ClickHouse operator deployment labels + labels: {} + # ClickHouse operator pod labels + podLabels: {} # -- Clickhouse Operator deployment annotations annotations: {} - # -- Clickhouse Operator pod(s) annotation. podAnnotations: {} # signoz.io/port: '8888'