Skip to content

Commit

Permalink
Timeout node draining in 20 seconds and retry
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ingvagabund committed Feb 20, 2019
1 parent 1b7b6b7 commit 8cba8a8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/actuators/machine/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8cba8a8

Please sign in to comment.