Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

Commit

Permalink
KUBEARTFTS-4: Use ExternalIP if it's available when checking the serv…
Browse files Browse the repository at this point in the history
…ice state
  • Loading branch information
Thanu committed Aug 16, 2016
1 parent 9158bea commit 53cc697
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions common/scripts/base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,12 @@ function getKubeNodes() {

function getKubeNodeIP() {
IFS=$','
node_ips=($(kubectl describe nodes $1 | grep "Addresses:" | awk '{print $2}'))
echo "${node_ips[0]}"
node_ip=$(kubectl get node $1 -o template --template='{{range.status.addresses}}{{if eq .type "ExternalIP"}}{{.address}}{{end}}{{end}}')
if [ -z $node_ip ]; then
echo $(kubectl get node $1 -o template --template='{{range.status.addresses}}{{if eq .type "InternalIP"}}{{.address}}{{end}}{{end}}')
else
echo $node_ip
fi
}

# Deploy using default profile
Expand Down

0 comments on commit 53cc697

Please sign in to comment.