gardener / autoscaler

Customised fork of cluster-autoscaler to support machine-controller-manager
Apache License 2.0
16 stars 25 forks source link

Handle edge case as described in issue #328 #335

Closed rishabh-11 closed 9 hours ago

rishabh-11 commented 1 week ago

What this PR does / why we need it: This PR modifies the Refresh method of CA to reset the priority annotation on the machine objects only if the number of annotated machines is more than desired. The desired count is totalMachines - mcd.Spec.Replicas. Terminating and Failed machines are excluded while calculating the total number of annotated machines.

Which issue(s) this PR fixes: Fixes #328

Special notes for your reviewer:

Release note:

The Refresh method resets the priority annotation on machines with priority 1 to match the desired count. Refer to the PR for details on how the desired count is calculated.