-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpod-affinity.yaml
39 lines (39 loc) · 998 Bytes
/
pod-affinity.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
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: pod-affinity
name: pod-affinity
spec:
replicas: 3
selector:
matchLabels:
app: pod-affinity
template:
metadata:
labels:
app: pod-affinity
spec:
affinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- pod-affinity
topologyKey: "failure-domain.beta.kubernetes.io/zone"
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- pod-affinity
topologyKey: "beta.kubernetes.io/instance-type"
weight: 100
containers:
- image: nginx
name: pod-affinity