mirror of
https://github.com/rancher/rke.git
synced 2025-09-13 13:40:22 +00:00
Change controlplane taint to NoSchedule
This commit is contained in:
@@ -17,7 +17,7 @@ import (
|
||||
|
||||
const (
|
||||
unschedulableEtcdTaint = "node-role.kubernetes.io/etcd=true:NoExecute"
|
||||
unschedulableControlTaint = "node-role.kubernetes.io/controlplane=true:NoExecute"
|
||||
unschedulableControlTaint = "node-role.kubernetes.io/controlplane=true:NoSchedule"
|
||||
)
|
||||
|
||||
func ReconcileCluster(ctx context.Context, kubeCluster, currentCluster *Cluster, updateOnly bool) error {
|
||||
|
@@ -222,7 +222,11 @@ func doSyncTaints(k8sClient *kubernetes.Clientset, nodeName string, toAddTaints,
|
||||
// Remove Taints from node
|
||||
for i, taintStr := range toDelTaints {
|
||||
if isTaintExist(toTaint(taintStr), node.Spec.Taints) {
|
||||
node.Spec.Taints = append(node.Spec.Taints[:i], node.Spec.Taints[i+1:]...)
|
||||
if len(node.Spec.Taints) == 1 {
|
||||
node.Spec.Taints = []v1.Taint{}
|
||||
} else {
|
||||
node.Spec.Taints = append(node.Spec.Taints[:i], node.Spec.Taints[i+1:]...)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
const (
|
||||
unschedulableEtcdTaint = "node-role.kubernetes.io/etcd=true:NoExecute"
|
||||
unschedulableControlTaint = "node-role.kubernetes.io/controlplane=true:NoExecute"
|
||||
unschedulableControlTaint = "node-role.kubernetes.io/controlplane=true:NoSchedule"
|
||||
)
|
||||
|
||||
func RunWorkerPlane(ctx context.Context, allHosts []*hosts.Host, localConnDialerFactory hosts.DialerFactory, prsMap map[string]v3.PrivateRegistry, workerNodePlanMap map[string]v3.RKEConfigNodePlan, certMap map[string]pki.CertificatePKI, updateWorkersOnly bool, alpineImage string) error {
|
||||
|
@@ -185,7 +185,7 @@ spec:
|
||||
operator: Exists
|
||||
- key: "node-role.kubernetes.io/controlplane"
|
||||
operator: "Exists"
|
||||
effect: "NoExecute"
|
||||
effect: "NoSchedule"
|
||||
- key: "node-role.kubernetes.io/etcd"
|
||||
operator: "Exists"
|
||||
effect: "NoExecute"
|
||||
|
@@ -242,7 +242,7 @@ spec:
|
||||
operator: Exists
|
||||
- key: "node-role.kubernetes.io/controlplane"
|
||||
operator: "Exists"
|
||||
effect: "NoExecute"
|
||||
effect: "NoSchedule"
|
||||
- key: "node-role.kubernetes.io/etcd"
|
||||
operator: "Exists"
|
||||
effect: "NoExecute"
|
||||
|
@@ -150,7 +150,7 @@ spec:
|
||||
tolerations:
|
||||
- key: node-role.kubernetes.io/controlplane
|
||||
operator: Exists
|
||||
effect: NoExecute
|
||||
effect: NoSchedule
|
||||
- key: node-role.kubernetes.io/etcd
|
||||
operator: Exists
|
||||
effect: NoExecute
|
||||
|
@@ -17,7 +17,7 @@ spec:
|
||||
tolerations:
|
||||
- key: node-role.kubernetes.io/controlplane
|
||||
operator: Exists
|
||||
effect: NoExecute
|
||||
effect: NoSchedule
|
||||
- key: node-role.kubernetes.io/etcd
|
||||
operator: Exists
|
||||
effect: NoExecute
|
||||
|
@@ -98,7 +98,7 @@ items:
|
||||
tolerations:
|
||||
- key: "node-role.kubernetes.io/controlplane"
|
||||
operator: "Exists"
|
||||
effect: "NoExecute"
|
||||
effect: "NoSchedule"
|
||||
- key: "node-role.kubernetes.io/etcd"
|
||||
operator: "Exists"
|
||||
effect: "NoExecute"
|
||||
|
Reference in New Issue
Block a user