Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait for docker termination when creating network bridges #16368

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions docs/getting-started-guides/docker-multinode/master.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ else
echo "k8s version is set to: ${K8S_VERSION}"
fi


# Run as root
if [ "$(id -u)" != "0" ]; then
echo >&2 "Please run as root"
Expand Down Expand Up @@ -135,7 +134,14 @@ start_k8s(){
DOCKER_CONF="/etc/default/docker"
echo "DOCKER_OPTS=\"\$DOCKER_OPTS --mtu=${FLANNEL_MTU} --bip=${FLANNEL_SUBNET}\"" | sudo tee -a ${DOCKER_CONF}
ifconfig docker0 down
apt-get install bridge-utils && brctl delbr docker0 && service docker restart
apt-get install bridge-utils
brctl delbr docker0
service docker stop
while [ `ps aux | grep /usr/bin/docker | grep -v grep | wc -l` -gt 0 ]; do
echo "Waiting for docker to terminate"
sleep 1
done
service docker start
;;
*)
echo "Unsupported operations system ${lsb_dist}"
Expand Down
11 changes: 8 additions & 3 deletions docs/getting-started-guides/docker-multinode/worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ else
echo "k8s version is set to: ${K8S_VERSION}"
fi



# Run as root
if [ "$(id -u)" != "0" ]; then
echo >&2 "Please run as root"
Expand Down Expand Up @@ -137,7 +135,14 @@ start_k8s() {
DOCKER_CONF="/etc/default/docker"
echo "DOCKER_OPTS=\"\$DOCKER_OPTS --mtu=${FLANNEL_MTU} --bip=${FLANNEL_SUBNET}\"" | sudo tee -a ${DOCKER_CONF}
ifconfig docker0 down
apt-get install bridge-utils && brctl delbr docker0 && service docker restart
apt-get install bridge-utils
brctl delbr docker0
service docker stop
while [ `ps aux | grep /usr/bin/docker | grep -v grep | wc -l` -gt 0 ]; do
echo "Waiting for docker to terminate"
sleep 1
done
service docker start
;;
*)
echo "Unsupported operations system ${lsb_dist}"
Expand Down