File tree Expand file tree Collapse file tree 2 files changed +43
-39
lines changed Expand file tree Collapse file tree 2 files changed +43
-39
lines changed Original file line number Diff line number Diff line change @@ -17,24 +17,26 @@ metadata:
1717apiVersion: kubevirt.io/v1
1818kind: VirtualMachine
1919spec:
20- affinity:
21- nodeAffinity:
22- requiredDuringSchedulingIgnoredDuringExecution: <1>
23- nodeSelectorTerms:
24- - matchExpressions:
25- - key: example.io/example-key
26- operator: In
27- values:
28- - example-value-1
29- - example-value-2
30- preferredDuringSchedulingIgnoredDuringExecution: <2>
31- - weight: 1
32- preference:
33- matchExpressions:
34- - key: example-node-label-key
35- operator: In
36- values:
37- - example-node-label-value
20+ template:
21+ spec:
22+ affinity:
23+ nodeAffinity:
24+ requiredDuringSchedulingIgnoredDuringExecution: <1>
25+ nodeSelectorTerms:
26+ - matchExpressions:
27+ - key: example.io/example-key
28+ operator: In
29+ values:
30+ - example-value-1
31+ - example-value-2
32+ preferredDuringSchedulingIgnoredDuringExecution: <2>
33+ - weight: 1
34+ preference:
35+ matchExpressions:
36+ - key: example-node-label-key
37+ operator: In
38+ values:
39+ - example-node-label-value
3840# ...
3941----
4042<1> If you use the `requiredDuringSchedulingIgnoredDuringExecution` rule type, the VM is not scheduled if the constraint is not met.
Original file line number Diff line number Diff line change @@ -17,27 +17,29 @@ metadata:
1717apiVersion: kubevirt.io/v1
1818kind: VirtualMachine
1919spec:
20- affinity:
21- podAffinity:
22- requiredDuringSchedulingIgnoredDuringExecution: <1>
23- - labelSelector:
24- matchExpressions:
25- - key: example-key-1
26- operator: In
27- values:
28- - example-value-1
29- topologyKey: kubernetes.io/hostname
30- podAntiAffinity:
31- preferredDuringSchedulingIgnoredDuringExecution: <2>
32- - weight: 100
33- podAffinityTerm:
34- labelSelector:
35- matchExpressions:
36- - key: example-key-2
37- operator: In
38- values:
39- - example-value-2
40- topologyKey: kubernetes.io/hostname
20+ template:
21+ spec:
22+ affinity:
23+ podAffinity:
24+ requiredDuringSchedulingIgnoredDuringExecution: <1>
25+ - labelSelector:
26+ matchExpressions:
27+ - key: example-key-1
28+ operator: In
29+ values:
30+ - example-value-1
31+ topologyKey: kubernetes.io/hostname
32+ podAntiAffinity:
33+ preferredDuringSchedulingIgnoredDuringExecution: <2>
34+ - weight: 100
35+ podAffinityTerm:
36+ labelSelector:
37+ matchExpressions:
38+ - key: example-key-2
39+ operator: In
40+ values:
41+ - example-value-2
42+ topologyKey: kubernetes.io/hostname
4143# ...
4244----
4345<1> If you use the `requiredDuringSchedulingIgnoredDuringExecution` rule type, the VM is not scheduled if the constraint is not met.
You can’t perform that action at this time.
0 commit comments