From f42c350f6a927e084bffdaef03f3f891e863b627 Mon Sep 17 00:00:00 2001 From: Adrian Chiris Date: Sun, 22 May 2022 11:39:40 +0300 Subject: [PATCH] Update YAMLs to support k8s (kubeadm) v1.24 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 --- bindata/manifests/operator-webhook/server.yaml | 6 ++++++ bindata/manifests/webhook/server.yaml | 6 ++++++ deploy/operator.yaml | 6 ++++++ .../templates/operator.yaml | 4 ++++ deployment/sriov-network-operator/values.yaml | 18 ++++++++++++++++-- 5 files changed, 38 insertions(+), 2 deletions(-) diff --git a/bindata/manifests/operator-webhook/server.yaml b/bindata/manifests/operator-webhook/server.yaml index 460f85240..721c7357a 100644 --- a/bindata/manifests/operator-webhook/server.yaml +++ b/bindata/manifests/operator-webhook/server.yaml @@ -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 diff --git a/bindata/manifests/webhook/server.yaml b/bindata/manifests/webhook/server.yaml index 2ffb4b6ed..f6076a12f 100644 --- a/bindata/manifests/webhook/server.yaml +++ b/bindata/manifests/webhook/server.yaml @@ -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 diff --git a/deploy/operator.yaml b/deploy/operator.yaml index b92e23c46..c9d686d2b 100644 --- a/deploy/operator.yaml +++ b/deploy/operator.yaml @@ -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: diff --git a/deployment/sriov-network-operator/templates/operator.yaml b/deployment/sriov-network-operator/templates/operator.yaml index e0be0870e..5ea1e6b0d 100644 --- a/deployment/sriov-network-operator/templates/operator.yaml +++ b/deployment/sriov-network-operator/templates/operator.yaml @@ -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 }} diff --git a/deployment/sriov-network-operator/values.yaml b/deployment/sriov-network-operator/values.yaml index 0d5ef5238..95a7823e9 100644 --- a/deployment/sriov-network-operator/values.yaml +++ b/deployment/sriov-network-operator/values.yaml @@ -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"