/kubectl-evict

A kubectl plugin to evict pods

Primary LanguageGoMIT LicenseMIT

kubectl-evict

A kubectl plugin to evict pods. This plugin is good to remove a pod from your cluster or to test your PodDistruptionBudget.

💿 Installation

$ go install github.com/ueokande/kubectl-evict@latest

📔 Usage

Evict a pod nginx:

$ kubectl evict nginx

Evict all pods defined by label app=nginx:

$ kubectl evict -l app=nginx

Evict all pods from of a deployment named nginx:

$ kubectl evict deployment/nginx

Evict all pods from node worker-1:

$ kubectl evict node/worker-1

🛠️ Developing

Create a cluster:

$ kind create cluster --config .kind/cluster.yaml

Then deploy nginx with a Deployment and PodDIsruptionBudget:

$ kubectl apply -f .kind/deployment.yaml -f .kind/pdb.yaml

📝 LICENSE

MIT