-
Notifications
You must be signed in to change notification settings - Fork 546
/
podnodeaffinity.yaml
59 lines (59 loc) · 1.24 KB
/
podnodeaffinity.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
apiVersion: v1
kind: Pod
metadata:
name: nodeaffinitypod1
spec:
containers:
- name: nodeaffinity1
image: nginx:latest
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: app
operator: In #In, NotIn, Exists, DoesNotExist
values:
- production
---
apiVersion: v1
kind: Pod
metadata:
name: nodeaffinitypod2
spec:
containers:
- name: nodeaffinity2
image: nginx:latest
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: app
operator: In
values:
- production
- weight: 2
preference:
matchExpressions:
- key: app
operator: In
values:
- test
---
apiVersion: v1
kind: Pod
metadata:
name: nodeaffinitypod3
spec:
containers:
- name: nodeaffinity3
image: nginx:latest
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: app
operator: Exists #In, NotIn, Exists, DoesNotExist