30
30
stableService : rollouts-demo-stable
31
31
trafficRouting :
32
32
istio :
33
- virtualService :
34
- # Reference to a VirtualService which the controller updates with canary weights
35
- name : rollouts-demo-vsvc
33
+ virtualServices :
34
+ # One or more virtualServices can be configured
35
+ # Reference to a VirtualService which the controller updates with canary weights
36
+ - name : rollouts-demo-vsvc1
36
37
# Optional if there is a single HTTP route in the VirtualService, otherwise required
37
38
routes :
38
39
- http-primary
@@ -44,18 +45,34 @@ spec:
44
45
sniHosts :
45
46
- reviews.bookinfo.com
46
47
- localhost
48
+ - name : rollouts-demo-vsvc2
49
+ # Optional if there is a single HTTP route in the VirtualService, otherwise required
50
+ routes :
51
+ - http-secondary
52
+ # Optional if there is a single HTTPS/TLS route in the VirtualService, otherwise required
53
+ tlsRoutes :
54
+ # Below fields are optional but if defined, they should match exactly with at least one of the TLS route match rules in your VirtualService
55
+ - port : 443 # Only required if you want to match any rule in your VirtualService which contains this port
56
+ # Only required if you want to match any rule in your VirtualService which contain all these SNI hosts
57
+ sniHosts :
58
+ - reviews.bookinfo.com
59
+ - localhost
47
60
...
48
61
```
49
62
50
- The VirtualService and route referenced in ` trafficRouting.istio.virtualService ` are required
51
- to have either HTTP or TLS, or both route specs that splits between the stable and the canary
63
+ The VirtualService and route referenced in either ` trafficRouting.istio.virtualService ` or
64
+ ` trafficRouting.istio.virtualServices ` . ` trafficRouting.istio.virtualServices ` helps in adding
65
+ one or more virtualServices unlike ` trafficRouting.istio.virtualService ` where only single virtualService can be added.
66
+ This is required to have either HTTP or TLS, or both route specs that splits between the stable and the canary
52
67
services referenced in the rollout. If the route is HTTPS/TLS, we can match it based on the
53
68
given port number and/or SNI hosts. Note that both of them are optional and only needed if you
54
69
want to match any rule in your VirtualService which contains these.
55
70
56
71
In this guide, the two services are: ` rollouts-demo-stable ` and ` rollouts-demo-canary ` respectively.
57
72
The weights for these two services should initially be set to 100% on the stable service and 0% on
58
73
the canary service. During an update, these values will get modified by the controller.
74
+ If there are multiple VirtualService then weight values for stable and canary service of each VirtualService
75
+ will be modified by the controller simultaneously.
59
76
60
77
Note that since we have both the HTTP and HTTPS routes in our rollout spec and they match the
61
78
VirtualService specs, weights will get modified for both these routes.
@@ -64,25 +81,67 @@ VirtualService specs, weights will get modified for both these routes.
64
81
apiVersion : networking.istio.io/v1alpha3
65
82
kind : VirtualService
66
83
metadata :
67
- name : rollouts-demo-vsvc
84
+ name : rollouts-demo-vsvc1
85
+ spec :
86
+ gateways :
87
+ - rollouts-demo-gateway
88
+ hosts :
89
+ - rollouts-demo-vsvc1.local
90
+ http :
91
+ - name : http-primary # Should match rollout.spec.strategy.canary.trafficRouting.istio.virtualServices.routes
92
+ route :
93
+ - destination :
94
+ host : rollouts-demo-stable # Should match rollout.spec.strategy.canary.stableService
95
+ port :
96
+ number : 15372
97
+ weight : 100
98
+ - destination :
99
+ host : rollouts-demo-canary # Should match rollout.spec.strategy.canary.canaryService
100
+ port :
101
+ number : 15372
102
+ weight : 0
103
+ tls :
104
+ - match :
105
+ - port : 443 # Should match the port number of the route defined in rollout.spec.strategy.canary.trafficRouting.istio.virtualServices.tlsRoutes
106
+ sniHosts : # Should match all the SNI hosts of the route defined in rollout.spec.strategy.canary.trafficRouting.istio.virtualServices.tlsRoutes
107
+ - reviews.bookinfo.com
108
+ - localhost
109
+ route :
110
+ - destination :
111
+ host : rollouts-demo-stable # Should match rollout.spec.strategy.canary.stableService
112
+ weight : 100
113
+ - destination :
114
+ host : rollouts-demo-canary # Should match rollout.spec.strategy.canary.canaryService
115
+ weight : 0
116
+ ` ` `
117
+
118
+ ` ` ` yaml
119
+ apiVersion : networking.istio.io/v1alpha3
120
+ kind : VirtualService
121
+ metadata :
122
+ name : rollouts-demo-vsvc2
68
123
spec :
69
124
gateways :
70
125
- rollouts-demo-gateway
71
126
hosts :
72
- - rollouts-demo.local
127
+ - rollouts-demo-vsvc2 .local
73
128
http :
74
- - name : http-primary # Should match rollout.spec.strategy.canary.trafficRouting.istio.virtualService .routes
129
+ - name : http-secondary # Should match rollout.spec.strategy.canary.trafficRouting.istio.virtualServices .routes
75
130
route :
76
131
- destination :
77
132
host : rollouts-demo-stable # Should match rollout.spec.strategy.canary.stableService
133
+ port :
134
+ number : 15373
78
135
weight : 100
79
136
- destination :
80
137
host : rollouts-demo-canary # Should match rollout.spec.strategy.canary.canaryService
138
+ port :
139
+ number : 15373
81
140
weight : 0
82
141
tls :
83
142
- match :
84
- - port : 443 # Should match the port number of the route defined in rollout.spec.strategy.canary.trafficRouting.istio.virtualService .tlsRoutes
85
- sniHosts : # Should match all the SNI hosts of the route defined in rollout.spec.strategy.canary.trafficRouting.istio.virtualService .tlsRoutes
143
+ - port : 443 # Should match the port number of the route defined in rollout.spec.strategy.canary.trafficRouting.istio.virtualServices .tlsRoutes
144
+ sniHosts : # Should match all the SNI hosts of the route defined in rollout.spec.strategy.canary.trafficRouting.istio.virtualServices .tlsRoutes
86
145
- reviews.bookinfo.com
87
146
route :
88
147
- destination :
@@ -97,13 +156,13 @@ Run the following commands to deploy:
97
156
98
157
* A Rollout
99
158
* Two Services (stable and canary)
100
- * An Istio VirtualService
159
+ * One or more Istio VirtualServices
101
160
* An Istio Gateway
102
161
103
162
` ` ` shell
104
163
kubectl apply -f https://raw.githubusercontent.com/argoproj/argo-rollouts/master/docs/getting-started/istio/rollout.yaml
105
164
kubectl apply -f https://raw.githubusercontent.com/argoproj/argo-rollouts/master/docs/getting-started/istio/services.yaml
106
- kubectl apply -f https://raw.githubusercontent.com/argoproj/argo-rollouts/master/docs/getting-started/istio/virtualsvc .yaml
165
+ kubectl apply -f https://raw.githubusercontent.com/argoproj/argo-rollouts/master/docs/getting-started/istio/multipleVirtualsvc .yaml
107
166
kubectl apply -f https://raw.githubusercontent.com/argoproj/argo-rollouts/master/docs/getting-started/istio/gateway.yaml
108
167
```
109
168
@@ -121,8 +180,9 @@ rollouts-demo-canary ClusterIP 10.103.146.137 <none> 80/TCP 37s
121
180
rollouts-demo-stable ClusterIP 10.101.158.227 < none> 80/TCP 37s
122
181
123
182
$ kubectl get virtualservice
124
- NAME GATEWAYS HOSTS AGE
125
- rollouts-demo-vsvc [rollouts-demo-gateway] [rollouts-demo.local] 54s
183
+ NAME GATEWAYS HOSTS AGE
184
+ rollouts-demo-vsvc1 [rollouts-demo-gateway] [rollouts-demo-vsvc1.local] 54s
185
+ rollouts-demo-vsvc2 [rollouts-demo-gateway] [rollouts-demo-vsvc2.local] 54s
126
186
127
187
$ kubectl get gateway
128
188
NAME AGE
@@ -149,28 +209,71 @@ kubectl argo rollouts get rollout rollouts-demo
149
209
150
210
At this point, both the canary and stable version of the Rollout are running, with 5% of the
151
211
traffic directed to the canary. To understand how this works, inspect the VirtualService which
152
- the Rollout was referencing. When looking at the VirtualService, we see that the route destination
212
+ the Rollout was referencing. When looking at both the VirtualService, we see that the route destination
153
213
weights have been modified by the controller to reflect the current weight of the canary.
154
214
155
215
``` yaml
156
216
apiVersion : networking.istio.io/v1beta1
157
217
kind : VirtualService
158
218
metadata :
159
- name : rollouts-demo-vsvc
219
+ name : rollouts-demo-vsvc1
220
+ namespace : default
221
+ spec :
222
+ gateways :
223
+ - rollouts-demo-gateway
224
+ hosts :
225
+ - rollouts-demo-vsvc1.local
226
+ http :
227
+ - name : http-primary
228
+ route :
229
+ - destination :
230
+ host : rollouts-demo-stable
231
+ port :
232
+ number : 15372
233
+ weight : 95
234
+ - destination :
235
+ host : rollouts-demo-canary
236
+ port :
237
+ number : 15372
238
+ weight : 5
239
+ tls :
240
+ - match :
241
+ - port : 443
242
+ sniHosts :
243
+ - reviews.bookinfo.com
244
+ - localhost
245
+ route :
246
+ - destination :
247
+ host : rollouts-demo-stable
248
+ weight : 95
249
+ - destination :
250
+ host : rollouts-demo-canary
251
+ weight : 5
252
+ ` ` `
253
+
254
+ ` ` ` yaml
255
+ apiVersion : networking.istio.io/v1beta1
256
+ kind : VirtualService
257
+ metadata :
258
+ name : rollouts-demo-vsvc2
160
259
namespace : default
161
260
spec :
162
261
gateways :
163
262
- rollouts-demo-gateway
164
263
hosts :
165
- - rollouts-demo.local
264
+ - rollouts-demo-vsvc2 .local
166
265
http :
167
266
- name : http-primary
168
267
route :
169
268
- destination :
170
269
host : rollouts-demo-stable
270
+ port :
271
+ number : 15373
171
272
weight : 95
172
273
- destination :
173
274
host : rollouts-demo-canary
275
+ port :
276
+ number : 15373
174
277
weight : 5
175
278
tls :
176
279
- match :
@@ -187,4 +290,4 @@ spec:
187
290
` ` `
188
291
189
292
As the Rollout progresses through steps, the HTTP and/or TLS route(s) destination weights will be
190
- adjusted to match the current ` setWeight` of the steps.
293
+ adjusted to match the current ` setWeight` of the steps.
0 commit comments