-
Notifications
You must be signed in to change notification settings - Fork 438
/
Copy pathcanary.yaml
68 lines (68 loc) · 1.77 KB
/
canary.yaml
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
63
64
65
66
67
68
apiVersion: flagger.app/v1beta1
kind: Canary
metadata:
name: backend
namespace: prod
spec:
# deployment reference
targetRef:
apiVersion: apps/v1
kind: Deployment
name: backend
# the maximum time in seconds for the canary deployment
# to make progress before it is rollback (default 600s)
progressDeadlineSeconds: 120
# HPA reference (optional)
autoscalerRef:
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
name: backend
service:
# container port
port: 9898
# promote the canary without analysing it (default false)
skipAnalysis: false
analysis:
# schedule interval (default 60s)
interval: 15s
# max number of failed metric checks before rollback
threshold: 10
# max traffic percentage routed to canary
# percentage (0-100)
maxWeight: 50
# canary increment step
# percentage (0-100)
stepWeight: 5
# Istio Prometheus checks
metrics:
- name: error-rate
templateRef:
name: error-rate
namespace: istio-system
thresholdRange:
max: 1
interval: 30s
- name: latency
templateRef:
name: latency
namespace: istio-system
thresholdRange:
max: 500
interval: 30s
# tests
webhooks:
- name: conformance-test
type: pre-rollout
timeout: 15s
url: http://flagger-loadtester.prod/
metadata:
type: bash
cmd: "curl -sd 'test' http://backend-canary.prod:9898/token | grep token"
- name: load-test
type: rollout
timeout: 15s
url: http://flagger-loadtester.prod/
metadata:
type: cmd
cmd: "hey -z 1m -q 10 -c 2 http://backend-canary.prod:9898/"
logCmdOutput: "true"