Skip to content

kubectl plugin to easily restart all pods of a deployment

License

Notifications You must be signed in to change notification settings

mousavian/kubectl-rotate-pods

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

⚠️ Notice:

This was only an experiment with kubectl plugins. kubectl itself has rollout restart subcommand [1] 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

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

# simple
kubectl rotate-pods -d terrible-deployment


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

About

kubectl plugin to easily restart all pods of a deployment

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages