forked from argocon22Workshop/ArgoCDRollouts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
canary.yaml
124 lines (118 loc) · 2.55 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
## This examples sets up istio mirroring if running locally using docker for destkop you can add
## istio-host-split.com to your /etc/hosts and point it to 127.0.0.1 to view demo.
apiVersion: v1
kind: Service
metadata:
name: istio-host-split-canary
labels:
app: istio-host-split
spec:
ports:
- port: 80
targetPort: http
protocol: TCP
name: http
selector:
app: istio-host-split
---
apiVersion: v1
kind: Service
metadata:
name: istio-host-split-stable
spec:
ports:
- port: 80
targetPort: http
protocol: TCP
name: http
selector:
app: istio-host-split
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: istio-host-split-vsvc
spec:
hosts:
- "*"
gateways:
- istio-host-split-gateway
http:
- name: primary
route:
- destination:
host: istio-host-split-stable
weight: 100
- destination:
host: istio-host-split-canary
weight: 0
---
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: istio-host-split
spec:
replicas: 4
strategy:
canary:
analysis:
templates:
- templateName: success-rate
startingStep: 3 # delay starting analysis run until setWeight: 35%
args:
- name: service-name
value: istio-host-split-canary
canaryService: istio-host-split-canary
stableService: istio-host-split-stable
trafficRouting:
istio:
virtualService:
name: istio-host-split-vsvc
routes:
- primary
steps:
- setWeight: 25
- pause: {}
- setWeight: 35
- pause:
duration: 10s
- setWeight: 50
- pause:
duration: 10s
- setWeight: 75
- pause:
duration: 2m
selector:
matchLabels:
app: istio-host-split
template:
metadata:
labels:
app: istio-host-split
spec:
containers:
- name: istio-host-split
image: ghcr.io/argocon22workshop/rollouts-demo:green
ports:
- name: http
containerPort: 8080
protocol: TCP
resources:
requests:
memory: 16Mi
cpu: 5m
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: istio-host-split-gateway
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"