mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 18:24:07 +00:00
GCI: Remove /var/lib/docker/network
This avoids running into corrupt network checkpoint issues.
This commit is contained in:
parent
e6c57c6569
commit
47c3b05fa3
@ -409,9 +409,22 @@ function assemble-docker-flags {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "DOCKER_OPTS=\"${docker_opts} ${EXTRA_DOCKER_OPTS:-}\"" > /etc/default/docker
|
echo "DOCKER_OPTS=\"${docker_opts} ${EXTRA_DOCKER_OPTS:-}\"" > /etc/default/docker
|
||||||
# If using a network plugin, we need to explicitly restart docker daemon, because
|
|
||||||
# kubelet will not do it.
|
|
||||||
if [[ "${use_net_plugin}" == "true" ]]; then
|
if [[ "${use_net_plugin}" == "true" ]]; then
|
||||||
|
# If using a network plugin, extend the docker configuration to always remove
|
||||||
|
# the network checkpoint to avoid corrupt checkpoints.
|
||||||
|
# (https://github.com/docker/docker/issues/18283).
|
||||||
|
echo "Extend the default docker.service configuration"
|
||||||
|
mkdir -p /etc/systemd/system/docker.service.d
|
||||||
|
cat <<EOF >/etc/systemd/system/docker.service.d/01network.conf
|
||||||
|
[Service]
|
||||||
|
ExecStartPre=/bin/sh -x -c "rm -rf /var/lib/docker/network"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
systemctl daemon-reload
|
||||||
|
|
||||||
|
# If using a network plugin, we need to explicitly restart docker daemon, because
|
||||||
|
# kubelet will not do it.
|
||||||
echo "Docker command line is updated. Restart docker to pick it up"
|
echo "Docker command line is updated. Restart docker to pick it up"
|
||||||
systemctl restart docker
|
systemctl restart docker
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user