1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-13 21:52:08 +00:00

Change controlplane taint to NoSchedule

This commit is contained in:
galal-hussein
2018-06-22 06:04:07 +02:00
committed by Denise
parent fee4e1d4a8
commit fc48d82392
8 changed files with 12 additions and 8 deletions

View File

@@ -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 {

View File

@@ -222,9 +222,13 @@ func doSyncTaints(k8sClient *kubernetes.Clientset, nodeName string, toAddTaints,
// Remove Taints from node
for i, taintStr := range toDelTaints {
if isTaintExist(toTaint(taintStr), node.Spec.Taints) {
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:]...)
}
}
}
//node.Spec.Taints
_, err = k8sClient.CoreV1().Nodes().Update(node)

View File

@@ -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 {

View File

@@ -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"

View File

@@ -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"

View File

@@ -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

View File

@@ -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

View File

@@ -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"