Last active
April 21, 2022 19:45
-
-
Save dudash/10699ecba6c56e126bd6071f3c187f13 to your computer and use it in GitHub Desktop.
oc-scale0: a Plugin for OpenShift CLI to scale all deployments to 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# A simplifed CLI command to scale all deployments to 0 | |
# | |
# source: https://gist.github.com/dudash/10699ecba6c56e126bd6071f3c187f13/ | |
# docs: https://docs.openshift.com/container-platform/4.7/cli_reference/openshift_cli/extending-cli-plugins.html | |
# | |
# To install/use this: | |
# put this script in /usr/local/bin | |
# chmod a+x oc-scale0 | |
# oc scale0 | |
oc get dc -o name | xargs -t oc scale --replicas=0 | |
oc get deployment -o name | xargs -t oc scale --replicas=0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You use this, just download and move this file to
/usr/local/bin
and make it executable withchmod a+x oc-scale0
.The oc CLI will automatically pick it up, so now you can use it with
oc scale0
You can read about CLI extensions here:
https://docs.openshift.com/container-platform/4.7/cli_reference/openshift_cli/extending-cli-plugins.html