mirror of
https://github.com/rancher/rke.git
synced 2025-09-14 14:09:49 +00:00
Change controlplane taint to NoSchedule
This commit is contained in:
@@ -17,7 +17,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
unschedulableEtcdTaint = "node-role.kubernetes.io/etcd=true:NoExecute"
|
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 {
|
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
|
// Remove Taints from node
|
||||||
for i, taintStr := range toDelTaints {
|
for i, taintStr := range toDelTaints {
|
||||||
if isTaintExist(toTaint(taintStr), node.Spec.Taints) {
|
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 (
|
const (
|
||||||
unschedulableEtcdTaint = "node-role.kubernetes.io/etcd=true:NoExecute"
|
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 {
|
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
|
operator: Exists
|
||||||
- key: "node-role.kubernetes.io/controlplane"
|
- key: "node-role.kubernetes.io/controlplane"
|
||||||
operator: "Exists"
|
operator: "Exists"
|
||||||
effect: "NoExecute"
|
effect: "NoSchedule"
|
||||||
- key: "node-role.kubernetes.io/etcd"
|
- key: "node-role.kubernetes.io/etcd"
|
||||||
operator: "Exists"
|
operator: "Exists"
|
||||||
effect: "NoExecute"
|
effect: "NoExecute"
|
||||||
|
@@ -242,7 +242,7 @@ spec:
|
|||||||
operator: Exists
|
operator: Exists
|
||||||
- key: "node-role.kubernetes.io/controlplane"
|
- key: "node-role.kubernetes.io/controlplane"
|
||||||
operator: "Exists"
|
operator: "Exists"
|
||||||
effect: "NoExecute"
|
effect: "NoSchedule"
|
||||||
- key: "node-role.kubernetes.io/etcd"
|
- key: "node-role.kubernetes.io/etcd"
|
||||||
operator: "Exists"
|
operator: "Exists"
|
||||||
effect: "NoExecute"
|
effect: "NoExecute"
|
||||||
|
@@ -150,7 +150,7 @@ spec:
|
|||||||
tolerations:
|
tolerations:
|
||||||
- key: node-role.kubernetes.io/controlplane
|
- key: node-role.kubernetes.io/controlplane
|
||||||
operator: Exists
|
operator: Exists
|
||||||
effect: NoExecute
|
effect: NoSchedule
|
||||||
- key: node-role.kubernetes.io/etcd
|
- key: node-role.kubernetes.io/etcd
|
||||||
operator: Exists
|
operator: Exists
|
||||||
effect: NoExecute
|
effect: NoExecute
|
||||||
|
@@ -17,7 +17,7 @@ spec:
|
|||||||
tolerations:
|
tolerations:
|
||||||
- key: node-role.kubernetes.io/controlplane
|
- key: node-role.kubernetes.io/controlplane
|
||||||
operator: Exists
|
operator: Exists
|
||||||
effect: NoExecute
|
effect: NoSchedule
|
||||||
- key: node-role.kubernetes.io/etcd
|
- key: node-role.kubernetes.io/etcd
|
||||||
operator: Exists
|
operator: Exists
|
||||||
effect: NoExecute
|
effect: NoExecute
|
||||||
|
@@ -98,7 +98,7 @@ items:
|
|||||||
tolerations:
|
tolerations:
|
||||||
- key: "node-role.kubernetes.io/controlplane"
|
- key: "node-role.kubernetes.io/controlplane"
|
||||||
operator: "Exists"
|
operator: "Exists"
|
||||||
effect: "NoExecute"
|
effect: "NoSchedule"
|
||||||
- key: "node-role.kubernetes.io/etcd"
|
- key: "node-role.kubernetes.io/etcd"
|
||||||
operator: "Exists"
|
operator: "Exists"
|
||||||
effect: "NoExecute"
|
effect: "NoExecute"
|
||||||
|
Reference in New Issue
Block a user