Fix templated nodeinfo names collisions in BinpackingNodeEstimator #4089
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since a couple of months, both upscale's
getUpcomingNodeInfos
and thebinpacking estimator uses the same shared
DeepCopyTemplateNode
functionand inherits its naming pattern, which is great and fixes a long standing bug.
getUpcomingNodeInfos
will now enrich the cluster snapshots withgenerated nodeinfos and nodes having predictable names (using the nodegroup's
template name, and an incremental ordinal starting at 0) for upcoming nodes.
Later, when it looks for fitting nodes for unschedulable pods, the binpacking
estimator will also build virtual nodes and place them in a snapshot fork to
evaluate scheduler predicates.
Those temporary virtual nodes are built using the same pattern (template name
and an index ordinal also starting at 0) as the one previously used by
getUpcomingNodeInfos
, which means it will generate the same nodeinfos/nodesnames for nodegroups having upcoming nodes.
But adding nodes by the same name in an existing cluster snapshot isn't allowed,
and the evaluation attempt will fail. So no nodeInfo from node groups having
upcoming nodes can ever be considered as fitting unschedulable pods.
Practically this blocks re-upscales for nodegroups having upcoming nodes,
which can cause a significant delay (or suboptimal choices among the
possible node groups options). This wasn't the case until recently, as
getUpcomingNodeInfos
and the estimator used different naming schemes.