Created
June 5, 2019 09:39
-
-
Save tdshipley/a9fcafe9e8c3899b94328e8894f76afb to your computer and use it in GitHub Desktop.
Script to find a running pod for a job in GCP K8s Engine
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
tryCount=0 | |
runningPod="" | |
while [ "$runningPod" == "" ] && [ $tryCount -lt 12 ] | |
do | |
tryCount=$((tryCount + 1)) | |
echo "Searching for pod... try $tryCount of 12" | |
sleep 5 | |
runningPod="$(kubectl get pods --selector=job-name=$jobName --output=jsonpath={.items..metadata.name})" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment