Add vagrant support

This commit is contained in:
Tim Hockin
2014-10-12 20:08:46 -07:00
parent 99bca68c7d
commit 5c4bd55273
4 changed files with 24 additions and 0 deletions

View File

@@ -143,3 +143,16 @@ function get-password {
export KUBE_PASSWORD=vagrant
echo "Using credentials: $KUBE_USER:$KUBE_PASSWORD"
}
# SSH to a node by name ($1) and run a command ($2).
function ssh-to-node {
local node="$1"
local cmd="$2"
local machine="${VAGRANT_MINION_NAMES_BY_IP[${node}]}"
vagrant ssh "${machine}" -c "${cmd}" | grep -v "Connection to.*closed"
}
# Restart the kube-proxy on a node ($1)
function restart-kube-proxy {
ssh-to-node "$1" "sudo systemctl restart kube-proxy"
}