mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-10 20:42:26 +00:00
node-controller reconcile node labels on each update
instead of waiting for the periodic loop of the node-controller to go through all the nodes, use the sync logic to reconcile the node labels each time that the node has changed after it has been initialized. This has the benefit that changes by external entities on this labels are quickly reconciled. Change-Id: I45cfc1e3f0b9eefdfdd67267229420d76132ab87
This commit is contained in:
parent
03bd3e25b1
commit
0ab006b8a1
@ -283,11 +283,6 @@ func (cnc *CloudNodeController) UpdateNodeStatus(ctx context.Context) error {
|
||||
}
|
||||
|
||||
cnc.updateNodeAddress(ctx, node, instanceMetadata)
|
||||
|
||||
err = cnc.reconcileNodeLabels(node.Name)
|
||||
if err != nil {
|
||||
klog.Errorf("Error reconciling node labels for node %q, err: %v", node.Name, err)
|
||||
}
|
||||
}
|
||||
|
||||
workqueue.ParallelizeUntil(ctx, int(cnc.workerCount), len(nodes), updateNodeFunc)
|
||||
@ -423,9 +418,8 @@ func (cnc *CloudNodeController) syncNode(ctx context.Context, nodeName string) e
|
||||
|
||||
cloudTaint := getCloudTaint(curNode.Spec.Taints)
|
||||
if cloudTaint == nil {
|
||||
// Node object received from event had the cloud taint but was outdated,
|
||||
// the node has actually already been initialized, so this sync event can be ignored.
|
||||
return nil
|
||||
// Node object was already initialized, only need to reconcile the labels
|
||||
return cnc.reconcileNodeLabels(nodeName)
|
||||
}
|
||||
|
||||
klog.Infof("Initializing node %s with cloud provider", nodeName)
|
||||
|
Loading…
Reference in New Issue
Block a user