Add connect timeout to ssh-to-node.

This commit is contained in:
Joe Finney
2016-03-07 13:29:04 -08:00
parent 7a43808143
commit e660adbad8
4 changed files with 8 additions and 6 deletions

View File

@@ -1511,10 +1511,12 @@ function ssh-to-node {
fi
for try in $(seq 1 5); do
if ssh -oLogLevel=quiet -oStrictHostKeyChecking=no -i "${AWS_SSH_KEY}" ${SSH_USER}@${ip} "${cmd}"; then
if ssh -oLogLevel=quiet -oConnectTimeout=30 -oStrictHostKeyChecking=no -i "${AWS_SSH_KEY}" ${SSH_USER}@${ip} "echo test > /dev/null"; then
break
fi
sleep 5
done
ssh -oLogLevel=quiet -oConnectTimeout=30 -oStrictHostKeyChecking=no -i "${AWS_SSH_KEY}" ${SSH_USER}@${ip} "${cmd}"
}
# Restart the kube-proxy on a node ($1)