Merge pull request #97376 from SergeyKanzhelev/dockerSubnetOnContainerd

configure docker on containerd nodes so it wouldn't reserver 172.17 s…
This commit is contained in:
Kubernetes Prow Robot 2020-12-23 14:34:27 -08:00 committed by GitHub
commit 37352fb58e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1453,6 +1453,14 @@ function create-master-etcd-apiserver-auth {
fi
}
function docker-installed {
if systemctl cat docker.service &> /dev/null ; then
return 0
else
return 1
fi
}
function assemble-docker-flags {
echo "Assemble docker command line flags"
local docker_opts="-p /var/run/docker.pid --iptables=false --ip-masq=false"
@ -3077,8 +3085,13 @@ function main() {
if [[ "${container_runtime}" == "docker" ]]; then
assemble-docker-flags
elif [[ "${container_runtime}" == "containerd" ]]; then
# stop docker if it is present as we want to use just containerd
systemctl stop docker || echo "unable to stop docker"
if docker-installed; then
# We still need to configure docker so it wouldn't reserver the 172.17.0/16 subnet
# And if somebody will start docker to build or pull something, logging will also be set up
assemble-docker-flags
# stop docker if it is present as we want to use just containerd
systemctl stop docker || echo "unable to stop docker"
fi
setup-containerd
fi