Skip to content

Commit

Permalink
Update YAMLs to support k8s (kubeadm) v1.24
Browse files Browse the repository at this point in the history
With Kubernetes 1.24, master nodes are now
labeld and tainted as `node-role.kubernetes.io/control-plane`

Support this in sriov network operator by:

- extending tolerations in relevant yaml files
- adjusting node affinity in relevant yaml files
- modify helm chart to deploy operator based on node affinity
  and not node selector

Signed-off-by: Adrian Chiris <[email protected]>
  • Loading branch information
adrianchiris committed May 22, 2022
1 parent b1122b0 commit f42c350
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 2 deletions.
6 changes: 6 additions & 0 deletions bindata/manifests/operator-webhook/server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,16 @@ spec:
- matchExpressions:
- key: node-role.kubernetes.io/master
operator: Exists
- matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
tolerations:
- key: "node-role.kubernetes.io/master"
operator: Exists
effect: NoSchedule
- key: "node-role.kubernetes.io/control-plane"
operator: Exists
effect: NoSchedule
- key: "node.kubernetes.io/not-ready"
operator: Exists
effect: NoSchedule
Expand Down
6 changes: 6 additions & 0 deletions bindata/manifests/webhook/server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,16 @@ spec:
- matchExpressions:
- key: node-role.kubernetes.io/master
operator: Exists
- matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
tolerations:
- key: "node-role.kubernetes.io/master"
operator: Exists
effect: NoSchedule
- key: "node-role.kubernetes.io/control-plane"
operator: Exists
effect: NoSchedule
- key: "node.kubernetes.io/not-ready"
operator: Exists
effect: NoSchedule
Expand Down
6 changes: 6 additions & 0 deletions deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@ spec:
- matchExpressions:
- key: node-role.kubernetes.io/master
operator: Exists
- matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
operator: Exists
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
operator: Exists
serviceAccountName: sriov-network-operator
priorityClassName: "system-node-critical"
containers:
Expand Down
4 changes: 4 additions & 0 deletions deployment/sriov-network-operator/templates/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ spec:
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.operator.affinity }}
affinity:
{{- toYaml . | nindent 8}}
{{- end }}
{{- with .Values.operator.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
Expand Down
18 changes: 16 additions & 2 deletions deployment/sriov-network-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,22 @@ operator:
- key: "node-role.kubernetes.io/master"
operator: "Exists"
effect: "NoSchedule"
nodeSelector:
node-role.kubernetes.io/master: ""
- key: "node-role.kubernetes.io/control-plane"
operator: "Exists"
effect: "NoSchedule"
nodeSelector: {}
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "node-role.kubernetes.io/master"
operator: In
values: [ "" ]
- matchExpressions:
- key: "node-role.kubernetes.io/control-plane"
operator: In
values: [ "" ]
nameOverride: ""
fullnameOverride: ""
resourcePrefix: "openshift.io"
Expand Down

0 comments on commit f42c350

Please sign in to comment.