Merge pull request #31637 from freehan/docker0fix

Automatic merge from submit-queue

keep docker0 with private cidr range

fixes: #31465

Keep docker0 when using kubenet on GCI. Assign 169.254.123.1/24 to docker0 to avoid cidr conflict.
pull/6/head
Kubernetes Submit Queue 2016-08-30 05:40:33 -07:00 committed by GitHub
commit 1388e664a4
1 changed files with 5 additions and 4 deletions

View File

@ -378,7 +378,10 @@ function assemble-docker-flags {
docker_opts+=" --log-level=warn"
fi
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"
docker_opts+=" --bridge=cbr0"
fi
@ -540,10 +543,8 @@ ExecStart=${kubelet_bin} \$KUBELET_OPTS
WantedBy=multi-user.target
EOF
# Delete docker0 to avoid interference
# Flush iptables nat table
iptables -t nat -F || true
ip link set docker0 down || true
brctl delbr docker0 || true
systemctl start kubelet.service
}