-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve delete node mechanisms for cluster-api autoscaler provider #3034
Conversation
/area provider/cluster-api |
cluster-autoscaler/cloudprovider/clusterapi/clusterapi_scalableresource.go
Show resolved
Hide resolved
This change adds a function to remove the annotations associated with marking a node for deletion. It also adds logic to unmark a node in the event that an error is returned after the node has been annotated but before it has been removed. In the case where a node cannot be removed (eg due to minimum size), the node is unmarked before we return from the error condition.
This change removes a few nil checks against resources returned in the Mark and Unmark deletion functions of the cluster-autoscaler CAPI provider. These checks look to see if the returned value for a resource are nil, but the function will not return nil if it returns an error[0]. We only need to check the error return as discussed here[1]. [0] https://github.com/kubernetes/client-go/blob/master/dynamic/simple.go#L234 [1] https://github.com/openshift/kubernetes-autoscaler/pull/141/files#r414480960
thanks @detiber, i had forgotten to re-pick the original commit after i changed it. should be up to date now. |
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: enxebre The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This change is being proposed to improve the mechanism for applying and removing deletion annotations. In some situations it is possible for the CAPI provider to leave unwanted deletion annotations after a scale down to the minimum size. The two commits in this patch add a mechanism for unmarking scalable resources and an additional check for reducing a node group below minimum size.
/area provider/cluster-api