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 diff --git a/charts/hdx-oss-v2/data/users.xml b/charts/hdx-oss-v2/data/users.xml index 3a3567e..0beb0bc 100644 --- a/charts/hdx-oss-v2/data/users.xml +++ b/charts/hdx-oss-v2/data/users.xml @@ -42,8 +42,8 @@ GRANT SELECT ON default.* - - {{ .Values.clickhouse.config.users.otelUserPassword }} + <{{ .Values.otel.clickhouseUser | default .Values.clickhouse.config.users.otelUserName }}> + {{ .Values.otel.clickhousePassword | default .Values.clickhouse.config.users.otelUserPassword }} {{- if .Values.clickhouse.config.clusterCidrs }} {{- range .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 d4f318c..ef5a313 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 .Values.clickhouse.config.users.otelUserName }} - 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/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 diff --git a/charts/hdx-oss-v2/values.yaml b/charts/hdx-oss-v2/values.yaml index 92603f7..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,6 +199,8 @@ otel: # Leave empty if you want to use the chart's Clickhouse service. # Example: clickhouseEndpoint: "tcp://custom-clickhouse-service:9000" clickhouseEndpoint: + 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. # Example: clickhousePrometheusEndpoint: "http://custom-clickhouse-service:9363"