forked from Altinity/clickhouse-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
10-zones-02-advanced-02-aws-pod-per-host.yaml
58 lines (57 loc) · 1.86 KB
/
10-zones-02-advanced-02-aws-pod-per-host.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
#
# 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: "zones-pod-host"
spec:
defaults:
templates:
podTemplate: clickhouse-per-host-in-zone-us-east-1a
configuration:
clusters:
- name: zoned-cluster
layout:
shardsCount: 3
templates:
podTemplates:
# Specify Pod Templates with affinity
- name: clickhouse-per-host-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"
# Specify Pod anti-affinity to Pods with the same label "/app" on the same "hostname"
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: "clickhouse.altinity.com/app"
operator: In
values:
- "chop"
topologyKey: "kubernetes.io/hostname"
containers:
- name: clickhouse-pod
image: yandex/clickhouse-server:19.3.7