Skip to content

Commit a48f91c

Browse files
authored
feat: add clickhouse ssl config (#1671)
1 parent c804619 commit a48f91c

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

charts/sentry/templates/_helper.tpl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,33 @@ Set ClickHouse cluster name
412412
{{- end -}}
413413
{{- end -}}
414414

415+
{{/*
416+
Set ClickHouse secure setting
417+
*/}}
418+
{{- define "sentry.clickhouse.secure" -}}
419+
{{- if and (.Values.externalClickhouse.enabled) (.Values.externalClickhouse.secure) -}}
420+
True
421+
{{- end -}}
422+
{{- end -}}
423+
424+
{{/*
425+
Set ClickHouse ca_certs setting
426+
*/}}
427+
{{- define "sentry.clickhouse.ca_certs" -}}
428+
{{- if and (.Values.externalClickhouse.enabled) (.Values.externalClickhouse.ca_certs) -}}
429+
{{ .Values.externalClickhouse.ca_certs }}
430+
{{- end -}}
431+
{{- end -}}
432+
433+
{{/*
434+
Set ClickHouse verify ca setting
435+
*/}}
436+
{{- define "sentry.clickhouse.verify" -}}
437+
{{- if and (.Values.externalClickhouse.enabled) (.Values.externalClickhouse.verify) -}}
438+
True
439+
{{- end -}}
440+
{{- end -}}
441+
415442
{{/*
416443
Set Kafka Confluent host
417444
*/}}

charts/sentry/templates/snuba/_helper-snuba.tpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ settings.py: |
3636
{
3737
"host": env("CLICKHOUSE_HOST", {{ include "sentry.clickhouse.host" . | quote }}),
3838
"port": int({{ include "sentry.clickhouse.port" . }}),
39+
"secure": env("CLICKHOUSE_SECURE", False),
40+
"ca_certs": env("CLICKHOUSE_CA_CERTS", None),
41+
"verify": env("CLICKHOUSE_VERIFY", False),
3942
"user": env("CLICKHOUSE_USER", "default"),
4043
"password": env("CLICKHOUSE_PASSWORD", ""),
4144
"max_connections": int(os.environ.get("CLICKHOUSE_MAX_CONNECTIONS", 100)),

charts/sentry/templates/snuba/secret-snuba-env.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,12 @@ data:
1515
{{- if not .Values.externalClickhouse.existingSecret }}
1616
CLICKHOUSE_PASSWORD: {{ include "sentry.clickhouse.password" . | b64enc | quote }}
1717
{{- end }}
18+
{{- if not .Values.externalClickhouse.secure }}
19+
CLICKHOUSE_SECURE: {{ include "sentry.clickhouse.secure" . | b64enc | quote }}
20+
{{- end }}
21+
{{- if not .Values.externalClickhouse.ca_certs }}
22+
CLICKHOUSE_CA_CERTS: {{ include "sentry.clickhouse.ca_certs" . | b64enc | quote }}
23+
{{- end }}
24+
{{- if not .Values.externalClickhouse.verify }}
25+
CLICKHOUSE_VERIFY: {{ include "sentry.clickhouse.verify" . | b64enc | quote }}
26+
{{- end }}

0 commit comments

Comments
 (0)