-
Notifications
You must be signed in to change notification settings - Fork 882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Restore running container network settings for containerd integration to support hot upgrade #975
Comments
@coolljt0725 Thanks for working on this. I disagree with some of your design. My main consideration is that libnetwork should persist its states into local/global KV and restore them on restart. It should not depend on docker to replay things back. I've did some work on docker-1.9.1. The following is the work I have done.
|
@chenchun 👍 Good job, thank you. |
go for it! |
@coolljt0725 @calavera Any progress on this? |
For those come to this:
|
Docker engine PR moby/moby#20662 try to integrate containerd for container
supervision, that's awesome. This will make it possible to upgrade the daemon without shutting down all running containers and docker daemon down will not affect the running containers any more, just restart docker daemon will restore all the previous running container. This also need the libnetwork to restore the container network settings(endpoints, sandbox, networks, portmapping). Currently, the daemon starting will clean up the network stuff(networks, endpoints, sandbox), so the ports, ip address, sandboxes of the old running containers are not aware of by the new daemon, the ip and the port still can be allocated to new containers.
I made some progress( see https://github.com/coolljt0725/libnetwork/tree/restore_network )on supporting this. Here is an example(docker binary build form branch https://github.com/coolljt0725/docker/tree/containerd-integration-network which based on PR moby/moby#20662):
and I can access the nginx server from my chrome
2. kill the docker daemon and restart it
$ sudo kill -9 $(cat /var/run/docker.pid)
3. after restart, we can see this container is still running.
we still can access the nginx server from chrome.
start a container and try to pushlish port
80
will failed because daemon know it has been allocate to nginx.start any container, the ip
172.17.0.2
of nginx container will not be allocated again because daemon know it has been allocated.I don't know if this is the right approach to implement this, I'm happy to open a PR to work on this
The text was updated successfully, but these errors were encountered: