Search code examples
dockerdocker-swarm

Swarm mode rolling updates progress


I have a full infrastructure with Docker swarm multiple nodes and horizontal scalability.

I use docker service update to deploy new version of my application without interruption.

I'm now working on a chatbot to deploy my application from Slack, is there a way to follow the progress of the update? I didn't see any events or webhooks to manage that

It is very scary to launch service update without any info / output


Solution

  • In docker 17.05, a new option --detach, -d is introduced to docker service create and update.

    There isn't much documentation yet, as usual. You can check the pull. And there is a slightly out of date demo.

    This is what I got on 17.05.

    $ docker version
    Client:
     Version:      17.05.0-ce
     API version:  1.29
     Go version:   go1.7.5
     Git commit:   89658be
     Built:        Fri May  5 15:36:11 2017
     OS/Arch:      linux/amd64
    
    Server:
     Version:      17.05.0-ce
     API version:  1.29 (minimum version 1.12)
     Go version:   go1.7.5
     Git commit:   89658be
     Built:        Fri May  5 15:36:11 2017
     OS/Arch:      linux/amd64
     Experimental: true
    
    $ docker service create --detach=false --name top --replicas 3 busybox top
    804oco5lhezi2estr04ybbn2h
    overall progress: 3 out of 3 tasks
    1/3: running
    2/3: running
    3/3: running
    verify: Waiting 1 seconds to verify that tasks are stable...
    
    $ docker service update --detach=false --replicas 5 top
    top
    overall progress: 5 out of 5 tasks
    1/5: running
    2/5: running
    3/5: running
    4/5: running
    5/5: running
    verify: Waiting 1 seconds to verify that tasks are stable...