Last active
June 27, 2022 22:09
-
-
Save PyDataBlog/38ff8880ac9d3fe8c0cb1b109bebee88 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
# Function which takes a namespace, and waits until ip is assigned to it. | |
function wait_for_ip() { | |
namespace=$1 | |
echo "Waiting for IP for namespace: $namespace" | |
while [ -z $ip ]; do | |
ip=$(kubectl get ingress -n $namespace -o jsonpath="{.items[*].status.loadBalancer.ingress[*].ip}") | |
[ -z "$ip" ] | |
done | |
echo 'Found Ingress Address IP' | |
url=$(kubectl get ingress -n $namespace -o jsonpath="{.items[*].spec.rules[*].host}") | |
echo 'Visit https://'$url' in your browser' | |
} | |
wait_for_ip $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment