fixing healthcheck rollbacks, adding TAG to deploys, adding missing yml

This commit is contained in:
Bret Fisher
2017-10-09 23:49:27 -04:00
parent 3211c1ba8a
commit 5c102d594f
2 changed files with 44 additions and 8 deletions

View File

@@ -4620,9 +4620,9 @@ class: extra-details
---
name: healthchecks
name: healthcheck
class: healthchecks
class: healthcheck
# Health checks
@@ -4644,7 +4644,7 @@ class: healthchecks
---
class: healthchecks
class: healthcheck
## Defining health checks
@@ -4748,7 +4748,7 @@ class: healthcheck
- Go to the `stacks` directory:
```bash
cd ~/orchestration-workshop/
cd ~/orchestration-workshop/stacks
```
- Deploy the updated stack:
@@ -4777,10 +4777,10 @@ First, let's make an "innocent" change and deploy it.
- Build, ship, and run the new image:
```bash
docker-compose -f dockercoins+healthchecks.yml build
export TAG=v0.3; docker-compose -f dockercoins+healthchecks.yml build
docker-compose -f dockercoins+healthchecks.yml push
docker service update dockercoins_hasher \
--detach=false --image=127.0.0.1:5000/hasher:latest
--detach=false --image=127.0.0.1:5000/hasher:$TAG
```
]
@@ -4802,10 +4802,10 @@ And now, a breaking change that will cause the health check to fail:
- Build, ship, and run the new image:
```bash
docker-compose -f dockercoins+healthchecks.yml build
export TAG=v0.4; docker-compose -f dockercoins+healthchecks.yml build
docker-compose -f dockercoins+healthchecks.yml push
docker service update dockercoins_hasher \
--detach=false --image=127.0.0.1:5000/hasher:latest
--detach=false --image=127.0.0.1:5000/hasher:$TAG
```
]

View File

@@ -0,0 +1,36 @@
version: "3"
services:
rng:
build: dockercoins/rng
image: ${REGISTRY-127.0.0.1:5000}/rng:${TAG-latest}
deploy:
mode: global
hasher:
build: dockercoins/hasher
image: ${REGISTRY-127.0.0.1:5000}/hasher:${TAG-latest}
deploy:
replicas: 7
update_config:
delay: 5s
failure_action: rollback
max_failure_ratio: .5
monitor: 5s
parallelism: 1
webui:
build: dockercoins/webui
image: ${REGISTRY-127.0.0.1:5000}/webui:${TAG-latest}
ports:
- "8000:80"
redis:
image: redis
worker:
build: dockercoins/worker
image: ${REGISTRY-127.0.0.1:5000}/worker:${TAG-latest}
deploy:
replicas: 10