Last active
January 23, 2024 21:32
-
-
Save WadeBarnes/a7503d6e933347508ff9dce0aa620026 to your computer and use it in GitHub Desktop.
List all Deployments and DeploymentConfigs that have been scaled to zero
This file contains 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
export items=$(oc projects -q); | |
for item in ${items}; do | |
pods=$(oc -n ${item} get dc,deploy 2> /dev/null | awk '$4==0' | awk '{print $1}'); | |
if [ ! -z "${pods}" ]; then | |
echo -e "\n${item}:"; | |
for pod in ${pods}; do | |
echo -e "\t${pod}"; | |
done | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment