forked from Altinity/clickhouse-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path10-zones-03-advanced-03-pod-per-host-default-storage-class.yaml
90 lines (90 loc) · 2.69 KB
/
10-zones-03-advanced-03-pod-per-host-default-storage-class.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
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
#
# 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-pvc"
spec:
defaults:
templates:
podTemplate: clickhouse-per-host
serviceTemplate: ch-service
configuration:
clusters:
- name: zoned
layout:
shardsCount: 2
templates:
serviceTemplates:
- name: ch-service
generateName: chendpoint-{chi}
metadata:
labels:
custom.label: "custom.value"
annotations:
cloud.google.com/load-balancer-type: "Internal"
service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
service.beta.kubernetes.io/azure-load-balancer-internal: "true"
service.beta.kubernetes.io/openstack-internal-load-balancer: "true"
service.beta.kubernetes.io/cce-load-balancer-internal-vpc: "true"
spec:
ports:
- name: http
port: 8123
- name: tcp
port: 9000
type: LoadBalancer
podTemplates:
# Specify Pod Templates with affinity
- name: clickhouse-per-host
zone:
key: "clickhouse"
values:
- "allow"
podDistribution:
- type: "ShardAntiAffinity"
- type: "ClickHouseInstallationAffinity"
- type: "ClusterAffinity"
spec:
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchLabels:
a: b
matchExpressions:
- key: security
operator: In
values:
- S2
topologyKey: "kubernetes.io/hostname"
containers:
- name: clickhouse-pod
image: clickhouse/clickhouse-server:22.3
volumeMounts:
- name: storage-vc-template
mountPath: /var/lib/clickhouse
volumeClaimTemplates:
- name: storage-vc-template
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi