tkgi delete-cluster fails due to "Cannot evict pod as it would violate the pod's disruption budget"
search cancel

tkgi delete-cluster fails due to "Cannot evict pod as it would violate the pod's disruption budget"

book

Article ID: 401464

calendar_today

Updated On:

Products

VMware Tanzu Kubernetes Grid Integrated Edition

Issue/Introduction

When deleting a TKGI cluster with `tkgi delete-cluster`, it fails with output 

$ tkgi delete-cluster CLUSTER_NAME

Are you sure you want to delete cluster CLUSTER_NAME? (y/n): y
Error: Error on request to OD Service Broker

At the same point, a BOSH task: drain-cluster errand of the target cluster keeps running until timeout. 

ID    State       Started At                    Finished At  User                            Deployment             Description                                                     Result
1234  processing  Fri Apr 11 09:44:27 UTC 2025  -            pivotal-container-service-####  service-instance_####  run errand drain-cluster from deployment service-instance_####  -

During the drain errand, kubelet on some worker nodes report below error in kubelet/drain.stderr.log

error when evicting pods/"####" -n "####" (will retry after 5s): Cannot evict pod as it would violate the pod's disruption budget

 

Cause

This error occurs when Kubernetes refuses to evict (remove) a Pod because doing so would break the rules defined in a Pod Disruption Budget (PDB). A PodDisruptionBudget (PDB) is used to ensure high availability of your application during voluntary disruptions like:

  • Node drain (e.g. kubectl drain)
  • Manual pod eviction
  • Rolling updates

Resolution

As you are going to delete the entire cluster and all workload has been confirmed not needed any more, you can follow steps:

  1. List up all PDB with `kubectl get pdb -A`.
  2. Delete those PDB with `kubectl delete pdb NAME`.
  3. Retry `tkgi delete-cluster CLUSTER_NAME`.