Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mnrgreg/kubectl-node-restart
Krew plugin to restart Kubernetes Nodes sequentially and gracefully
https://github.com/mnrgreg/kubectl-node-restart
cluster kubectl-plugin kubernetes kubernetes-cluster rolling-restart
Last synced: 12 days ago
JSON representation
Krew plugin to restart Kubernetes Nodes sequentially and gracefully
- Host: GitHub
- URL: https://github.com/mnrgreg/kubectl-node-restart
- Owner: MnrGreg
- License: other
- Created: 2020-02-15T05:00:47.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-08T16:53:24.000Z (5 months ago)
- Last Synced: 2024-10-16T09:34:11.612Z (22 days ago)
- Topics: cluster, kubectl-plugin, kubernetes, kubernetes-cluster, rolling-restart
- Language: Shell
- Homepage:
- Size: 46.8 MB
- Stars: 104
- Watchers: 3
- Forks: 11
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kubectl-node-restart
`kubectl-node-restart` is a [kubectl plugin](https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/) that sequentially and gracefully performs a rolling restart of Nodes within a Kubernetes cluster
![using kubectl-node-restart plugin](demo/usage.gif)
# Installing
- install `krew` using instructions [here](https://github.com/kubernetes-sigs/krew#installation)
- run `kubectl krew update`
- run `kubectl krew install node-restart`![installing kubectl-node-restart plugin](demo/installation.gif)
# Usage
- perform rolling restart of all nodes in a cluster
```bash
kubectl node-restart [--context cluster] all
```- restart only specific nodes selected through labels
```bash
kubectl node-restart --selector node-role.kubernetes.io/master
```- execute a command prior to reboot labels
```bash
kubectl node-restart all --command "echo 'hello world'"
```- perform a dry-run
```bash
kubectl node-restart all --dry-run
```- restart node(s) without first draining
```bash
kubectl node-restart all --force
```- add a delay of 120seconds between node restarts
```bash
kubectl node-restart all --sleep 120
```- Pull the Alpine image from a private registry
```bash
kubectl node-restart all --registry myregistry.local/library/alpine:3.9
```