From 9b67949085bbd633ae35892483c1cbbe4986252d Mon Sep 17 00:00:00 2001 From: jayunit100 Date: Tue, 17 Mar 2015 12:28:12 -0400 Subject: [PATCH] Fix vagrant so that ssh commands work OOTB, (squashed) move verify to vagrant/util.sh, remove run_provider_test, cleanup. --- cluster/vagrant/provision-master.sh | 1 + cluster/vagrant/util.sh | 6 ++++++ 2 files changed, 7 insertions(+) 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:"