From 8cba8a847f42bb6226c4cc028b1a401b81023543 Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Wed, 20 Feb 2019 11:23:26 +0100 Subject: [PATCH] Timeout node draining in 20 seconds and retry In case the node draining takes too much time or is stacked in a loop (e.g. missing RBAC rules), timeout and allow other machines to be reconciled. --- pkg/actuators/machine/actuator.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/actuators/machine/actuator.go b/pkg/actuators/machine/actuator.go index 7c6cbdb14f..d73d3b2ca1 100644 --- a/pkg/actuators/machine/actuator.go +++ b/pkg/actuators/machine/actuator.go @@ -288,6 +288,9 @@ func (a *Actuator) DeleteMachine(cluster *machinev1.Cluster, machine *machinev1. DeleteLocalData: true, GracePeriodSeconds: -1, Logger: info.New(glog.V(0)), + // If a pod is not evicted in 20 second, retry the eviction next time the + // machine gets reconciled again (to allow other machines to be reconciled) + Timeout: 20 * time.Second, }, ); err != nil { // Machine still tries to terminate after drain failure