Skip to content

Commit

Permalink
Replace nodeSelector with nodeAffinity master role
Browse files Browse the repository at this point in the history
Label node-role.kubernetes.io/master has traditionally no value
associated inherited from kubeadm deplyments but some platforms use
"true" as value. Use node affinity instead of node selector ignoring the
value of the label.
  • Loading branch information
jcaamano committed Mar 16, 2021
1 parent b028592 commit 96ac1ad
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
8 changes: 7 additions & 1 deletion bindata/manifests/operator-webhook/server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ spec:
serviceAccountName: operator-webhook-sa
nodeSelector:
beta.kubernetes.io/os: linux
node-role.kubernetes.io/master:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/master
operator: Exists
tolerations:
- key: "node-role.kubernetes.io/master"
operator: Exists
Expand Down
8 changes: 7 additions & 1 deletion bindata/manifests/webhook/server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ spec:
serviceAccountName: network-resources-injector-sa
nodeSelector:
beta.kubernetes.io/os: linux
node-role.kubernetes.io/master:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/master
operator: Exists
tolerations:
- key: "node-role.kubernetes.io/master"
operator: Exists
Expand Down
9 changes: 7 additions & 2 deletions deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ spec:
labels:
name: sriov-network-operator
spec:
nodeSelector:
node-role.kubernetes.io/master: ""
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/master
operator: Exists
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,13 @@ spec:
name: sriov-network-operator
spec:
serviceAccountName: sriov-network-operator
nodeSelector:
node-role.kubernetes.io/master: ""
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/master
operator: Exists
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
Expand Down

0 comments on commit 96ac1ad

Please sign in to comment.