From 3a0f9dbf41600280c5dbd72062a245015b322f7f Mon Sep 17 00:00:00 2001 From: Warren <5959690+wrn14897@users.noreply.github.com> Date: Tue, 3 Jun 2025 07:58:36 -0700 Subject: [PATCH 1/5] feat: support 'clickhouseUser' and 'clickhousePassword' values --- charts/hdx-oss-v2/templates/otel-collector-deployment.yaml | 6 +++--- charts/hdx-oss-v2/values.yaml | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/charts/hdx-oss-v2/templates/otel-collector-deployment.yaml b/charts/hdx-oss-v2/templates/otel-collector-deployment.yaml index d4f318c..1471762 100644 --- a/charts/hdx-oss-v2/templates/otel-collector-deployment.yaml +++ b/charts/hdx-oss-v2/templates/otel-collector-deployment.yaml @@ -48,9 +48,9 @@ spec: name: {{ include "hdx-oss.fullname" . }}-app-secrets key: api-key - name: CLICKHOUSE_USER - value: "otelcollector" + value: {{ .Values.otel.clickhouseUser | default "otelcollector" }} - name: CLICKHOUSE_PASSWORD - value: {{ .Values.clickhouse.config.users.otelUserPassword }} + value: {{ .Values.otel.clickhousePassword | default .Values.clickhouse.config.users.otelUserPassword }} --- apiVersion: v1 kind: Service @@ -78,4 +78,4 @@ spec: selector: {{- include "hdx-oss.selectorLabels" . | nindent 4 }} app: otel-collector -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/hdx-oss-v2/values.yaml b/charts/hdx-oss-v2/values.yaml index 92603f7..2d19b92 100644 --- a/charts/hdx-oss-v2/values.yaml +++ b/charts/hdx-oss-v2/values.yaml @@ -198,6 +198,8 @@ otel: # Leave empty if you want to use the chart's Clickhouse service. # Example: clickhouseEndpoint: "tcp://custom-clickhouse-service:9000" clickhouseEndpoint: + clickhouseUser: "otelcollector" + clickhousePassword: # Clickhouse Prometheus endpoint - defaults to chart's Clickhouse prometheus service. Customize if you want to use a different Clickhouse prometheus service. # Leave empty if prometheus is disabled. # Example: clickhousePrometheusEndpoint: "http://custom-clickhouse-service:9363" From b68e2349348277e7c39cde21a8e109cae334c23d Mon Sep 17 00:00:00 2001 From: Warren <5959690+wrn14897@users.noreply.github.com> Date: Tue, 3 Jun 2025 08:04:02 -0700 Subject: [PATCH 2/5] ci: add test --- .../hdx-oss-v2/tests/otel-collector_test.yaml | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/charts/hdx-oss-v2/tests/otel-collector_test.yaml b/charts/hdx-oss-v2/tests/otel-collector_test.yaml index 0ed90fa..ab6cc5e 100644 --- a/charts/hdx-oss-v2/tests/otel-collector_test.yaml +++ b/charts/hdx-oss-v2/tests/otel-collector_test.yaml @@ -356,4 +356,36 @@ tests: path: spec.template.spec.containers[0].env content: name: HYPERDX_OTEL_EXPORTER_CLICKHOUSE_DATABASE - value: "custom_db" \ No newline at end of file + value: "custom_db" + + - it: should use custom clickhouse credentials when specified + set: + otel: + enabled: true + image: hyperdx/hyperdx-otel-collector:2-beta + clickhouseUser: "custom-user" + clickhousePassword: "custom-password" + hyperdx: + logLevel: info + clickhouse: + config: + users: + otelUserPassword: default-password + release: + name: test-release + asserts: + - documentIndex: 0 + isKind: + of: Deployment + - documentIndex: 0 + contains: + path: spec.template.spec.containers[0].env + content: + name: CLICKHOUSE_USER + value: "custom-user" + - documentIndex: 0 + contains: + path: spec.template.spec.containers[0].env + content: + name: CLICKHOUSE_PASSWORD + value: "custom-password" \ No newline at end of file From 16437a7957ce07e2f04d499eb5d8fc89141b9a65 Mon Sep 17 00:00:00 2001 From: Warren <5959690+wrn14897@users.noreply.github.com> Date: Tue, 3 Jun 2025 09:39:32 -0700 Subject: [PATCH 3/5] docs: add changeset --- .changeset/fresh-papers-roll.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fresh-papers-roll.md diff --git a/.changeset/fresh-papers-roll.md b/.changeset/fresh-papers-roll.md new file mode 100644 index 0000000..d0739bf --- /dev/null +++ b/.changeset/fresh-papers-roll.md @@ -0,0 +1,5 @@ +--- +"helm-charts": patch +--- + +feat: add 'clickhouseUser' and 'clickhousePassword' otel settings From ef334c8b2d8f9d060dde2ad2e7905f3bafaa23b5 Mon Sep 17 00:00:00 2001 From: Warren Lee <5959690+wrn14897@users.noreply.github.com> Date: Tue, 3 Jun 2025 14:14:17 -0700 Subject: [PATCH 4/5] feedback: update otelcollector password mapping --- charts/hdx-oss-v2/data/users.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/hdx-oss-v2/data/users.xml b/charts/hdx-oss-v2/data/users.xml index 3a3567e..397af1f 100644 --- a/charts/hdx-oss-v2/data/users.xml +++ b/charts/hdx-oss-v2/data/users.xml @@ -43,7 +43,7 @@ - {{ .Values.clickhouse.config.users.otelUserPassword }} + {{ .Values.otel.clickhousePassword | default .Values.clickhouse.config.users.otelUserPassword }} {{- if .Values.clickhouse.config.clusterCidrs }} {{- range .Values.clickhouse.config.clusterCidrs }} From 2f160cdbc4f89c1ec28e1ba18a529bd309c28c3e Mon Sep 17 00:00:00 2001 From: Warren <5959690+wrn14897@users.noreply.github.com> Date: Wed, 4 Jun 2025 10:35:29 -0700 Subject: [PATCH 5/5] feat: inject otel.clickhouseUser and clickhouse.config.users.otelUserName --- charts/hdx-oss-v2/data/users.xml | 4 ++-- charts/hdx-oss-v2/templates/otel-collector-deployment.yaml | 2 +- charts/hdx-oss-v2/values.yaml | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/charts/hdx-oss-v2/data/users.xml b/charts/hdx-oss-v2/data/users.xml index 397af1f..0beb0bc 100644 --- a/charts/hdx-oss-v2/data/users.xml +++ b/charts/hdx-oss-v2/data/users.xml @@ -42,7 +42,7 @@ GRANT SELECT ON default.* - + <{{ .Values.otel.clickhouseUser | default .Values.clickhouse.config.users.otelUserName }}> {{ .Values.otel.clickhousePassword | default .Values.clickhouse.config.users.otelUserPassword }} {{- if .Values.clickhouse.config.clusterCidrs }} @@ -59,7 +59,7 @@ GRANT SELECT,INSERT,CREATE,SHOW ON default.* - + diff --git a/charts/hdx-oss-v2/templates/otel-collector-deployment.yaml b/charts/hdx-oss-v2/templates/otel-collector-deployment.yaml index 1471762..ef5a313 100644 --- a/charts/hdx-oss-v2/templates/otel-collector-deployment.yaml +++ b/charts/hdx-oss-v2/templates/otel-collector-deployment.yaml @@ -48,7 +48,7 @@ spec: name: {{ include "hdx-oss.fullname" . }}-app-secrets key: api-key - name: CLICKHOUSE_USER - value: {{ .Values.otel.clickhouseUser | default "otelcollector" }} + value: {{ .Values.otel.clickhouseUser | default .Values.clickhouse.config.users.otelUserName }} - name: CLICKHOUSE_PASSWORD value: {{ .Values.otel.clickhousePassword | default .Values.clickhouse.config.users.otelUserPassword }} --- diff --git a/charts/hdx-oss-v2/values.yaml b/charts/hdx-oss-v2/values.yaml index 2d19b92..0d67f05 100644 --- a/charts/hdx-oss-v2/values.yaml +++ b/charts/hdx-oss-v2/values.yaml @@ -173,6 +173,7 @@ clickhouse: users: appUserPassword: "hyperdx" otelUserPassword: "otelcollectorpass" + otelUserName: "otelcollector" # Network CIDRs for Kubernetes cluster access control # These CIDRs ensure ClickHouse connections are locked down to intra-cluster only # For PRODUCTION: Remove development CIDRs and keep only your cluster's specific CIDR @@ -198,7 +199,7 @@ otel: # Leave empty if you want to use the chart's Clickhouse service. # Example: clickhouseEndpoint: "tcp://custom-clickhouse-service:9000" clickhouseEndpoint: - clickhouseUser: "otelcollector" + clickhouseUser: clickhousePassword: # Clickhouse Prometheus endpoint - defaults to chart's Clickhouse prometheus service. Customize if you want to use a different Clickhouse prometheus service. # Leave empty if prometheus is disabled.