From 911af2b65f4b174c8cf84474839d5531bf273f30 Mon Sep 17 00:00:00 2001 From: Kiefer Chang Date: Fri, 18 Mar 2022 11:57:47 +0800 Subject: [PATCH] Fix not able schedule an agent to a draining node When draining a node we taint `kubevirt.io/drain=draining:NoSchedule` to the node. The change allows agent daemon set to be scheduled on draining nodes. Signed-off-by: Kiefer Chang --- pkg/manager/agent.go | 4 ++-- pkg/types/types.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/manager/agent.go b/pkg/manager/agent.go index 1ed26fbc..9aa810b7 100644 --- a/pkg/manager/agent.go +++ b/pkg/manager/agent.go @@ -69,8 +69,8 @@ func (a *AgentDaemonSet) Create(image string, managerURL string) error { NodeSelector: a.sbm.getNodeSelector(), Tolerations: []corev1.Toleration{ { - Key: types.DrainKey, - Value: "scheduling", + Key: types.KubevirtDrainKey, + Operator: corev1.TolerationOpExists, }, { Key: corev1.TaintNodeUnschedulable, diff --git a/pkg/types/types.go b/pkg/types/types.go index 68f91b96..26d69cc1 100644 --- a/pkg/types/types.go +++ b/pkg/types/types.go @@ -15,7 +15,7 @@ const ( // labels SupportBundleLabelKey = "rancher/supportbundle" - DrainKey = "kubevirt.io/drain" + KubevirtDrainKey = "kubevirt.io/drain" SupportBundleManager = "support-bundle-manager" SupportBundleAgent = "support-bundle-agent"