3 NGINX_APP=~/nginx-app.yaml
5 cat <<EOF > "${NGINX_APP}"
22 kind: ReplicationController
39 if ! kubectl get services | grep -q nginx; then
40 kubectl create -f "${NGINX_APP}"
48 while [ $attempts -gt 0 ]
50 if [ 3 == "$(kubectl get pods | grep -c -e STATUS -e Running)" ]; then
56 [ $attempts -gt 0 ] || exit 1
58 svcip=$(kubectl get services nginx -o json | grep clusterIP | cut -f4 -d'"')
61 kubectl delete -f "${NGINX_APP}"