-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathstack-canary.yml
62 lines (57 loc) · 1.53 KB
/
stack-canary.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# docker stack deploy -c stack-canary.yml canary --with-registry-auth --prune
version: "3.7"
services:
app1:
image: jakubhajek/app1-node:v1
healthcheck:
test: wget --quiet --tries=1 --spider http://localhost:3000/ || exit 1
interval: 3s
timeout: 1s
retries: 1
start_period: 5s
networks:
- proxy-main
deploy:
mode: replicated
replicas: 2
update_config:
failure_action: rollback
parallelism: 1
delay: 5s
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
resources:
limits:
memory: 128M
labels:
- "traefik.enable=true"
- "traefik.http.routers.app1.rule=Host(`canary.labs.cometari.eu`)"
- "traefik.http.routers.app1.tls.certresolver=le"
- "traefik.http.routers.app1.entrypoints=websecure"
# Canary approach
- "traefik.http.routers.app1.service=canary@file"
- "traefik.http.services.app1_svc.loadbalancer.server.port=3000"
app2:
image: jakubhajek/app1-node:v2
healthcheck:
test: wget --quiet --tries=1 --spider http://localhost:3000/ || exit 1
interval: 3s
timeout: 1s
retries: 1
start_period: 5s
networks:
- proxy-main
deploy:
mode: replicated
replicas: 2
resources:
limits:
memory: 128M
labels:
- "traefik.enable=true"
- "traefik.http.services.app2_svc.loadbalancer.server.port=3000"
networks:
proxy-main:
external: true