Skip to content

Commit

Permalink
add parameters for external clickhouse (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
alekitto authored May 18, 2021
1 parent c120034 commit 6faf90c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
15 changes: 13 additions & 2 deletions sentry/templates/_helper.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,17 @@ Set ClickHouse port
{{- end -}}
{{- end -}}

{{/*
Set ClickHouse HTTP port
*/}}
{{- define "sentry.clickhouse.http_port" -}}
{{- if .Values.clickhouse.enabled -}}
{{- default 8123 .Values.clickhouse.clickhouse.http_port }}
{{- else -}}
{{ required "A valid .Values.externalClickhouse.httpPort is required" .Values.externalClickhouse.httpPort }}
{{- end -}}
{{- end -}}

{{/*
Set ClickHouse Database
*/}}
Expand All @@ -288,7 +299,7 @@ Set ClickHouse User
{{- define "sentry.clickhouse.username" -}}
{{- if .Values.clickhouse.enabled -}}
{{- if .Values.clickhouse.clickhouse.configmap.users.enabled -}}
{{ (index .Values.clickhouse.clickhouse.configmap.users.user 0).name }}
{{ (index .Values.clickhouse.clickhouse.configmap.users.user 0).name }}
{{- else -}}
default
{{- end -}}
Expand All @@ -303,7 +314,7 @@ Set ClickHouse Password
{{- define "sentry.clickhouse.password" -}}
{{- if .Values.clickhouse.enabled -}}
{{- if .Values.clickhouse.clickhouse.configmap.users.enabled -}}
{{ (index .Values.clickhouse.clickhouse.configmap.users.user 0).config.password }}
{{ (index .Values.clickhouse.clickhouse.configmap.users.user 0).config.password }}
{{- else -}}
{{- end -}}
{{- else -}}
Expand Down
1 change: 1 addition & 0 deletions sentry/templates/configmap-snuba.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ data:
# Clickhouse Options
CLUSTERS[0]["host"] = env("CLICKHOUSE_HOST", {{ include "sentry.clickhouse.host" . | quote }})
CLUSTERS[0]["port"] = int({{ include "sentry.clickhouse.port" . }})
CLUSTERS[0]["http_port"] = int({{ include "sentry.clickhouse.http_port" . }})
CLUSTERS[0]["database"] = env("CLICKHOUSE_DATABASE", "default")
CLUSTERS[0]["user"] = env("CLICKHOUSE_USER", "default")
CLUSTERS[0]["password"] = env("CLICKHOUSE_PASSWORD", "")
Expand Down
1 change: 1 addition & 0 deletions sentry/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ externalClickhouse:
##
host: "clickhouse"
tcpPort: 9000
httpPort: 8123
username: default
password: ""
database: default
Expand Down

0 comments on commit 6faf90c

Please sign in to comment.