Skip to content

Commit 22274a5

Browse files
ybettank8s-ci-robot
authored andcommitted
Allow KMM to be installed on worker nodes if there is no better choice.
Some installations of k8s doesn't allow deploying workloads on the control-plane nodes or the control-plane isn't accessible at all. In these installs, the worker nodes do not have the node-role.kubernetes.io/control-plane or node-role.kubernetes.io/master labels. Because the worker nodes do not have these labels the Kernel Module Management operator will not run out of the box. This commit changes the nodeAffinity to preferredDuringSchedulingIgnoredDuringExecution to solve this issue. Signed-off-by: brucejcong Co-authored-by: Yoni Bettan <[email protected]>
1 parent c6522af commit 22274a5

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

config/manager-base/manager.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ spec:
2626
spec:
2727
affinity:
2828
nodeAffinity:
29-
requiredDuringSchedulingIgnoredDuringExecution:
30-
nodeSelectorTerms:
31-
- matchExpressions:
29+
preferredDuringSchedulingIgnoredDuringExecution:
30+
- weight: 1
31+
preference:
32+
matchExpressions:
3233
- key: node-role.kubernetes.io/control-plane
3334
operator: Exists
34-
- matchExpressions:
35+
- weight: 1
36+
preference:
37+
matchExpressions:
3538
- key: node-role.kubernetes.io/master
3639
operator: Exists
37-
- matchExpressions:
38-
- key: kmm.node.kubernetes.io/control-plane
39-
operator: Exists
4040
securityContext:
4141
runAsNonRoot: true
4242
containers:

config/webhook-server/deployment.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ spec:
2020
spec:
2121
affinity:
2222
nodeAffinity:
23-
requiredDuringSchedulingIgnoredDuringExecution:
24-
nodeSelectorTerms:
25-
- matchExpressions:
26-
- key: node-role.kubernetes.io/control-plane
27-
operator: Exists
28-
- matchExpressions:
29-
- key: node-role.kubernetes.io/master
30-
operator: Exists
31-
- matchExpressions:
32-
- key: kmm.node.kubernetes.io/control-plane
33-
operator: Exists
23+
preferredDuringSchedulingIgnoredDuringExecution:
24+
- weight: 1
25+
preference:
26+
matchExpressions:
27+
- key: node-role.kubernetes.io/control-plane
28+
operator: Exists
29+
- weight: 1
30+
preference:
31+
matchExpressions:
32+
- key: node-role.kubernetes.io/master
33+
operator: Exists
3434
securityContext:
3535
runAsNonRoot: true
3636
containers:

0 commit comments

Comments
 (0)