aws-samples / amazon-k8s-node-drainer

Gracefully drain Kubernetes pods from EKS worker nodes during autoscaling scale-in events.
Other
199 stars 56 forks source link

feature/fix Completed Job pods cause an error #34

Closed hari2192 closed 3 years ago

hari2192 commented 3 years ago

Issue #, if available: https://github.com/aws-samples/amazon-k8s-node-drainer/issues/33

Description of changes:

We should ignore completed and failed pods as part of node draining. Hence, skipping pods with status phase either Failed or Succeeded.

svozza commented 3 years ago

Apologies, I'm only seeing this now! Thank you so much for this PR. Would it be possible to add a test for this. Just copy one of the tests like this:

https://github.com/aws-samples/amazon-k8s-node-drainer/blob/4ff3cb1cb6c9f2b7bd860e41e4c65fd066219c10/tests/drainer/test_k8s_utils.py#L169