I have a cluster created in GCP with autoscaling enabled on the cluster. In my case, few pods are getting evicted from node A due to Memory Pressure and are running on new node B. But the evicted pods are not getting removed. Its still visible when I run 'kubectl get pods'. Is this an expected behavior? Do these evicted pods consume any resources or cause any other issue, if not deleted/removed?


That's perfectly normal. Seeing the pods there with the error helps you troubleshoot errors / failures. If they were auto deleted, you'd never know.

If it is not running, it is not consuming resources.

You can do something like the command below to clear them if it bothers you.

kubectl delete pod $(kubectl get pods | grep Error | awk '{print $1}')

In this case replace 'Error' with whatever state you want to clear.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.