https://github.com/ueokande/kubectl-evict
A kubectl plugin to evict pods
https://github.com/ueokande/kubectl-evict
kubectl-plugin kubernetes
Last synced: about 1 year ago
JSON representation
A kubectl plugin to evict pods
- Host: GitHub
- URL: https://github.com/ueokande/kubectl-evict
- Owner: ueokande
- License: mit
- Created: 2021-10-23T12:45:14.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-08-03T05:03:31.000Z (almost 2 years ago)
- Last Synced: 2025-05-01T12:14:31.635Z (about 1 year ago)
- Topics: kubectl-plugin, kubernetes
- Language: Go
- Homepage:
- Size: 83 KB
- Stars: 54
- Watchers: 3
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```console
$ go install github.com/ueokande/kubectl-evict@latest
```
## :notebook_with_decorative_cover: Usage
Evict a pod nginx:
```console
$ kubectl evict nginx
```
Evict all pods defined by label app=nginx:
```console
$ kubectl evict -l app=nginx
```
Evict all pods from of a deployment named nginx:
```console
$ kubectl evict deployment/nginx
```
Evict all pods from node worker-1:
```console
$ kubectl evict node/worker-1
```
## :hammer_and_wrench: Developing
Create a cluster:
```console
$ kind create cluster --config .kind/cluster.yaml
```
Then deploy nginx with a Deployment and PodDIsruptionBudget:
```console
$ kubectl apply -f .kind/deployment.yaml -f .kind/pdb.yaml
```
## :memo: LICENSE
[MIT](./LICENSE)