forked from Altinity/clickhouse-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
10-zones-02-advanced-01-aws-pods-in-availability-zones.yaml
75 lines (72 loc) · 2.44 KB
/
10-zones-02-advanced-01-aws-pods-in-availability-zones.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
#
# 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: "aws-zones"
spec:
configuration:
clusters:
- name: zoned-cluster
layout:
shards:
- replicas:
- templates:
podTemplate: clickhouse-in-zone-us-east-1a
- templates:
podTemplate: clickhouse-in-zone-us-east-1a
- templates:
podTemplate: clickhouse-in-zone-us-east-1a
- templates:
podTemplate: clickhouse-in-zone-us-east-1b
- templates:
podTemplate: clickhouse-in-zone-us-east-1b
- templates:
podTemplate: clickhouse-in-zone-us-east-1b
templates:
podTemplates:
# Specify Pod Templates with affinity
- name: clickhouse-in-zone-us-east-1a
spec:
affinity:
# Specify Pod affinity to nodes in specified availability zone
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "failure-domain.beta.kubernetes.io/zone"
operator: In
values:
- "us-east-1a"
containers:
- name: clickhouse-pod
image: yandex/clickhouse-server:19.3.7
- name: clickhouse-in-zone-us-east-1b
spec:
affinity:
# Specify Pod affinity to nodes in specified availability zone
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "failure-domain.beta.kubernetes.io/zone"
operator: In
values:
- "us-east-1b"
containers:
- name: clickhouse-pod
image: yandex/clickhouse-server:19.3.7