You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/gitbook/tutorials/istio-progressive-delivery.md
+60
Original file line number
Diff line number
Diff line change
@@ -480,3 +480,63 @@ With the above configuration, Flagger will run a canary release with the followi
480
480
481
481
The above procedure can be extended with [custom metrics](../usage/metrics.md) checks, [webhooks](../usage/webhooks.md), [manual promotion](../usage/webhooks.md#manual-gating) approval and [Slack or MS Teams](../usage/alerting.md) notifications.
482
482
483
+
484
+
## Canary Deployments for TCP Services
485
+
486
+
Performing a Canary deployment on a TCP (non HTTP) service is nearly identical to an HTTP Canary. Besides updating your `Gateway` document to support the `TCP` routing, the only difference is you have to set the `appProtocol` field to `TCP` inside of the `service` section of your `Canary` document.
487
+
488
+
#### Example:
489
+
490
+
```yaml
491
+
apiVersion: networking.istio.io/v1alpha3
492
+
kind: Gateway
493
+
metadata:
494
+
name: public-gateway
495
+
namespace: istio-system
496
+
spec:
497
+
selector:
498
+
istio: ingressgateway
499
+
servers:
500
+
- port:
501
+
number: 7070
502
+
name: tcp-service
503
+
protocol: TCP # <== set the protocol to tcp here
504
+
hosts:
505
+
- "*"
506
+
```
507
+
508
+
```yaml
509
+
apiVersion: flagger.app/v1beta1
510
+
kind: Canary
511
+
...
512
+
...
513
+
service:
514
+
port: 7070
515
+
appProtocol: TCP # <== set the appProtocol here
516
+
targetPort: 7070
517
+
portName: "tcp-service-port"
518
+
...
519
+
...
520
+
```
521
+
522
+
If the `appProtocol` equals `TCP` then Flagger will treat this as a Canary deployment for a `TCP` service. When it creates the `VirtualService` document it will add a `TCP` section to route requests between the `primary` and `canary` services. See Istio documentation for more information on this [spec](https://istio.io/latest/docs/reference/config/networking/virtual-service/#TCPRoute).
523
+
524
+
The resulting `VirtualService` will include a `tcp` section similar to what is shown below:
525
+
```yaml
526
+
tcp:
527
+
- route:
528
+
- destination:
529
+
host: tcp-service-primary
530
+
port:
531
+
number: 7070
532
+
weight: 100
533
+
- destination:
534
+
host: tcp-service-canary
535
+
port:
536
+
number: 7070
537
+
weight: 0
538
+
```
539
+
540
+
Once the Canary analysis begins, Flagger will be able to adjust the weights inside of this `tcp` section to advance the Canary deployment until it either runs into an error (and is halted) or it successfully reaches the end of the analysis and is Promoted.
541
+
542
+
It is also important to note that if you set `appProtocol` to anything other than `TCP`, for example if you set it to `HTTP`, it will perform the Canary and treat it as an `HTTP` service. The same remains true if you do not set `appProtocol` at all. It will __ONLY__ treat a Canary as a `TCP` service if `appProtocal` equals `TCP`.
0 commit comments