Skip to content
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

Consider failed machine as terminating #125

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cluster-autoscaler/cloudprovider/mcm/mcm_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -868,8 +868,11 @@ func buildGenericLabels(template *nodeTemplate, nodeName string) map[string]stri
}

// isMachineTerminating returns true if machine is already being terminated or considered for termination by autoscaler.
// The machine marked `Failed` are also considered terminating now because eventually they will be terminated. This prevents race b/w MCM
// and CA logic. However, the logs after this log might suggest that machineDeployment was reduced in size and unregistered nodes were removed
// but that is because we don't return error if this race condition happens.
func isMachineTerminating(machine *v1alpha1.Machine) bool {
if !machine.GetDeletionTimestamp().IsZero() {
if !machine.GetDeletionTimestamp().IsZero() || machine.Status.CurrentStatus.Phase == v1alpha1.MachineFailed {
klog.Infof("Machine %q is already being terminated, and hence skipping the deletion", machine.Name)
return true
}
Expand Down