Skip to content

Commit

Permalink
Merge pull request kubernetes#117602 from alexanderConstantinescu/rev…
Browse files Browse the repository at this point in the history
…ise-providerid

[KCCM]:  have providerID trigger re-sync, but not be required for load balancer syncs
  • Loading branch information
k8s-ci-robot authored May 30, 2023
2 parents 7d24586 + d257d5d commit 12d3f5c
Show file tree
Hide file tree
Showing 2 changed files with 225 additions and 139 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -693,8 +693,8 @@ func shouldSyncUpdatedNode(oldNode, newNode *v1.Node) bool {
if respectsPredicates(oldNode, nodeIncludedPredicate) != respectsPredicates(newNode, nodeIncludedPredicate) {
return true
}
// For the same reason as above, also check for changes to the providerID
if respectsPredicates(oldNode, nodeHasProviderIDPredicate) != respectsPredicates(newNode, nodeHasProviderIDPredicate) {
// For the same reason as above, also check for any change to the providerID
if oldNode.Spec.ProviderID != newNode.Spec.ProviderID {
return true
}
if !utilfeature.DefaultFeatureGate.Enabled(features.StableLoadBalancerNodeSet) {
Expand Down Expand Up @@ -958,17 +958,14 @@ var (
nodeIncludedPredicate,
nodeUnTaintedPredicate,
nodeReadyPredicate,
nodeHasProviderIDPredicate,
}
etpLocalNodePredicates []NodeConditionPredicate = []NodeConditionPredicate{
nodeIncludedPredicate,
nodeUnTaintedPredicate,
nodeHasProviderIDPredicate,
}
stableNodeSetPredicates []NodeConditionPredicate = []NodeConditionPredicate{
nodeNotDeletedPredicate,
nodeIncludedPredicate,
nodeHasProviderIDPredicate,
// This is not perfect, but probably good enough. We won't update the
// LBs just because the taint was added (see shouldSyncUpdatedNode) but
// if any other situation causes an LB sync, tainted nodes will be
Expand All @@ -994,10 +991,6 @@ func nodeIncludedPredicate(node *v1.Node) bool {
return !hasExcludeBalancerLabel
}

func nodeHasProviderIDPredicate(node *v1.Node) bool {
return node.Spec.ProviderID != ""
}

// We consider the node for load balancing only when its not tainted for deletion by the cluster autoscaler.
func nodeUnTaintedPredicate(node *v1.Node) bool {
for _, taint := range node.Spec.Taints {
Expand Down
Loading

0 comments on commit 12d3f5c

Please sign in to comment.