-
Notifications
You must be signed in to change notification settings - Fork 435
/
canary.yaml
75 lines (75 loc) · 1.96 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
69
70
71
72
73
74
75
apiVersion: flagger.app/v1beta1
kind: Canary
metadata:
name: frontend
namespace: prod
spec:
# deployment reference
targetRef:
apiVersion: apps/v1
kind: Deployment
name: frontend
# 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: frontend
service:
# container port
port: 9898
# Istio gateways (optional)
gateways:
- istio-system/public-gateway
# Istio virtual service host names (optional)
hosts:
- "*"
analysis:
# schedule interval (default 60s)
interval: 15s
# max number of failed metric checks before rollback
threshold: 10
# total number of iterations
iterations: 10
# canary match condition
match:
- headers:
user-agent:
regex: ".*Firefox.*"
#regex: "^(?!.*(?:Chrome|Edge)).*Safari"
- headers:
cookie:
regex: "^(.*?;)?(type=insider)(;.*)?$"
# 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://frontend-canary.prod:9898/token | grep token"
- name: load-test
type: rollout
timeout: 15s
url: http://flagger-loadtester.prod/
metadata:
cmd: "hey -z 1m -q 10 -c 2 -H 'Cookie: type=insider' http://istio-gateway.istio-system/"