kubectl-evict
kubectl-evict copied to clipboard
A kubectl plugin to evict pods
kubectl-evict
A kubectl plugin to evict pods. This plugin is good to remove a pod from your cluster or to test your PodDistruptionBudget.
:cd: Installation
$ go install github.com/ueokande/kubectl-evict@latest
:notebook_with_decorative_cover: 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
:hammer_and_wrench: 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
:memo: LICENSE
MIT