Skip to content

Commit 4ccc78a

Browse files
committed
chore(clickhouse): change to use shard0 keeper cluster
1 parent 1ddd319 commit 4ccc78a

15 files changed

Lines changed: 147 additions & 10 deletions

File tree

addons/clickhouse/24/chart/clickhouse/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,4 +475,7 @@ Unless required by applicable law or agreed to in writing, software
475475
distributed under the License is distributed on an "AS IS" BASIS,
476476
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
477477
See the License for the specific language governing permissions and
478-
limitations under the License.
478+
limitations under the License.
479+
480+
481+
https://github.com/ClickHouse/ClickHouse/pull/62366/

addons/clickhouse/24/chart/clickhouse/templates/statefulset.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ spec:
238238
{{- range $j, $r := until $replicas }}
239239
- name: {{ printf "KEEPER_NODE_%d" $j }}
240240
value: {{ printf "%s-shard%d-%d.%s.%s.svc.%s" (include "common.names.fullname" $ ) $i $j (include "clickhouse.headlessServiceName" $) (include "common.names.namespace" $) $.Values.clusterDomain }}
241+
- name: {{ printf "ZOOKEEPER_NODE_%d" $j }}
242+
value: {{ printf "%s-shard%d-%d.%s.%s.svc.%s" (include "common.names.fullname" $ ) 0 $j (include "clickhouse.headlessServiceName" $) (include "common.names.namespace" $) $.Values.clusterDomain }}
241243
{{- end }}
242244
{{- else if $.Values.zookeeper.enabled }}
243245
{{- $replicas := $.Values.zookeeper.replicaCount | int }}

addons/clickhouse/24/chart/clickhouse/values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ defaultConfigurationOverrides: |
284284
{{- if or (ne (int .Values.shards) 1) (ne (int .Values.replicaCount) 1)}}
285285
<!-- Cluster configuration - Any update of the shards and replicas requires helm upgrade -->
286286
<remote_servers>
287-
<default>
287+
<cluster>
288288
{{- $shards := $.Values.shards | int }}
289289
{{- range $shard, $e := until $shards }}
290290
<shard>
@@ -299,7 +299,7 @@ defaultConfigurationOverrides: |
299299
{{- end }}
300300
</shard>
301301
{{- end }}
302-
</default>
302+
</cluster>
303303
</remote_servers>
304304
{{- end }}
305305
{{- if .Values.keeper.enabled }}
@@ -339,7 +339,7 @@ defaultConfigurationOverrides: |
339339
{{- $nodes := .Values.replicaCount | int }}
340340
{{- range $node, $e := until $nodes }}
341341
<node>
342-
<host from_env="{{ printf "KEEPER_NODE_%d" $node }}"></host>
342+
<host from_env="{{ printf "ZOOKEEPER_NODE_%d" $node }}"></host>
343343
<port>{{ $.Values.service.ports.keeper }}</port>
344344
</node>
345345
{{- end }}

addons/clickhouse/24/meta.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,10 @@ allow_parameters:
2121
- name: "service.type"
2222
required: false
2323
description: "service type config for values.yaml"
24+
- name: "shards"
25+
required: false
26+
description: "service type config for values.yaml"
27+
- name: "replicaCount"
28+
required: false
29+
description: "service type config for values.yaml"
2430
archive: false
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
credential:
2+
{{- if (eq .Values.service.type "LoadBalancer") }}
3+
- name: {{ printf "EXTRANET_HOST" }}
4+
valueFrom:
5+
serviceRef:
6+
name: {{ include "common.names.fullname" . }}
7+
jsonpath: '{ .status.loadBalancer.ingress[*].ip }'
8+
{{- end }}
9+
- name: {{ printf "HOST" }}
10+
valueFrom:
11+
serviceRef:
12+
name: {{ include "common.names.fullname" . }}
13+
jsonpath: '{ .spec.clusterIP }'
14+
- name: PASSWORD
15+
valueFrom:
16+
secretKeyRef:
17+
name: {{ template "common.names.fullname" . }}
18+
jsonpath: '{ .data.admin-password }'
19+
- name: USERNAME
20+
value: '{{ .Values.auth.username }}'
21+
- name: TCP_PORT
22+
value: 9000
23+
- name: HTTP_PORT
24+
value: 8123
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"type": "object",
4+
"properties": {
5+
"imagePullPolicy": {
6+
"type": "string",
7+
"enum": ["Always", "IfNotPresent", "Never"],
8+
"default": "IfNotPresent",
9+
"title": "Image pull policy"
10+
}
11+
}
12+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: "standard-16c64g1000"
2+
id: 6447a8c0-ab6c-4afd-8d1b-fe3be3ecfa3f
3+
description: "clickhouse standard-16c64g1000 plan: Disk 1000Gi ,vCPUs 16 , RAM 64G "
4+
displayName: "standard-16c64g1000"
5+
bindable: true
6+
maximum_polling_duration: 1800
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## @param fullnameOverride String to fully override common.names.fullname template
2+
##
3+
fullnameOverride: hb-clickhouse-cluster-standard-16c64g1000
4+
5+
## MinIO&reg; containers' resource requests and limits
6+
## ref: https://kubernetes.io/docs/user-guide/compute-resources/
7+
## We usually recommend not to specify default resources and to leave this as a conscious
8+
## choice for the user. This also increases chances charts run on environments with little
9+
## resources, such as Minikube. If you do want to specify resources, uncomment the following
10+
## lines, adjust them as necessary, and remove the curly braces after 'resources:'.
11+
## @param resources.limits The resources limits for the MinIO&reg; container
12+
## @param resources.requests The requested resources for the MinIO&reg; container
13+
##
14+
resources:
15+
limits:
16+
cpu: 16000m
17+
memory: 64Gi
18+
requests:
19+
cpu: 16000m
20+
memory: 64Gi
21+
22+
persistence:
23+
size: 1000Gi

addons/clickhouse/24/plans/standard-2c4g20/bind.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,3 @@ credential:
2222
value: 9000
2323
- name: HTTP_PORT
2424
value: 8123
25-
- name: MYSQL_PORT
26-
value: 9004

addons/clickhouse/24/plans/standard-4c16g100/bind.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,4 @@ credential:
2121
- name: TCP_PORT
2222
value: 9000
2323
- name: HTTP_PORT
24-
value: 8123
25-
- name: MYSQL_PORT
26-
value: 9004
24+
value: 8123

0 commit comments

Comments
 (0)