diff --git a/cluster/vagrant/provision-master.sh b/cluster/vagrant/provision-master.sh index e938927cf3f..62fa64ea639 100755 --- a/cluster/vagrant/provision-master.sh +++ b/cluster/vagrant/provision-master.sh @@ -54,6 +54,7 @@ for (( i=0; i<${#MINION_NAMES[@]}; i++)); do echo "Adding $minion to hosts file" echo "$ip $minion" >> /etc/hosts fi + echo "127.0.0.1 localhost" >> /etc/hosts # enables cmds like 'kubectl get pods' on master. done # Update salt configuration diff --git a/cluster/vagrant/util.sh b/cluster/vagrant/util.sh index a7c9c48b4de..0fc789b1aba 100644 --- a/cluster/vagrant/util.sh +++ b/cluster/vagrant/util.sh @@ -174,6 +174,12 @@ function verify-cluster { done done + # By this time, all kube api calls should work, so no need to loop and retry. + echo "Validating we can run kubectl commands." + vagrant ssh master --command "kubectl get pods" || { + echo "WARNING: kubectl to localhost failed. This could mean localhost is not bound to an IP" + } + ( echo echo "Kubernetes cluster is running. The master is running at:"