https://github.com/xyctruth/kubectl-replicas
This CLI stash replicas of deployment, save some resources.
https://github.com/xyctruth/kubectl-replicas
go kubectl-plugin kubectl-plugins
Last synced: 6 months ago
JSON representation
This CLI stash replicas of deployment, save some resources.
- Host: GitHub
- URL: https://github.com/xyctruth/kubectl-replicas
- Owner: xyctruth
- License: mit
- Created: 2022-04-06T08:23:15.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-07T01:43:39.000Z (about 4 years ago)
- Last Synced: 2024-06-20T03:46:22.374Z (about 2 years ago)
- Topics: go, kubectl-plugin, kubectl-plugins
- Language: Go
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kubectl-replicas
This plugin stash replicas of deployment, save some resources.
## Usage
### Stash replicas of deployment
Set the deployment's `Spec.Replicas` to 0, and backup the `Spec.Replicas` to the deployment's Annotations.
```bash
$ kubectl-replicas stash -n test # or (kubectl replicas stash -n test)
"app1" stash replicas succeed
"app2" stash replicas succeed
"app3" stash replicas succeed
```
```
$ kubectl get deployments -n test
NAME READY STATUS RESTARTS AGE
app1 0/1 1 0 141d
app2 0/2 1 0 141d
app3 0/3 1 0 141d
```
### Recover replicas of deployment
Recover deployment's `Spec.Replicas`
```bash
$ kubectl-replicas recover -n test # or (kubectl replicas stash -n test)
"app1" recover replicas 1 succeed
"app2" recover replicas 2 succeed
"app3" recover replicas 3 succeed
```
```bash
$ kubectl get deployments -n test
NAME READY STATUS RESTARTS AGE
app1 1/1 1 0 141d
app2 2/2 1 0 141d
app3 3/3 1 0 141d
```