Skip to content

Commit dccfc6e

Browse files
author
k8s-merge-robot
committed
Merge pull request kubernetes#13609 from ZJU-SEL/deprecate-multiple-etcd-ubuntu
Auto commit by PR queue bot
2 parents 2e2def3 + a4fc22c commit dccfc6e

File tree

9 files changed

+90
-210
lines changed

9 files changed

+90
-210
lines changed

cluster/ubuntu/build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ if [ ! -f etcd.tar.gz ] ; then
5151
tar xzf etcd.tar.gz
5252
fi
5353
cp $ETCD/etcd $ETCD/etcdctl binaries/master
54-
cp $ETCD/etcd $ETCD/etcdctl binaries/minion
5554

5655
# k8s
5756
echo "Download kubernetes release ..."

cluster/ubuntu/minion/init_conf/etcd.conf

Lines changed: 0 additions & 31 deletions
This file was deleted.

cluster/ubuntu/minion/init_conf/flanneld.conf

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ author "@chenxingyu"
33

44
respawn
55

6-
# start in conjunction with etcd
7-
start on started etcd
8-
stop on stopping etcd
9-
6+
start on (net-device-up
7+
and local-filesystems
8+
and runlevel [2345])
109
pre-start script
1110
FLANNEL=/opt/bin/$UPSTART_JOB
1211
if [ -f /etc/default/$UPSTART_JOB ]; then

cluster/ubuntu/minion/init_conf/kube-proxy.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ author "@jainvipin"
33

44
respawn
55

6-
# start in conjunction with etcd
7-
start on started etcd
8-
stop on stopping etcd
6+
# start in conjunction with flanneld
7+
start on started flanneld
8+
stop on stopping flanneld
99

1010
limit nofile 65536 65536
1111

cluster/ubuntu/minion/init_conf/kubelet.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ author "@jainvipin"
33

44
respawn
55

6-
# start in conjunction with etcd
7-
start on started etcd
8-
stop on stopping etcd
6+
# start in conjunction with flanneld
7+
start on started flanneld
8+
stop on stopping flanneld
99

1010
pre-start script
1111
# see also https://github.com/jainvipin/kubernetes-ubuntu-start

cluster/ubuntu/minion/init_scripts/etcd

Lines changed: 0 additions & 100 deletions
This file was deleted.

cluster/ubuntu/minion/init_scripts/kubelet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ KUBELET=/opt/bin/$BASE
2424
KUBELET_PIDFILE=/var/run/$BASE.pid
2525
KUBELET_LOGFILE=/var/log/$BASE.log
2626
KUBELET_OPTS=""
27-
KUBELET_DESC="Kube-Apiserver"
27+
KUBELET_DESC="Kubelet"
2828

2929
# Get lsb functions
3030
. /lib/lsb/init-functions

cluster/ubuntu/reconfDocker.sh

Lines changed: 40 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,48 @@ if [ "$(id -u)" != "0" ]; then
2121
exit 1
2222
fi
2323

24-
source ~/kube/config-default.sh
25-
26-
attempt=0
27-
while true; do
28-
/opt/bin/etcdctl get /coreos.com/network/config
29-
if [[ "$?" == 0 ]]; then
30-
break
31-
else
32-
# enough timeout??
33-
if (( attempt > 600 )); then
34-
echo "timeout for waiting network config" > ~/kube/err.log
35-
exit 2
24+
25+
function config_etcd {
26+
27+
source ~/kube/config-default.sh
28+
29+
attempt=0
30+
while true; do
31+
/opt/bin/etcdctl get /coreos.com/network/config
32+
if [[ "$?" == 0 ]]; then
33+
break
34+
else
35+
# enough timeout??
36+
if (( attempt > 600 )); then
37+
echo "timeout for waiting network config" > ~/kube/err.log
38+
exit 2
39+
fi
40+
41+
/opt/bin/etcdctl mk /coreos.com/network/config "{\"Network\":\"${FLANNEL_NET}\"}"
42+
attempt=$((attempt+1))
43+
sleep 3
3644
fi
45+
done
46+
}
3747

38-
/opt/bin/etcdctl mk /coreos.com/network/config "{\"Network\":\"${FLANNEL_NET}\"}"
39-
attempt=$((attempt+1))
40-
sleep 3
41-
fi
42-
done
48+
function restart_docker {
49+
#wait some secs for /run/flannel/subnet.env ready
50+
sleep 15
51+
sudo ip link set dev docker0 down
52+
sudo brctl delbr docker0
4353

44-
#wait some secs for /run/flannel/subnet.env ready
45-
sleep 15
46-
sudo ip link set dev docker0 down
47-
sudo brctl delbr docker0
54+
source /run/flannel/subnet.env
4855

49-
source /run/flannel/subnet.env
56+
echo DOCKER_OPTS=\"${DOCKER_OPTS} -H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock \
57+
--bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU}\" > /etc/default/docker
58+
sudo service docker restart
59+
}
5060

51-
echo DOCKER_OPTS=\"${DOCKER_OPTS} -H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock \
52-
--bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU}\" > /etc/default/docker
53-
sudo service docker restart
61+
if [[ $1 == "i" ]]; then
62+
restart_docker
63+
elif [[ $1 == "ai" ]]; then
64+
config_etcd
65+
restart_docker
66+
elif [[ $1 == "a" ]]; then
67+
config_etcd
68+
fi

0 commit comments

Comments
 (0)