fix: consider only load on available nodes for utilisation#288
Conversation
|
Thank you for your submission! Like many open source projects, we ask that you sign our CLA (Contributor License Agreement) before we can accept your contribution. Already signed the CLA? To re-check, try refreshing the page. |
| })) | ||
| } | ||
| } | ||
| controller, nodeGroupsState := buildController(t, nodes, pods, false) |
There was a problem hiding this comment.
should this be
controller, nodeGroupsState := buildController(t, nodes, pods, true)
instead?
since this mentions "flag enabled - accurate utilisation, no scale up". Cursory glance looks like this would fail since the 50 pods (25 on untainted + 25 on tainted) produce 10000 CPU / 10000 untainted capacity = 100%, which triggers scale-up
the assertion is assert.Equal(t, 0, nodesDelta) so this test would actually fail as written?
There was a problem hiding this comment.
Thanks, will review
There was a problem hiding this comment.
Great catch, something went astray during a refactor!
| // Filter to pods on untainted nodes | ||
| if nodeGroup.Opts.ExcludeUnavailableNodePods { | ||
| untaintedPods := k8s.FilterPodsByNode(pods, untaintedNodes, true) | ||
| log.WithField("nodegroup", nodegroup).Infof("pods total: %v (%v excluded on unavailable nodes)", len(pods), len(pods)-len(untaintedPods)) |
There was a problem hiding this comment.
Kinda same comment as https://github.com/atlassian/escalator/pull/285/changes#r2979812367
Should be at info level? This log will run at every-tick and could be very noisy. Can this be changed to debug level, or only logging when (len(pods) - len(untaintedPods) > 0)
There was a problem hiding this comment.
This is the existing log line that was already at info level, just enriched with the exclusion data (see else) - does that change your thoughts on it?
| metrics.NodeGroupNodesUntainted.WithLabelValues(nodegroup).Set(float64(len(untaintedNodes))) | ||
| metrics.NodeGroupNodesTainted.WithLabelValues(nodegroup).Set(float64(len(taintedNodes))) | ||
| metrics.NodeGroupNodesForceTainted.WithLabelValues(nodegroup).Set(float64(len(forceTaintedNodes))) | ||
| metrics.NodeGroupPods.WithLabelValues(nodegroup).Set(float64(len(pods))) |
There was a problem hiding this comment.
After the feature flag this will emit only untainted node which would be the correct behaviour, however this potentially means we're missing visibility on pods the tainted nodes.
I would suggest that we add a separated metrics for pods on tainted node
There was a problem hiding this comment.
Will do, good thinking
9b22bc7 to
7f253f2
Compare
7f253f2 to
5097d3f
Compare
Important
This PR is an alternative implementation to fix the issue described in #285
What 🎯
Introduces a node group option
exclude_tainted_node_podsthat configures Escalator to ignore resource demand of pods on nodes that are unavailable for scheduling -- nodes that are tainted, force tainted, or cordoned.Unscheduled pods continue to count towards demand calculation.
Why 💭
Escalator currently computes utilisation as follows:
This limiting to
untaintedon the denominator causes utilisation to fluctuate as Escalator taints and untaints nodes.As described in #285
Whereas #285 fixed by expanding the denominator, this PR fixes by filtering the numerator.
The rationale being that we want to measure utilisation from the perspective of the scheduler. The scheduler's view of capacity is of "in service" nodes where it can place pods, so tainted and cordoned nodes are not relevant and neither is the level of demand on those nodes currently.
If a tainted or cordoned node is highly utilised or underutilised, that fact will enter the equation when and if Escalator returns the node to service.
Rovo Dev code review: Rovo Dev couldn't review this pull request
Upgrade to Rovo Dev Standard to continue using code review.