What this PR does / why we need it:
This PR updates the priority of machines with nodes without ToBeDeletedTaint to 3 before calling DeleteMachines to scale down the corresponding machine deployment.
Which issue(s) this PR fixes:
Fixes #159
Special notes for your reviewer:
This PR does not deal with one case of #159. It is as follows:-
All Nodes in a node group: [N1, N2, N3, N4]
At T1, CA marked [N2, N4] with ToBeDeleted taint, added priority=1, and reduced the machine deployment replicas by 2.
Then CA restarts, which calls cleanUpIfRequired, which removes all the taints and resets the priority of N2 and N4 to 3. By this point, if MCM has not started the deletion process, then it is possible that N2 and N4 are not selected for deletion because MCM selects machines to delete based on priority annotation value.
Following test cases are added for the DeleteNodes method:-
Delete single node happy path.
Delete single placeholder node happy path.
Delete a node with an error in updating machine priority to 1 due to timeout.
Delete a node with updateMcD error timeout.
Delete a node with updateMcD error resolving b4 timeout.
McD is under rolling update.
Machine is already in a terminating state. No scale-down should happen.
Should not scale down the McD beyond the minimum.
Should not delete node if it does not belong to the machine deployment.
Following test cases are added for the Refresh method:-
Reset the priority of a machine having a node without ToBeDeletedTaint to 3.
Don't reset the priority of a machine having a node with ToBeDeletedTaint.
Failure to reset the priority of a machine
The base cluster requirements for IT are updated.The faking (for unit tests of mcm cloud provider implementation) is done for the client only. Listers are not faked
Release note:
A bug where MCM removed a machine other than the one , CA wanted , is resolved.
`machinepriority.machine.sapcloud.io` annotation on machine is now reset to 3 by autoscaler if the corresponding node doesn't have `ToBeDeletedByClusterAutoscaler` taint
Initial implementation for `Refresh()` method of `CloudProvider` interface done
unit tests framework introduced to test implemented methods of `Cloudprovider` and `Nodegroup` interface
What this PR does / why we need it: This PR updates the priority of machines with nodes without
ToBeDeletedTaint
to3
before callingDeleteMachines
to scale down the corresponding machine deployment.Which issue(s) this PR fixes: Fixes #159
Special notes for your reviewer: This PR does not deal with one case of #159. It is as follows:-
cleanUpIfRequired
, which removes all the taints and resets the priority of N2 and N4 to3
. By this point, if MCM has not started the deletion process, then it is possible that N2 and N4 are not selected for deletion because MCM selects machines to delete based on priority annotation value.Following test cases are added for the
DeleteNodes
method:-Following test cases are added for the
Refresh
method:-ToBeDeletedTaint
to3
.ToBeDeletedTaint
.The base cluster requirements for IT are updated. The faking (for unit tests of mcm cloud provider implementation) is done for the client only. Listers are not faked
Release note: