Skip to content

Instantly share code, notes, and snippets.

@ahawkins
Created May 5, 2017 10:52
Show Gist options
  • Save ahawkins/033f08ed798c2231865fe8369d59bfc2 to your computer and use it in GitHub Desktop.
Save ahawkins/033f08ed798c2231865fe8369d59bfc2 to your computer and use it in GitHub Desktop.
counter=0
while [ "${counter}" -lt "${timeout}" ]; do
pods="$(kubectl get pods \
-l "release=${release}" \
-o 'custom-columns=NAME:.metadata.name,STATUS:.status.phase,Node:.spec.nodeName' \
-n "${KUBE_NAMESPACE}" \
--context "${KUBE_CONTEXT}" \
| tail -n +2
)"
# This condition seems problematic.
if [ -n "${pods}" ] && echo "${pods}" | grep -qvF 'Running'; then
# Not running yet; delay and retry
else
# Everything OK; return
fi
done
env KUBE_CONTEXT=np.k8s.saltside.io KUBE_NAMESPACE=development script/await-release -r test-efritin -t 60
All test-efritin pods running. Done!
test-efritin-kviberg-efr-admin-service-db Running ip-172-20-34-173.ap-south-1.compute.internal
test-efritin-kviberg-efr-admin-service-thrift-919802698-k675j Pending ip-172-20-50-36.ap-south-1.compute.internal
test-efritin-kviberg-efr-auth-service-db Running ip-172-20-33-16.ap-south-1.compute.internal
test-efritin-kviberg-efr-auth-service-thrift-1214294993-j2pqs Pending ip-172-20-63-172.ap-south-1.compute.internal
test-efritin-kviberg-efr-chat-service-thrift-1635443225-6zkdz Running ip-172-20-37-14.ap-south-1.compute.internal
test-efritin-kviberg-efr-core-service-db Running ip-172-20-63-172.ap-south-1.compute.internal
test-efritin-kviberg-efr-core-service-thrift-434229318-cb1gv Pending ip-172-20-37-14.ap-south-1.compute.internal
test-efritin-kviberg-efr-email-service-db Running ip-172-20-50-36.ap-south-1.compute.internal
test-efritin-kviberg-efr-email-service-thrift-2610895764-2838c Pending ip-172-20-63-172.ap-south-1.compute.internal
test-efritin-kviberg-efr-image-service-db Running ip-172-20-42-7.ap-south-1.compute.internal
test-efritin-kviberg-efr-image-service-thrift-3294622884-bkndc Running ip-172-20-50-36.ap-south-1.compute.internal
test-efritin-kviberg-efr-inventory-service-db Running ip-172-20-37-14.ap-south-1.compute.internal
test-efritin-kviberg-efr-inventory-service-thrift-20910478288gq Pending ip-172-20-37-14.ap-south-1.compute.internal
test-efritin-kviberg-efr-notification-service-thrift-2086963m3t Running ip-172-20-34-173.ap-south-1.compute.internal
test-efritin-kviberg-efr-offer-service-db Running ip-172-20-34-173.ap-south-1.compute.internal
test-efritin-kviberg-efr-offer-service-thrift-3693698501-3rlfj Pending ip-172-20-42-7.ap-south-1.compute.internal
test-efritin-kviberg-efr-payment-service-db Running ip-172-20-33-16.ap-south-1.compute.internal
test-efritin-kviberg-efr-payment-service-thrift-2286136830h1wmg Pending ip-172-20-42-7.ap-south-1.compute.internal
test-efritin-kviberg-efr-review-service-db Running ip-172-20-63-172.ap-south-1.compute.internal
test-efritin-kviberg-efr-review-service-thrift-2603159930-bkzjl Pending ip-172-20-33-16.ap-south-1.compute.internal
test-efritin-kviberg-efr-search-service-db Running ip-172-20-50-36.ap-south-1.compute.internal
test-efritin-kviberg-efr-search-service-thrift-381569775-f6dbg Pending ip-172-20-34-173.ap-south-1.compute.internal
test-efritin-kviberg-efr-sms-service-db Running ip-172-20-42-7.ap-south-1.compute.internal
test-efritin-kviberg-efr-sms-service-thrift-4201968210-2rf1w Pending ip-172-20-37-14.ap-south-1.compute.internal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment