File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,8 @@ import (
5555const (
5656 // WorkerLabel defines the label associated with worker node.
5757 WorkerLabel = "node-role.kubernetes.io/worker"
58+ // ControlPlaneLabel defines the label associated with master/control-plane node.
59+ ControlPlaneLabel = "node-role.kubernetes.io/control-plane"
5860
5961 // maxRetries is the number of times a machineconfig pool will be retried before it is dropped out of the queue.
6062 // With the current rate-limiter in use (5ms*2^(maxRetries-1)) the following numbers represent the times
@@ -321,7 +323,6 @@ func (ctrl *Controller) makeMastersUnSchedulable(currentMasters []*corev1.Node)
321323 }
322324 }
323325 return errs
324-
325326}
326327
327328// makeMasterNodeUnSchedulable makes master node unschedulable by removing worker label and adding `NoSchedule`
@@ -363,6 +364,12 @@ func (ctrl *Controller) makeMasterNodeSchedulable(node *corev1.Node) error {
363364 if _ , hasWorkerLabel := newLabels [WorkerLabel ]; ! hasWorkerLabel {
364365 newLabels [WorkerLabel ] = ""
365366 }
367+ // Legacy clusters do not have the node-role.kubernetes.io/control-plane
368+ // label. When master nodes go schedulable again, let's add the
369+ // control-plane label.
370+ if _ , hasControlPlaneLabel := newLabels [ControlPlaneLabel ]; ! hasControlPlaneLabel {
371+ newLabels [ControlPlaneLabel ] = ""
372+ }
366373 node .Labels = newLabels
367374 // Remove master taint
368375 newTaints := []corev1.Taint {}
You can’t perform that action at this time.
0 commit comments