mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
fix e2e services for vagrant
This commit is contained in:
parent
b61ea1bbf1
commit
a9d8713db4
@ -268,6 +268,10 @@ function find-vagrant-name-by-ip {
|
|||||||
# Find the vagrant machien name based on the host name of the minion
|
# Find the vagrant machien name based on the host name of the minion
|
||||||
function find-vagrant-name-by-minion-name {
|
function find-vagrant-name-by-minion-name {
|
||||||
local ip="$1"
|
local ip="$1"
|
||||||
|
if [[ "$ip" == "${INSTANCE_PREFIX}-master" ]]; then
|
||||||
|
echo "master"
|
||||||
|
return $?
|
||||||
|
fi
|
||||||
local ip_pattern="${INSTANCE_PREFIX}-minion-(.*)"
|
local ip_pattern="${INSTANCE_PREFIX}-minion-(.*)"
|
||||||
|
|
||||||
[[ $ip =~ $ip_pattern ]] || {
|
[[ $ip =~ $ip_pattern ]] || {
|
||||||
@ -291,7 +295,7 @@ function ssh-to-node {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
vagrant ssh "${machine}" -c "${cmd}" | grep -v "Connection to.*closed"
|
vagrant ssh "${machine}" -c "${cmd}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Restart the kube-proxy on a node ($1)
|
# Restart the kube-proxy on a node ($1)
|
||||||
@ -299,6 +303,11 @@ function restart-kube-proxy {
|
|||||||
ssh-to-node "$1" "sudo systemctl restart kube-proxy"
|
ssh-to-node "$1" "sudo systemctl restart kube-proxy"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Restart the apiserver
|
||||||
|
function restart-apiserver {
|
||||||
|
ssh-to-node "${master}" "sudo systemctl restart kube-apiserver"
|
||||||
|
}
|
||||||
|
|
||||||
function setup-monitoring-firewall {
|
function setup-monitoring-firewall {
|
||||||
echo "TODO" 1>&2
|
echo "TODO" 1>&2
|
||||||
}
|
}
|
||||||
|
@ -261,7 +261,7 @@ function verify_from_container() {
|
|||||||
for i in $(seq -s' ' 1 $4); do
|
for i in $(seq -s' ' 1 $4); do
|
||||||
ok=false
|
ok=false
|
||||||
for j in $(seq -s' ' 1 10); do
|
for j in $(seq -s' ' 1 10); do
|
||||||
if wget -q -T 1 -O - http://$2:$3; then
|
if wget -q -T 5 -O - http://$2:$3; then
|
||||||
echo
|
echo
|
||||||
ok=true
|
ok=true
|
||||||
break
|
break
|
||||||
@ -415,7 +415,11 @@ verify_from_container "${svc3_name}" "${svc3_ip}" "${svc3_port}" \
|
|||||||
#
|
#
|
||||||
echo "Test 6: Restart the master, make sure portals come back."
|
echo "Test 6: Restart the master, make sure portals come back."
|
||||||
echo "Restarting the master"
|
echo "Restarting the master"
|
||||||
ssh-to-node "${master}" "sudo /etc/init.d/kube-apiserver restart"
|
if [[ "$KUBERNETES_PROVIDER" == "vagrant" ]]; then
|
||||||
|
restart-apiserver "${master}"
|
||||||
|
else
|
||||||
|
ssh-to-node "${master}" "sudo /etc/init.d/kube-apiserver restart"
|
||||||
|
fi
|
||||||
sleep 5
|
sleep 5
|
||||||
echo "Verifying the portals from the host"
|
echo "Verifying the portals from the host"
|
||||||
wait_for_service_up "${svc3_name}" "${svc3_ip}" "${svc3_port}" \
|
wait_for_service_up "${svc3_name}" "${svc3_ip}" "${svc3_port}" \
|
||||||
|
Loading…
Reference in New Issue
Block a user