@@ -333,7 +333,7 @@ Set ClickHouse host
333333*/} }
334334{ {- define " sentry.clickhouse.host" -} }
335335{ {- if .Values.clickhouse.enabled -} }
336- { {- template " sentry. clickhouse.fullname " . -} }
336+ { {- include " clickhouse.headlessServiceName " $.Subcharts.clickhouse -} }
337337{ {- else -} }
338338{ { required " A valid .Values.externalClickhouse.host is required" .Values.externalClickhouse.host } }
339339{ {- end -} }
@@ -344,7 +344,7 @@ Set ClickHouse port
344344*/} }
345345{ {- define " sentry.clickhouse.port" -} }
346346{ {- if .Values.clickhouse.enabled -} }
347- { {- default 9000 .Values.clickhouse.clickhouse.tcp_port } }
347+ { {- default 9000 .Values.clickhouse.service.ports.tcp } }
348348{ {- else -} }
349349{ { required " A valid .Values.externalClickhouse.tcpPort is required" .Values.externalClickhouse.tcpPort } }
350350{ {- end -} }
@@ -355,7 +355,7 @@ Set ClickHouse HTTP port
355355*/} }
356356{ {- define " sentry.clickhouse.http_port" -} }
357357{ {- if .Values.clickhouse.enabled -} }
358- { {- default 8123 .Values.clickhouse.clickhouse.http_port } }
358+ { {- default 8123 .Values.clickhouse.service.ports.http } }
359359{ {- else -} }
360360{ { required " A valid .Values.externalClickhouse.httpPort is required" .Values.externalClickhouse.httpPort } }
361361{ {- end -} }
@@ -377,11 +377,7 @@ Set ClickHouse User
377377*/} }
378378{ {- define " sentry.clickhouse.username" -} }
379379{ {- if .Values.clickhouse.enabled -} }
380- { {- if .Values.clickhouse.clickhouse.configmap.users.enabled -} }
381- { { (index .Values.clickhouse.clickhouse.configmap.users.user 0).name } }
382- { {- else -} }
383- default
384- { {- end -} }
380+ { { default " default" .Values.clickhouse.auth.username } }
385381{ {- else -} }
386382{ { required " A valid .Values.externalClickhouse.username is required" .Values.externalClickhouse.username } }
387383{ {- end -} }
@@ -391,38 +387,22 @@ default
391387Set ClickHouse Password
392388*/} }
393389{ {- define " sentry.clickhouse.password" -} }
394- { {- if .Values.clickhouse.enabled -} }
395- { {- if .Values.clickhouse.clickhouse.configmap.users.enabled -} }
396- { { (index .Values.clickhouse.clickhouse.configmap.users.user 0).config.password } }
397- { {- else -} }
398- { {- end -} }
399- { {- else -} }
390+ { {- if not .Values.clickhouse.enabled -} }
400391{ { .Values.externalClickhouse.password } }
401- { {- end -} }
392+ { {- end -} }F
402393{ {- end -} }
403394
404395{ {/*
405396Set ClickHouse cluster name
406397*/} }
407398{ {- define " sentry.clickhouse.cluster.name" -} }
408399{ {- if .Values.clickhouse.enabled -} }
409- { { .Release.Name | printf " %s- clickhouse" } }
400+ { { include " clickhouse.headlessServiceName " $.Subcharts.clickhouse } }
410401{ {- else -} }
411402{ { required " A valid .Values.externalClickhouse.clusterName is required" .Values.externalClickhouse.clusterName } }
412403{ {- end -} }
413404{ {- end -} }
414405
415- { {/*
416- Set ClickHouse distributed cluster name
417- */} }
418- { {- define " sentry.clickhouse.distributed.cluster.name" -} }
419- { {- if .Values.clickhouse.enabled -} }
420- { { .Release.Name | printf " %s-clickhouse" } }
421- { {- else -} }
422- { { default .Values.externalClickhouse.clusterName .Values.externalClickhouse.distributedClusterName } }
423- { {- end -} }
424- { {- end -} }
425-
426406{ {/*
427407Set ClickHouse secure setting
428408*/} }
@@ -667,6 +647,15 @@ Set external Clickhouse password from existingSecret
667647 name: { { .Values.externalClickhouse.existingSecret } }
668648 key: { { default " clickhouse-password" .Values.externalClickhouse.existingSecretKey } }
669649{ {- end } }
650+ { {- if not .Values.externalClickhouse.existingSecret } }
651+ - name: CLICKHOUSE_PASSWORD
652+ valueFrom:
653+ secretKeyRef:
654+ name: { { include " clickhouse.secretName" $.Subcharts.clickhouse | quote } }
655+ key: { { include " clickhouse.secretKey" $.Subcharts.clickhouse | quote } }
656+ { {- end } }
657+ - name: CLICKHOUSE_HOST
658+ value: { { include " sentry.clickhouse.host" . | quote } }
670659- name: CLICKHOUSE_MAX_CONNECTIONS
671660 value: { { .Values.snuba.clickhouse.maxConnections | quote } }
672661{ {- if .Values.ipv6 } }
0 commit comments