Skip to content

Instantly share code, notes, and snippets.

@WadeBarnes
Last active January 23, 2024 21:32
Show Gist options
  • Save WadeBarnes/a7503d6e933347508ff9dce0aa620026 to your computer and use it in GitHub Desktop.
Save WadeBarnes/a7503d6e933347508ff9dce0aa620026 to your computer and use it in GitHub Desktop.
List all Deployments and DeploymentConfigs that have been scaled to zero
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