-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy path00_default_overrides.xml.tpl
More file actions
169 lines (169 loc) · 6.44 KB
/
Copy path00_default_overrides.xml.tpl
File metadata and controls
169 lines (169 loc) · 6.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
{{- $cluster_name := getEnvByName ( getContainerByName $.podSpec.containers "clickhouse" ) "INIT_CLUSTER_NAME" | default "default" }}
<clickhouse>
<listen_host replace="replace">::</listen_host>
{{- if $.component.tlsConfig }}
<https_port replace="replace" from_env="CLICKHOUSE_HTTPS_PORT"/>
<tcp_port_secure replace="replace" from_env="CLICKHOUSE_TCP_SECURE_PORT"/>
<interserver_https_port replace="replace" from_env="CLICKHOUSE_INTERSERVER_HTTPS_PORT"/>
<http_port remove="remove"/>
<tcp_port remove="remove"/>
<interserver_http_port remove="remove"/>
{{- else }}
<http_port replace="replace" from_env="CLICKHOUSE_HTTP_PORT"/>
<tcp_port replace="replace" from_env="CLICKHOUSE_TCP_PORT"/>
<interserver_http_port replace="replace" from_env="CLICKHOUSE_INTERSERVER_HTTP_PORT"/>
{{- end }}
<!-- Macros, self defined -->
<macros>
<shard from_env="KB_COMP_NAME"/>
<replica from_env="KB_POD_NAME"/>
<layer>{{ $.cluster.metadata.name }}</layer>
</macros>
<default_replica_path>/clickhouse/tables/{layer}/{shard}/{database}/{table}</default_replica_path>
<default_replica_name>{replica}</default_replica_name>
<!-- Log Level -->
<logger>
<level>information</level>
<log>/bitnami/clickhouse/log/clickhouse-server.log</log>
<errorlog>/bitnami/clickhouse/log/clickhouse-server.err.log</errorlog>
<size>1000M</size>
<count>3</count>
</logger>
<!-- Cluster configuration - Any update of the shards and replicas requires helm upgrade -->
<remote_servers>
<{{ $cluster_name }}>
{{- range $key, $value := . }}
{{- if and (hasPrefix "ALL_SHARDS_POD_FQDN_LIST" $key) (ne $value "") }}
<shard>
<internal_replication>true</internal_replication>
{{- range $_, $host := splitList "," $value }}
<replica>
<host>{{ $host }}</host>
{{- if $.component.tlsConfig }}
<port replace="replace" from_env="CLICKHOUSE_TCP_SECURE_PORT"/>
<secure>1</secure>
{{- else }}
<port replace="replace" from_env="CLICKHOUSE_TCP_PORT"/>
{{- end }}
<user from_env="CLICKHOUSE_ADMIN_USER"/>
<password from_env="CLICKHOUSE_ADMIN_PASSWORD"/>
</replica>
{{- end }}
</shard>
{{- end }}
{{- end }}
</{{ $cluster_name }}>
</remote_servers>
{{- if (index . "CH_KEEPER_POD_FQDN_LIST") -}}
<!-- Zookeeper configuration -->
<zookeeper>
{{- range $_, $host := splitList "," .CH_KEEPER_POD_FQDN_LIST }}
<node>
<host>{{ $host }}</host>
{{- if $.component.tlsConfig }}
<port replace="replace" from_env="CLICKHOUSE_KEEPER_TCP_TLS_PORT"/>
<secure>1</secure>
{{- else }}
<port replace="replace" from_env="CLICKHOUSE_KEEPER_TCP_PORT"/>
{{- end }}
</node>
{{- end }}
</zookeeper>
{{- end }}
<!-- Prometheus metrics -->
<prometheus>
<endpoint>/metrics</endpoint>
<port replace="replace" from_env="CLICKHOUSE_METRICS_PORT"/>
<metrics>true</metrics>
<events>true</events>
<asynchronous_metrics>true</asynchronous_metrics>
</prometheus>
{{- if $.component.tlsConfig -}}
{{- $CA_FILE := getCAFile -}}
{{- $CERT_FILE := getCertFile -}}
{{- $KEY_FILE := getKeyFile }}
<!-- tls configuration -->
<protocols>
<prometheus_protocol>
<type>prometheus</type>
<description>prometheus protocol</description>
</prometheus_protocol>
<prometheus_secure>
<type>tls</type>
<impl>prometheus_protocol</impl>
<description>prometheus over https</description>
<certificateFile>{{$CERT_FILE}}</certificateFile>
<privateKeyFile>{{$KEY_FILE}}</privateKeyFile>
</prometheus_secure>
</protocols>
<openSSL>
<server>
<certificateFile>{{$CERT_FILE}}</certificateFile>
<privateKeyFile>{{$KEY_FILE}}</privateKeyFile>
<!--
Use relaxed verification for ClickHouse to skip hostname check, while still supporting TLS encryption.
-->
<verificationMode>relaxed</verificationMode>
<caConfig>{{$CA_FILE}}</caConfig>
<cacheSessions>true</cacheSessions>
<disableProtocols>sslv2,sslv3</disableProtocols>
<preferServerCiphers>true</preferServerCiphers>
</server>
<client>
<loadDefaultCAFile>false</loadDefaultCAFile>
<certificateFile>{{$CERT_FILE}}</certificateFile>
<privateKeyFile>{{$KEY_FILE}}</privateKeyFile>
<caConfig>{{$CA_FILE}}</caConfig>
<cacheSessions>true</cacheSessions>
<disableProtocols>sslv2,sslv3</disableProtocols>
<preferServerCiphers>true</preferServerCiphers>
<verificationMode>strict</verificationMode>
<invalidCertificateHandler>
<name>RejectCertificateHandler</name>
</invalidCertificateHandler>
</client>
</openSSL>
<grpc>
<enable_ssl>1</enable_ssl>
<ssl_cert_file>{{$CERT_FILE}}</ssl_cert_file>
<ssl_key_file>{{$KEY_FILE}}</ssl_key_file>
<ssl_require_client_auth>false</ssl_require_client_auth>
<ssl_ca_cert_file>{{$CA_FILE}}</ssl_ca_cert_file>
<transport_compression_type>none</transport_compression_type>
<transport_compression_level>0</transport_compression_level>
<max_send_message_size>-1</max_send_message_size>
<max_receive_message_size>-1</max_receive_message_size>
<verbose_logs>false</verbose_logs>
</grpc>
{{- end }}
<query_log>
<database>system</database>
<table>query_log</table>
<partition_by>event_date</partition_by>
<order_by>event_time</order_by>
<ttl>event_date + INTERVAL 7 day</ttl>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<max_size_rows>1048576</max_size_rows>
<reserved_size_rows>8192</reserved_size_rows>
<buffer_size_rows_flush_threshold>524288</buffer_size_rows_flush_threshold>
<flush_on_crash>false</flush_on_crash>
</query_log>
<!-- User directories configuration -->
<!-- see https://github.com/ClickHouse/ClickHouse/issues/78830 -->
<user_directories replace="replace">
<users_xml>
<!-- Local static user directory (local path) -->
<path>/bitnami/clickhouse/etc/users.d/default/user.xml</path>
</users_xml>
{{- if (index . "CH_KEEPER_POD_FQDN_LIST") }}
<replicated>
<!-- Keeper-based replicated user directory (keeper path) -->
<zookeeper_path>/clickhouse/access</zookeeper_path>
</replicated>
{{- end }}
<local_directory>
<!-- Local dynamic user directory (local path, for standalone mode) -->
<path>/bitnami/clickhouse/data/access/</path>
</local_directory>
</user_directories>
</clickhouse>