forked from Altinity/clickhouse-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
10-zones-04-advanced-04-pod-per-host-local-storage.yaml
63 lines (63 loc) · 1.74 KB
/
10-zones-04-advanced-04-pod-per-host-local-storage.yaml
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
#
# AWS-specific labels, applicable in 'nodeAffinity' statements
#
# beta.kubernetes.io/arch=amd64
# beta.kubernetes.io/instance-type=t2.medium
# beta.kubernetes.io/os=linux
#
# failure-domain.beta.kubernetes.io/region=us-east-1
# failure-domain.beta.kubernetes.io/zone=us-east-1a
#
# kubernetes.io/hostname=ip-172-20-37-97.ec2.internal
# kubernetes.io/role=node
# node-role.kubernetes.io/node=
#
# kops.k8s.io/instancegroup=nodes2
#
apiVersion: "clickhouse.altinity.com/v1"
kind: "ClickHouseInstallation"
metadata:
name: "ch-per-host-localstorage"
spec:
defaults:
templates:
podTemplate: clickhouse-per-host-localstorage
serviceTemplate: ch-service
configuration:
clusters:
- name: ch-localstorage
layout:
shardsCount: 2
templates:
serviceTemplates:
- name: ch-service
generateName: chendpoint
spec:
ports:
- name: http
port: 8123
- name: tcp
port: 9000
type: LoadBalancer
podTemplates:
# Specify Pod Templates with affinity
- name: clickhouse-per-host-localstorage
zone:
key: "clickhouse"
values:
- "allow"
podDistribution:
- type: ClickHouseAntiAffinity
spec:
volumes:
# Specify volume as path on local filesystem as a directory which will be created, if need be
- name: local-path
hostPath:
path: /mnt/data/clickhouse-test
type: DirectoryOrCreate
containers:
- name: clickhouse-pod
image: yandex/clickhouse-server:19.3.7
volumeMounts:
- name: local-path
mountPath: /var/lib/clickhouse