Commit a876f221 authored by Minhan Xia's avatar Minhan Xia

keep docker0 with private cidr range

parent 610a978e
...@@ -378,7 +378,10 @@ function assemble-docker-flags { ...@@ -378,7 +378,10 @@ function assemble-docker-flags {
docker_opts+=" --log-level=warn" docker_opts+=" --log-level=warn"
fi fi
local use_net_plugin="true" local use_net_plugin="true"
if [[ "${NETWORK_PROVIDER:-}" != "kubenet" && "${NETWORK_PROVIDER:-}" != "cni" ]]; then if [[ "${NETWORK_PROVIDER:-}" == "kubenet" || "${NETWORK_PROVIDER:-}" == "cni" ]]; then
# set docker0 cidr to private ip address range to avoid conflict with cbr0 cidr range
docker_opts+=" --bip=169.254.123.1/24"
else
use_net_plugin="false" use_net_plugin="false"
docker_opts+=" --bridge=cbr0" docker_opts+=" --bridge=cbr0"
fi fi
...@@ -540,10 +543,8 @@ ExecStart=${kubelet_bin} \$KUBELET_OPTS ...@@ -540,10 +543,8 @@ ExecStart=${kubelet_bin} \$KUBELET_OPTS
WantedBy=multi-user.target WantedBy=multi-user.target
EOF EOF
# Delete docker0 to avoid interference # Flush iptables nat table
iptables -t nat -F || true iptables -t nat -F || true
ip link set docker0 down || true
brctl delbr docker0 || true
systemctl start kubelet.service systemctl start kubelet.service
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment