Skip to content

Commit 4e246da

Browse files
authored
feat: support 'clickhouseUser' and 'clickhousePassword' values (#26)
1 parent cbeeb37 commit 4e246da

File tree

5 files changed

+47
-7
lines changed

5 files changed

+47
-7
lines changed

.changeset/fresh-papers-roll.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"helm-charts": patch
3+
---
4+
5+
feat: add 'clickhouseUser' and 'clickhousePassword' otel settings

charts/hdx-oss-v2/data/users.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
<query>GRANT SELECT ON default.*</query>
4343
</grants>
4444
</app>
45-
<otelcollector>
46-
<password>{{ .Values.clickhouse.config.users.otelUserPassword }}</password>
45+
<{{ .Values.otel.clickhouseUser | default .Values.clickhouse.config.users.otelUserName }}>
46+
<password>{{ .Values.otel.clickhousePassword | default .Values.clickhouse.config.users.otelUserPassword }}</password>
4747
<networks>
4848
{{- if .Values.clickhouse.config.clusterCidrs }}
4949
{{- range .Values.clickhouse.config.clusterCidrs }}
@@ -59,7 +59,7 @@
5959
<grants>
6060
<query>GRANT SELECT,INSERT,CREATE,SHOW ON default.*</query>
6161
</grants>
62-
</otelcollector>
62+
</{{ .Values.otel.clickhouseUser | default .Values.clickhouse.config.users.otelUserName }}>
6363
</users>
6464

6565
<quotas>

charts/hdx-oss-v2/templates/otel-collector-deployment.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ spec:
4848
name: {{ include "hdx-oss.fullname" . }}-app-secrets
4949
key: api-key
5050
- name: CLICKHOUSE_USER
51-
value: "otelcollector"
51+
value: {{ .Values.otel.clickhouseUser | default .Values.clickhouse.config.users.otelUserName }}
5252
- name: CLICKHOUSE_PASSWORD
53-
value: {{ .Values.clickhouse.config.users.otelUserPassword }}
53+
value: {{ .Values.otel.clickhousePassword | default .Values.clickhouse.config.users.otelUserPassword }}
5454
---
5555
apiVersion: v1
5656
kind: Service
@@ -78,4 +78,4 @@ spec:
7878
selector:
7979
{{- include "hdx-oss.selectorLabels" . | nindent 4 }}
8080
app: otel-collector
81-
{{- end }}
81+
{{- end }}

charts/hdx-oss-v2/tests/otel-collector_test.yaml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,4 +356,36 @@ tests:
356356
path: spec.template.spec.containers[0].env
357357
content:
358358
name: HYPERDX_OTEL_EXPORTER_CLICKHOUSE_DATABASE
359-
value: "custom_db"
359+
value: "custom_db"
360+
361+
- it: should use custom clickhouse credentials when specified
362+
set:
363+
otel:
364+
enabled: true
365+
image: hyperdx/hyperdx-otel-collector:2-beta
366+
clickhouseUser: "custom-user"
367+
clickhousePassword: "custom-password"
368+
hyperdx:
369+
logLevel: info
370+
clickhouse:
371+
config:
372+
users:
373+
otelUserPassword: default-password
374+
release:
375+
name: test-release
376+
asserts:
377+
- documentIndex: 0
378+
isKind:
379+
of: Deployment
380+
- documentIndex: 0
381+
contains:
382+
path: spec.template.spec.containers[0].env
383+
content:
384+
name: CLICKHOUSE_USER
385+
value: "custom-user"
386+
- documentIndex: 0
387+
contains:
388+
path: spec.template.spec.containers[0].env
389+
content:
390+
name: CLICKHOUSE_PASSWORD
391+
value: "custom-password"

charts/hdx-oss-v2/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ clickhouse:
176176
users:
177177
appUserPassword: "hyperdx"
178178
otelUserPassword: "otelcollectorpass"
179+
otelUserName: "otelcollector"
179180
# Network CIDRs for Kubernetes cluster access control
180181
# These CIDRs ensure ClickHouse connections are locked down to intra-cluster only
181182
# For PRODUCTION: Remove development CIDRs and keep only your cluster's specific CIDR
@@ -201,6 +202,8 @@ otel:
201202
# Leave empty if you want to use the chart's Clickhouse service.
202203
# Example: clickhouseEndpoint: "tcp://custom-clickhouse-service:9000"
203204
clickhouseEndpoint:
205+
clickhouseUser:
206+
clickhousePassword:
204207
# Clickhouse Prometheus endpoint - defaults to chart's Clickhouse prometheus service. Customize if you want to use a different Clickhouse prometheus service.
205208
# Leave empty if prometheus is disabled.
206209
# Example: clickhousePrometheusEndpoint: "http://custom-clickhouse-service:9363"

0 commit comments

Comments
 (0)