mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
Merge pull request #17011 from resouer/patch-9
Auto commit by PR queue bot
This commit is contained in:
commit
724e8a3f3a
@ -88,7 +88,15 @@ detect_lsb() {
|
|||||||
|
|
||||||
# Start the bootstrap daemon
|
# Start the bootstrap daemon
|
||||||
bootstrap_daemon() {
|
bootstrap_daemon() {
|
||||||
sudo -b docker -d -H unix:///var/run/docker-bootstrap.sock -p /var/run/docker-bootstrap.pid --iptables=false --ip-masq=false --bridge=none --graph=/var/lib/docker-bootstrap 2> /var/log/docker-bootstrap.log 1> /dev/null
|
sudo -b docker -d \
|
||||||
|
-H unix:///var/run/docker-bootstrap.sock \
|
||||||
|
-p /var/run/docker-bootstrap.pid \
|
||||||
|
--iptables=false \
|
||||||
|
--ip-masq=false \
|
||||||
|
--bridge=none \
|
||||||
|
--graph=/var/lib/docker-bootstrap \
|
||||||
|
2> /var/log/docker-bootstrap.log \
|
||||||
|
1> /dev/null
|
||||||
|
|
||||||
sleep 5
|
sleep 5
|
||||||
}
|
}
|
||||||
@ -98,19 +106,40 @@ DOCKER_CONF=""
|
|||||||
|
|
||||||
start_k8s(){
|
start_k8s(){
|
||||||
# Start etcd
|
# Start etcd
|
||||||
docker -H unix:///var/run/docker-bootstrap.sock run --restart=always --net=host -d gcr.io/google_containers/etcd:2.2.1 /usr/local/bin/etcd --addr=127.0.0.1:4001 --bind-addr=0.0.0.0:4001 --data-dir=/var/etcd/data
|
docker -H unix:///var/run/docker-bootstrap.sock run \
|
||||||
|
--restart=always \
|
||||||
|
--net=host \
|
||||||
|
-d \
|
||||||
|
gcr.io/google_containers/etcd:2.2.1 \
|
||||||
|
/usr/local/bin/etcd \
|
||||||
|
--addr=127.0.0.1:4001 \
|
||||||
|
--bind-addr=0.0.0.0:4001 \
|
||||||
|
--data-dir=/var/etcd/data
|
||||||
|
|
||||||
sleep 5
|
sleep 5
|
||||||
# Set flannel net config
|
# Set flannel net config
|
||||||
docker -H unix:///var/run/docker-bootstrap.sock run --net=host gcr.io/google_containers/etcd:2.2.1 etcdctl set /coreos.com/network/config '{ "Network": "10.1.0.0/16", "Backend": {"Type": "vxlan"}}'
|
docker -H unix:///var/run/docker-bootstrap.sock run \
|
||||||
|
--net=host gcr.io/google_containers/etcd:2.2.1 \
|
||||||
|
etcdctl \
|
||||||
|
set /coreos.com/network/config \
|
||||||
|
'{ "Network": "10.1.0.0/16", "Backend": {"Type": "vxlan"}}'
|
||||||
|
|
||||||
# iface may change to a private network interface, eth0 is for default
|
# iface may change to a private network interface, eth0 is for default
|
||||||
flannelCID=$(docker -H unix:///var/run/docker-bootstrap.sock run --restart=always -d --net=host --privileged -v /dev/net:/dev/net quay.io/coreos/flannel:0.5.3 /opt/bin/flanneld -iface="eth0")
|
flannelCID=$(docker -H unix:///var/run/docker-bootstrap.sock run \
|
||||||
|
--restart=always \
|
||||||
|
-d \
|
||||||
|
--net=host \
|
||||||
|
--privileged \
|
||||||
|
-v /dev/net:/dev/net \
|
||||||
|
quay.io/coreos/flannel:0.5.3 \
|
||||||
|
/opt/bin/flanneld \
|
||||||
|
-iface="eth0")
|
||||||
|
|
||||||
sleep 8
|
sleep 8
|
||||||
|
|
||||||
# Copy flannel env out and source it on the host
|
# Copy flannel env out and source it on the host
|
||||||
docker -H unix:///var/run/docker-bootstrap.sock cp ${flannelCID}:/run/flannel/subnet.env .
|
docker -H unix:///var/run/docker-bootstrap.sock \
|
||||||
|
cp ${flannelCID}:/run/flannel/subnet.env .
|
||||||
source subnet.env
|
source subnet.env
|
||||||
|
|
||||||
# Configure docker net settings, then restart it
|
# Configure docker net settings, then restart it
|
||||||
|
@ -96,7 +96,17 @@ detect_lsb() {
|
|||||||
|
|
||||||
# Start the bootstrap daemon
|
# Start the bootstrap daemon
|
||||||
bootstrap_daemon() {
|
bootstrap_daemon() {
|
||||||
sudo -b docker -d -H unix:///var/run/docker-bootstrap.sock -p /var/run/docker-bootstrap.pid --iptables=false --ip-masq=false --bridge=none --graph=/var/lib/docker-bootstrap 2> /var/log/docker-bootstrap.log 1> /dev/null
|
sudo -b \
|
||||||
|
docker \
|
||||||
|
-d \
|
||||||
|
-H unix:///var/run/docker-bootstrap.sock \
|
||||||
|
-p /var/run/docker-bootstrap.pid \
|
||||||
|
--iptables=false \
|
||||||
|
--ip-masq=false \
|
||||||
|
--bridge=none \
|
||||||
|
--graph=/var/lib/docker-bootstrap \
|
||||||
|
2> /var/log/docker-bootstrap.log \
|
||||||
|
1> /dev/null
|
||||||
|
|
||||||
sleep 5
|
sleep 5
|
||||||
}
|
}
|
||||||
@ -106,12 +116,24 @@ DOCKER_CONF=""
|
|||||||
# Start k8s components in containers
|
# Start k8s components in containers
|
||||||
start_k8s() {
|
start_k8s() {
|
||||||
# Start flannel
|
# Start flannel
|
||||||
flannelCID=$(sudo docker -H unix:///var/run/docker-bootstrap.sock run -d --restart=always --net=host --privileged -v /dev/net:/dev/net quay.io/coreos/flannel:0.5.3 /opt/bin/flanneld --etcd-endpoints=http://${MASTER_IP}:4001 -iface="eth0")
|
flannelCID=$(sudo \
|
||||||
|
docker \
|
||||||
|
-H unix:///var/run/docker-bootstrap.sock \
|
||||||
|
run \
|
||||||
|
-d \
|
||||||
|
--restart=always \
|
||||||
|
--net=host \
|
||||||
|
--privileged \
|
||||||
|
-v /dev/net:/dev/net \
|
||||||
|
quay.io/coreos/flannel:0.5.3 \
|
||||||
|
/opt/bin/flanneld \
|
||||||
|
--etcd-endpoints=http://${MASTER_IP}:4001 -iface="eth0")
|
||||||
|
|
||||||
sleep 8
|
sleep 8
|
||||||
|
|
||||||
# Copy flannel env out and source it on the host
|
# Copy flannel env out and source it on the host
|
||||||
sudo docker -H unix:///var/run/docker-bootstrap.sock cp ${flannelCID}:/run/flannel/subnet.env .
|
sudo docker -H unix:///var/run/docker-bootstrap.sock \
|
||||||
|
cp ${flannelCID}:/run/flannel/subnet.env .
|
||||||
source subnet.env
|
source subnet.env
|
||||||
|
|
||||||
# Configure docker net settings, then restart it
|
# Configure docker net settings, then restart it
|
||||||
|
Loading…
Reference in New Issue
Block a user