feat: support existing secrets for redis & clickhouse

This commit is contained in:
Matías Plaza
2026-01-27 10:53:29 +01:00
parent b509b57bb8
commit f079a2b9e6
5 changed files with 44 additions and 2 deletions

View File

@@ -92,8 +92,13 @@ spec:
- name: CLICKHOUSE_PASSWORD
valueFrom:
secretKeyRef:
{{- if .Values.clickhouse.auth.existingSecret.name }}
name: {{ .Values.clickhouse.auth.existingSecret.name }}
key: {{ .Values.clickhouse.auth.existingSecret.passwordKey }}
{{- else }}
name: {{ .Release.Name }}-clickhouse
key: admin-password
{{- end }}
- name: CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT
value: "1"
livenessProbe:

View File

@@ -79,8 +79,13 @@ spec:
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
{{- if .Values.redis.auth.existingSecret.name }}
name: {{ .Values.redis.auth.existingSecret.name }}
key: {{ .Values.redis.auth.existingSecret.passwordKey }}
{{- else }}
name: {{ .Release.Name }}-redis
key: redis-password
{{- end }}
livenessProbe:
exec:
command:

View File

@@ -64,7 +64,7 @@ stringData:
---
{{- if .Values.redis.enabled }}
{{- if and .Values.redis.enabled (not .Values.redis.auth.existingSecret.name) }}
apiVersion: v1
kind: Secret
metadata:
@@ -217,7 +217,7 @@ stringData:
---
{{- if .Values.clickhouse.enabled }}
{{- if and .Values.clickhouse.enabled (not .Values.clickhouse.auth.existingSecret.name) }}
apiVersion: v1
kind: Secret
metadata:

View File

@@ -349,6 +349,18 @@
},
"password": {
"type": ["string", "null"]
},
"existingSecret": {
"type": "object",
"properties": {
"name": {
"type": ["string", "null"]
},
"passwordKey": {
"type": ["string", "null"]
}
},
"additionalProperties": false
}
},
"additionalProperties": false
@@ -450,6 +462,18 @@
"properties": {
"password": {
"type": ["string", "null"]
},
"existingSecret": {
"type": "object",
"properties": {
"name": {
"type": ["string", "null"]
},
"passwordKey": {
"type": ["string", "null"]
}
},
"additionalProperties": false
}
},
"additionalProperties": false

View File

@@ -132,6 +132,10 @@ clickhouse:
username: oneuptime
# Will be auto-generated if not provided
password:
# Use an existing secret for the ClickHouse password
existingSecret:
name:
passwordKey:
image:
repository: clickhouse/clickhouse-server
tag: latest
@@ -197,6 +201,10 @@ redis:
auth:
# Will be auto-generated if not provided
password:
# Use an existing secret for the Redis password
existingSecret:
name:
passwordKey:
image:
repository: redis
tag: latest