Skip to content

Commit

Permalink
Merge pull request #254 from akash4sh/main
Browse files Browse the repository at this point in the history
fix: password issue for external clickhouse
  • Loading branch information
akash4sh authored May 20, 2024
2 parents 45ad2f8 + 7933fe0 commit f21fe56
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/signoz/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ sources:
- https://github.com/signoz/alertmanager
- https://github.com/signoz/signoz-otel-collector
type: application
version: 0.0.3
version: 0.0.4
37 changes: 35 additions & 2 deletions charts/signoz/templates/_clickhouse.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
{{/*
Common ClickHouse ENV variables and helpers used by SigNoz
*/}}

{{- define "schemamigrator.url" -}}
{{- if .Values.clickhouse.enabled -}}
{{- printf "%v:%v" ( include "clickhouse.servicename" . ) ( include "clickhouse.tcpPort" . ) -}}
{{- else -}}
{{- printf "%v:%v" ( required "externalClickhouse.host is required if not clickhouse.enabled" .Values.externalClickhouse.host ) ( default 9000 .Values.externalClickhouse.tcpPort ) -}}
{{- end -}}
{{- end -}}

{{- define "snippet.clickhouse-env" }}
{{- if .Values.clickhouse.enabled -}}
- name: CLICKHOUSE_HOST
Expand Down Expand Up @@ -59,14 +68,30 @@ Common ClickHouse ENV variables and helpers used by SigNoz
Minimized ClickHouse ENV variables for user credentials
*/}}
{{- define "snippet.clickhouse-credentials" }}
{{- if .Values.clickhouse.enabled -}}
{{ if .Values.clickhouse.enabled -}}
- name: CLICKHOUSE_HOST
value: {{ include "clickhouse.servicename" . }}
- name: CLICKHOUSE_PORT
value: {{ include "clickhouse.tcpPort" . | quote }}
- name: CLICKHOUSE_HTTP_PORT
value: {{ include "clickhouse.httpPort" . | quote }}
- name: CLICKHOUSE_CLUSTER
value: {{ .Values.clickhouse.cluster | quote }}
- name: CLICKHOUSE_USER
value: {{ .Values.clickhouse.user | quote }}
- name: CLICKHOUSE_PASSWORD
value: {{ .Values.clickhouse.password | quote }}
- name: CLICKHOUSE_SECURE
value: {{ .Values.clickhouse.secure | quote }}
{{- else -}}
- name: CLICKHOUSE_HOST
value: {{ required "externalClickhouse.host is required if not clickhouse.enabled" .Values.externalClickhouse.host | quote }}
- name: CLICKHOUSE_PORT
value: {{ default 9000 .Values.externalClickhouse.tcpPort | quote }}
- name: CLICKHOUSE_HTTP_PORT
value: {{ default 8123 .Values.externalClickhouse.httpPort | quote }}
- name: CLICKHOUSE_CLUSTER
value: {{ required "externalClickhouse.cluster is required if not clickhouse.enabled" .Values.externalClickhouse.cluster | quote }}
- name: CLICKHOUSE_USER
value: {{ .Values.externalClickhouse.user | quote }}
{{- if .Values.externalClickhouse.existingSecret }}
Expand Down Expand Up @@ -145,7 +170,7 @@ Return the ClickHouse secret key
Return the external ClickHouse password
*/}}
{{- define "clickhouse.externalPasswordKey" -}}
{{- if .Values.externalClickhouse.user }}
{{- if .Values.externalClickhouse.password }}
{{- required "externalClickhouse.password is required if using external clickhouse" .Values.externalClickhouse.password -}}
{{- end -}}
{{- end -}}
Expand Down Expand Up @@ -191,3 +216,11 @@ Return the ClickHouse Traces URL
{{- required "externalClickhouse.host is required if using external clickhouse" .Values.externalClickhouse.host }}:{{ include "clickhouse.tcpPort" . }}?database={{ .Values.externalClickhouse.traceDatabase }}&username={{ .Values.externalClickhouse.user }}&password=$(CLICKHOUSE_PASSWORD)
{{- end -}}
{{- end -}}

{{- define "clickhouse.clickHouseUrl" -}}
{{- if .Values.clickhouse.enabled -}}
{{- include "clickhouse.servicename" . }}:{{ include "clickhouse.tcpPort" . }}/?username={{ .Values.clickhouse.user }}&password={{ .Values.clickhouse.password -}}
{{- else -}}
{{- required "externalClickhouse.host is required if using external clickhouse" .Values.externalClickhouse.host }}:{{ include "clickhouse.tcpPort" . }}/?username={{ .Values.externalClickhouse.user }}&password=$(CLICKHOUSE_PASSWORD)
{{- end -}}
{{- end -}}

0 comments on commit f21fe56

Please sign in to comment.