Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions charts/clickhouse/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,15 @@ Pod Template Base
{{- end }}
resources:
{{- toYaml .Values.clickhouse.resources | nindent 16 }}
{{- with .Values.clickhouse.extraContainers }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.clickhouse.extraContainers}}
{{- with .Values.clickhouse.extraContainers }}
{{- $dataVol := printf "%s-%s-data" $.Release.Name $.Values.nameOverride }}

{{- $y := toYaml . }}
{{- $y | replace "CLICKHOUSE_DATA_VOLUME" $dataVol | nindent 12 }}

{{- end }}
{{- end }}
{{- if or .Values.clickhouse.initScripts.enabled .Values.clickhouse.extraVolumes }}
volumes:
{{- if .Values.clickhouse.initScripts.enabled }}
Expand Down
18 changes: 18 additions & 0 deletions charts/clickhouse/templates/chi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,26 @@ spec:
key: password
{{- else if .password_sha256_hex }}
{{ .name }}/password_sha256_hex: {{ .password_sha256_hex | quote }}
{{ .name }}/profile: {{ .name }}
{{- end }}
{{- end }}
{{- if .Values.clickhouse.users }}
profiles:
{{- range .Values.clickhouse.users }}
{{- if .profile }}
{{- $user := .name }}
{{- range $key, $value := .profile }}
{{ $user }}/{{ $key }}: "{{ $value }}"
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.clickhouse.settings }}
settings:
{{- range $key, $value := .Values.clickhouse.settings }}
{{ $key }}: "{{ $value }}"
{{- end }}
{{- end }}
clusters:
- name: {{ include "clickhouse.clustername" . }}
{{- if .Values.clickhouse.clusterSecret.enabled }}
Expand Down
32 changes: 31 additions & 1 deletion charts/clickhouse/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ clickhouse:
# @default -- 127.0.0.1/32
hostIP: 127.0.0.1/32

# -- Configure additional ClickHouse users.
# -- Configure additional ClickHouse users and their profiles.
users: []
# users:
# - name: app_user
Expand All @@ -35,6 +35,26 @@ clickhouse:
# password_secret_name: "app-user-secret" # secret must contain 'password' key
# grants:
# - "GRANT SELECT ON database.*"
# profile:
# max_memory_usage: "40000000000"
# max_query_size: "2000000"
# readonly: "0"
# allow_ddl: "0"
# connect_timeout_with_failover_ms: "10000"
# Server level settings for each clickhouse replica
settings: []
# settings:
# max_table_size_to_drop: "0"
# max_concurrent_queries: 1000
# logger/level: "error"
# logger/console: "true"
# restore_threads: 48
# prometheus/endpoint: /metrics
# prometheus/port: 9363
# prometheus/metrics: true
# prometheus/events: true
# prometheus/asynchronous_metrics: true
# prometheus/status_info: true

# -- number of replicas. If greater than 1, keeper must be enabled
# or a keeper host should be provided under clickhouse.keeper.host.
Expand Down Expand Up @@ -179,6 +199,16 @@ clickhouse:

# -- Extra containers for clickhouse pods
extraContainers: []
# If you want to make use of clickhouse data volume, which is the case of clickhouse-backup, you can specify the volumeMounts like this.
# The value will be automatically replaced.


# extraContainers:
# - name: clickhouse-backup
# image: altinity/clickhouse-backup:master
# volumeMounts:
# - name: CLICKHOUSE_DATA_VOLUME
# mountPath: /var/lib/clickhouse

# -- Extra volumes for clickhouse pods
extraVolumes: []
Expand Down