Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Commit

Permalink
Merge pull request #2404 from mwielgus/drain-delete
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue

Cluster-autoscaler: skip pods that are being deleted in node drain

Pods that are still running but are being deleted should not be deleted/moved in CA. 
This also fixes CA against the change in K8S after which the node controller stopped hard-deleting pods (it just sets deletionTimestamp) from unready nodes. With this PR CA will see nodes with all pods under deletion as empty.

cc: @jszczepkowski @gmarek @MaciekPytel
  • Loading branch information
Kubernetes Submit Queue authored Feb 22, 2017
2 parents a51c0f1 + c0b57aa commit 1be8b69
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cluster-autoscaler/utils/drain/drain.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ func GetPodsForDeletionOnNodeDrain(
if IsMirrorPod(pod) {
continue
}
if pod.DeletionTimestamp != nil {
// pod is being deleted - no need to move it.
continue
}

daemonsetPod := false
replicated := false
Expand Down

0 comments on commit 1be8b69

Please sign in to comment.