Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/moody-lemons-open.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"helm-charts": patch
---

Reference credentials in secret
5 changes: 4 additions & 1 deletion charts/clickstack/templates/hyperdx-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ spec:
{{- else }}
{{- if .Values.hyperdx.defaultConnections }}
- name: DEFAULT_CONNECTIONS
value: {{ tpl .Values.hyperdx.defaultConnections . | quote }}
valueFrom:
secretKeyRef:
name: {{ include "clickstack.fullname" . }}-app-secrets
key: defaultConnections
{{- end }}
{{- if .Values.hyperdx.defaultSources }}
- name: DEFAULT_SOURCES
Expand Down
5 changes: 4 additions & 1 deletion charts/clickstack/templates/otel-collector-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ spec:
- name: CLICKHOUSE_USER
value: {{ .Values.otel.clickhouseUser | default .Values.clickhouse.config.users.otelUserName }}
- name: CLICKHOUSE_PASSWORD
value: {{ .Values.otel.clickhousePassword | default .Values.clickhouse.config.users.otelUserPassword }}
valueFrom:
secretKeyRef:
name: {{ include "clickstack.fullname" . }}-clickhouse-secrets
key: otelUserPassword
{{- if .Values.otel.customConfig }}
- name: CUSTOM_OTELCOL_CONFIG_FILE
value: /etc/otelcol-contrib/custom.config.yaml
Expand Down
3 changes: 2 additions & 1 deletion charts/clickstack/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
type: Opaque
data:
api-key: {{ .Values.hyperdx.apiKey | b64enc }}
defaultConnections: {{ .Values.hyperdx.defaultConnections | toString | b64enc }}
{{- if .Values.clickhouse.enabled }}
---
apiVersion: v1
Expand All @@ -19,4 +20,4 @@ type: Opaque
data:
appUserPassword: {{ .Values.clickhouse.config.users.appUserPassword | toString | b64enc }}
otelUserPassword: {{ .Values.clickhouse.config.users.otelUserPassword | toString | b64enc }}
{{- end }}
{{- end }}
16 changes: 5 additions & 11 deletions charts/clickstack/tests/external-connections-secret_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,10 @@ tests:
path: spec.template.spec.containers[0].env
content:
name: DEFAULT_CONNECTIONS
value: |
[
{
"name": "Local ClickHouse",
"host": "http://RELEASE-NAME-clickstack-clickhouse:8123",
"port": 8123,
"username": "app",
"password": "hyperdx"
}
]
valueFrom:
secretKeyRef:
key: defaultConnections
name: RELEASE-NAME-clickstack-app-secrets
- exists:
path: spec.template.spec.containers[0].env[?(@.name == "DEFAULT_SOURCES")]

Expand Down Expand Up @@ -252,4 +246,4 @@ tests:
secretKeyRef:
name: ""
key: "sources.json"
optional: false
optional: false
10 changes: 8 additions & 2 deletions charts/clickstack/tests/otel-collector_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ tests:
path: spec.template.spec.containers[0].env
content:
name: CLICKHOUSE_PASSWORD
value: test-password
valueFrom:
secretKeyRef:
name: test-release-clickstack-clickhouse-secrets
key: otelUserPassword
- documentSelector: *deployment-selector
contains:
path: spec.template.spec.containers[0].env
Expand Down Expand Up @@ -439,7 +442,10 @@ tests:
path: spec.template.spec.containers[0].env
content:
name: CLICKHOUSE_PASSWORD
value: "custom-password"
valueFrom:
secretKeyRef:
name: test-release-clickstack-clickhouse-secrets
key: otelUserPassword

- it: should render custom environment variables when specified
set:
Expand Down
Loading