Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mousavian/kubectl-rotate-pods

kubectl plugin to easily restart all pods of a deployment
https://github.com/mousavian/kubectl-rotate-pods

kubectl kubectl-plugin kubectl-plugins kubernetes

Last synced: 7 days ago
JSON representation

kubectl plugin to easily restart all pods of a deployment

Awesome Lists containing this project

README

        

### :warning: Notice:
This was only an experiment with kubectl plugins.
kubectl itself has `rollout restart` subcommand [[1](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#-em-restart-em-)] in version >1.15 which can be used as follow:

```
kubectl rollout restart deployment/nginx
```

# kubectl-rotate-pods

Helps you to forcefully restart pods of a deployment in a rolling update manner (depends on your deployment config) for whatever reason you may need. For instance when a ConfigMap or a Secret your pods depend on gets updated or to perform in-memory cache invalidation.

### Installation
```bash
curl -sLo kubectl-rotate_pods https://github.com/mousavian/kubectl-rotate-pods/raw/v1.0.0/src/kubectl-rotate_pods && \
chmod +x kubectl-rotate_pods && mv -i kubectl-rotate_pods /usr/local/bin

# Verify
kubectl rotate-pods --version
```

### Usage
```bash
# simple
kubectl rotate-pods -d terrible-deployment

# advanced
kubectl rotate-pods \
--deployment terrible-deployment \
--namespace backend \
--context ctx-prod \
--reason "for fun"
```