Testing Rolling Service Updates

  • Run a basic service, then update it while we httping
[node1] ~> docker node ls
ID                            HOSTNAME            STATUS              AVAILABILITY        MANAGER STATUS      ENGINE VERSION
9adri9w9vvdg48t2d1fypkzlf *   node1               Ready               Active              Leader              18.09.1
yvpql7od5rwg6kwpwefh0ne8p     node2               Ready               Active              Reachable           18.09.1
8hv329026zzk0whkr1xuk00sn     node3               Ready               Active                                  18.09.1

[node1] ~> docker network create --driver overlay --attachable verse
qf1o539nt3rrcjrtme2j0eph7

[node1] ~> docker service create --name firefly -p 80:80 --network verse --replicas 5 bretfisher/browncoat:v1
uhgf27hdf4xrys1vrc9obwc4r
overall progress: 5 out of 5 tasks
1/5: running   [==================================================>]
2/5: running   [==================================================>]
3/5: running   [==================================================>]
4/5: running   [==================================================>]
5/5: running   [==================================================>]
verify: Service converged
  • Lets watch it with http (another window)
[node1] ~> docker run --rm --network verse bretfisher/httping -i .1 -GsY firefly/healthz
Unable to find image 'bretfisher/httping:latest' locally
latest: Pulling from bretfisher/httping
2a72cbf407d6: Pull complete
88eb4f68a222: Pull complete
fe038f203e5c: Pull complete
Digest: sha256:a0360726290f08cd9b5d401dfdec203fce5f1cc8b4bf3587c77f85e4b08b65fb
Status: Downloaded newer image for bretfisher/httping:latest
PING firefly:80 (/healthz):
connected to 10.0.0.2:80 (216 bytes), seq=0 time= 11.78 ms 201 Created
connected to 10.0.0.2:80 (216 bytes), seq=1 time= 13.37 ms 201 Created
connected to 10.0.0.2:80 (216 bytes), seq=2 time= 12.98 ms 201 Created
connected to 10.0.0.2:80 (216 bytes), seq=3 time= 12.10 ms 201 Created
~~~ output omitted ~~~
  • Demonstrate live update of services
# IN WINDOW1
[node1] ~> docker service update --image bretfisher/browncoat:v2 firefly
firefly
overall progress: 5 out of 5 tasks
1/5: running   [==================================================>]
2/5: running   [==================================================>]
3/5: running   [==================================================>]
4/5: running   [==================================================>]
5/5: running   [==================================================>]
verify: Service converged

# IN WINDOW2 WE CAN SEE CONNECTIONS CHANGING:
connected to 10.0.0.2:80 (217 bytes), seq=1634 time=  2.01 ms 202 Accepted
connected to 10.0.0.2:80 (216 bytes), seq=1635 time=  2.82 ms 201 Created
connected to 10.0.0.2:80 (217 bytes), seq=1636 time=  2.08 ms 202 Accepted
connected to 10.0.0.2:80 (216 bytes), seq=1637 time=  6.19 ms 201 Created
connected to 10.0.0.2:80 (217 bytes), seq=1638 time=  2.18 ms 202 Accepted
connected to 10.0.0.2:80 (216 bytes), seq=1639 time=  3.97 ms 201 Created
connected to 10.0.0.2:80 (217 bytes), seq=1640 time=  2.02 ms 202 Accepted
connected to 10.0.0.2:80 (216 bytes), seq=1641 time=  4.12 ms 201 Created
connected to 10.0.0.2:80 (217 bytes), seq=1642 time=  3.51 ms 202 Accepted
connected to 10.0.0.2:80 (216 bytes), seq=1643 time=  4.41 ms 201 Created
connected to 10.0.0.2:80 (217 bytes), seq=1644 time=  6.84 ms 202 Accepted
connected to 10.0.0.2:80 (217 bytes), seq=1645 time=  3.24 ms 202 Accepted

# AND EVENTUALLY WILL ALL CHANGE
connected to 10.0.0.2:80 (217 bytes), seq=62 time=  3.80 ms 202 Accepted
connected to 10.0.0.2:80 (217 bytes), seq=63 time=  1.98 ms 202 Accepted
connected to 10.0.0.2:80 (217 bytes), seq=64 time=  3.81 ms 202 Accepted
connected to 10.0.0.2:80 (217 bytes), seq=65 time=  3.39 ms 202 Accepted
connected to 10.0.0.2:80 (217 bytes), seq=66 time=  3.23 ms 202 Accepted
connected to 10.0.0.2:80 (217 bytes), seq=67 time=  5.04 ms 202 Accepted
connected to 10.0.0.2:80 (217 bytes), seq=68 time=  2.11 ms 202 Accepted
  • Now simulate service that is starting longer than it should
# IN WINDOW1
[node1] ~> docker service update --env-add DELAY_STARTUP=5000 firefly
firefly
overall progress: 5 out of 5 tasks
1/5: running   [==================================================>]
2/5: running   [==================================================>]
3/5: running   [==================================================>]
4/5: running   [==================================================>]
5/5: running   [==================================================>]
verify: Service converged

# IN WINDOW2
connected to 10.0.0.2:80 (217 bytes), seq=2091 time=  4.86 ms 202 Accepted
connected to 10.0.0.2:80 (217 bytes), seq=2092 time=  2.73 ms 202 Accepted
connected to 10.0.0.2:80 (217 bytes), seq=2093 time=  4.79 ms 202 Accepted
connected to 10.0.0.2:80 (217 bytes), seq=2094 time=  3.28 ms 202 Accepted
could not connect (Connection refused)
could not connect (Connection refused)
connected to 10.0.0.2:80 (217 bytes), seq=2097 time=  3.09 ms 202 Accepted
connected to 10.0.0.2:80 (217 bytes), seq=2098 time=  3.14 ms 202 Accepted
connected to 10.0.0.2:80 (217 bytes), seq=2099 time=  6.42 ms 202 Accepted
could not connect (Connection refused)
could not connect (Connection refused)
connected to 10.0.0.2:80 (217 bytes), seq=2102 time=  4.72 ms 202 Accepted

results matching ""

    No results matching ""