mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
Merge pull request #14540 from ZJU-SEL/add-support-docker-centos
add support for CentOS via multi-docker
This commit is contained in:
commit
b5bf821006
@ -107,26 +107,24 @@ start_k8s(){
|
||||
|
||||
# Configure docker net settings, then restart it
|
||||
case "$lsb_dist" in
|
||||
fedora|centos|amzn)
|
||||
amzn)
|
||||
DOCKER_CONF="/etc/sysconfig/docker"
|
||||
echo "OPTIONS=\"\$OPTIONS --mtu=${FLANNEL_MTU} --bip=${FLANNEL_SUBNET}\"" | sudo tee -a ${DOCKER_CONF}
|
||||
ifconfig docker0 down
|
||||
yum -y -q install bridge-utils && brctl delbr docker0 && service docker restart
|
||||
;;
|
||||
ubuntu|debian|linuxmint)
|
||||
centos)
|
||||
DOCKER_CONF="/etc/sysconfig/docker"
|
||||
echo "OPTIONS=\"\$OPTIONS --mtu=${FLANNEL_MTU} --bip=${FLANNEL_SUBNET}\"" | sudo tee -a ${DOCKER_CONF}
|
||||
if ! command_exists ifconfig; then
|
||||
yum -y -q install net-tools
|
||||
fi
|
||||
ifconfig docker0 down
|
||||
yum -y -q install bridge-utils && brctl delbr docker0 && systemctl restart docker
|
||||
ubuntu|debian)
|
||||
DOCKER_CONF="/etc/default/docker"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Append the docker opts
|
||||
echo "DOCKER_OPTS=\"\$DOCKER_OPTS --mtu=${FLANNEL_MTU} --bip=${FLANNEL_SUBNET}\"" | sudo tee -a ${DOCKER_CONF}
|
||||
|
||||
|
||||
# sleep a little bit
|
||||
ifconfig docker0 down
|
||||
|
||||
case "$lsb_dist" in
|
||||
fedora|centos|amzn)
|
||||
yum install bridge-utils && brctl delbr docker0 && systemctl restart docker
|
||||
;;
|
||||
ubuntu|debian|linuxmint)
|
||||
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
|
||||
;;
|
||||
esac
|
||||
|
@ -109,23 +109,25 @@ start_k8s() {
|
||||
|
||||
# Configure docker net settings, then restart it
|
||||
case "$lsb_dist" in
|
||||
fedora|centos|amzn)
|
||||
centos)
|
||||
DOCKER_CONF="/etc/sysconfig/docker"
|
||||
echo "OPTIONS=\"\$OPTIONS --mtu=${FLANNEL_MTU} --bip=${FLANNEL_SUBNET}\"" | sudo tee -a ${DOCKER_CONF}
|
||||
if ! command_exists ifconfig; then
|
||||
yum -y -q install net-tools
|
||||
fi
|
||||
ifconfig docker0 down
|
||||
yum -y -q install bridge-utils && brctl delbr docker0 && systemctl restart docker
|
||||
;;
|
||||
ubuntu|debian|linuxmint)
|
||||
amzn)
|
||||
DOCKER_CONF="/etc/sysconfig/docker"
|
||||
echo "OPTIONS=\"\$OPTIONS --mtu=${FLANNEL_MTU} --bip=${FLANNEL_SUBNET}\"" | sudo tee -a ${DOCKER_CONF}
|
||||
ifconfig docker0 down
|
||||
yum -y -q install bridge-utils && brctl delbr docker0 && service docker restart
|
||||
;;
|
||||
ubuntu|debian)
|
||||
DOCKER_CONF="/etc/default/docker"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "DOCKER_OPTS=\"\$DOCKER_OPTS --mtu=${FLANNEL_MTU} --bip=${FLANNEL_SUBNET}\"" | sudo tee -a ${DOCKER_CONF}
|
||||
|
||||
ifconfig docker0 down
|
||||
|
||||
case "$lsb_dist" in
|
||||
fedora|centos)
|
||||
yum install bridge-utils && brctl delbr docker0 && systemctl restart docker
|
||||
;;
|
||||
ubuntu|debian|linuxmint)
|
||||
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
|
||||
;;
|
||||
esac
|
||||
|
Loading…
Reference in New Issue
Block a user