From 9584039c1bf2e01037cd75a4fc50cfa87bcd3c9c Mon Sep 17 00:00:00 2001 From: razo7 Date: Sun, 11 Sep 2022 16:42:34 +0300 Subject: [PATCH] Add control-plane taint and label for Kubernetes v1.24+ --- ...healthcheck-operator.clusterserviceversion.yaml | 14 ++++++++++++-- config/manager/manager.yaml | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/bundle/manifests/node-healthcheck-operator.clusterserviceversion.yaml b/bundle/manifests/node-healthcheck-operator.clusterserviceversion.yaml index 9fe889a1..935f676f 100644 --- a/bundle/manifests/node-healthcheck-operator.clusterserviceversion.yaml +++ b/bundle/manifests/node-healthcheck-operator.clusterserviceversion.yaml @@ -260,6 +260,16 @@ spec: labels: control-plane: controller-manager spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: node-role.kubernetes.io/master + operator: Exists + - matchExpressions: + - key: node-role.kubernetes.io/control-plane + operator: Exists containers: - args: - --secure-listen-address=0.0.0.0:8443 @@ -303,14 +313,14 @@ spec: memory: 20Mi securityContext: allowPrivilegeEscalation: false - nodeSelector: - node-role.kubernetes.io/master: "" priorityClassName: system-cluster-critical serviceAccountName: node-healthcheck-operator-controller-manager terminationGracePeriodSeconds: 10 tolerations: - effect: NoSchedule key: node-role.kubernetes.io/master + - effect: NoSchedule + key: node-role.kubernetes.io/control-plane operator: Exists permissions: - rules: diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index bbca19f9..d144f402 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -22,11 +22,21 @@ spec: labels: control-plane: controller-manager spec: - nodeSelector: - node-role.kubernetes.io/master: "" + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - 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 + - effect: NoSchedule + key: node-role.kubernetes.io/control-plane operator: Exists priorityClassName: system-cluster-critical containers: