1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-14 06:00:53 +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 ( 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 {

View File

@@ -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:]...)
}
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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