mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-12 12:48:51 +00:00
Add vagrant support
This commit is contained in:
@@ -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"
|
||||
}
|
||||
|
Reference in New Issue
Block a user