Search code examples
dockerdocker-swarm

Upgrading swarm mode cluster


Docker changes so fast so I'm trying to find out if a Docker Swarm (swarm mode) cluster can be upgraded. For instance say I am running 1.12 and I have a 3 node cluster running services. Let's also say Docker 1.13 comes out and I want to upgrade the engines that make up the swarm cluster. Is there anyway to do this that doesn't include recreating the cluster would prefer a almost a rolling engines update?

Thank you!


Solution

    1. Drain first node.

      sudo docker node update --availability drain worker2

    2. Verify No containers are on drained node.

      sudo docker ps #on worker2

    3. Upgrade docker engine.
    4. Check node in swarm manager.

      sudo docker node ls

    5. Change availablity to Active.

      sudo docker node update --availability Active

    6. Repeat the steps for other nodes.