mirror of
https://github.com/rancher/rke.git
synced 2025-09-01 06:56:29 +00:00
Make control node only unschedulable
This commit is contained in:
committed by
Alena Prokharchyk
parent
aabce06714
commit
3c906a9ed2
@@ -11,7 +11,8 @@ import (
|
||||
)
|
||||
|
||||
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"
|
||||
)
|
||||
|
||||
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 {
|
||||
@@ -23,9 +24,16 @@ func RunWorkerPlane(ctx context.Context, allHosts []*hosts.Host, localConnDialer
|
||||
continue
|
||||
}
|
||||
}
|
||||
if !host.IsControl && !host.IsWorker {
|
||||
// Add unschedulable taint
|
||||
host.ToAddTaints = append(host.ToAddTaints, unschedulableEtcdTaint)
|
||||
if !host.IsWorker {
|
||||
if host.IsEtcd {
|
||||
// Add unschedulable taint
|
||||
host.ToAddTaints = append(host.ToAddTaints, unschedulableEtcdTaint)
|
||||
}
|
||||
if host.IsControl {
|
||||
// Add unschedulable taint
|
||||
host.ToAddTaints = append(host.ToAddTaints, unschedulableControlTaint)
|
||||
}
|
||||
|
||||
}
|
||||
runHost := host
|
||||
// maps are not thread safe
|
||||
|
Reference in New Issue
Block a user