github.com/oam-dev/kubevela@v1.9.11/docs/examples/workflow/canary-rollout/README.md (about) 1 # Canary Rollout 2 3 ## Prerequisite 4 5 enable istio addon in you cluster 6 ```shell 7 vela addon enable istio 8 ``` 9 10 enable label istio injection in `default namespace` 11 12 ```shell 13 kubectl label namespace default istio-injection=enabled 14 ``` 15 16 17 ## Canary rollout workflow 18 19 ### First deployment 20 21 Apply this YAML to deploy application. 22 23 ```shell 24 kubectl apply -f first-deploy.yaml 25 ``` 26 27 Use `kubectl port-forward` map gateway port to localhost 28 ```shell 29 kubectl port-forward -n istio-system service/istio-ingressgateway 9082:80 30 ``` 31 32 Wait a few minutes, when rollout have finished. Request back-end service by gateway several times. 33 ```shell 34 curl http://127.0.0.1:9082/server 35 ``` 36 37 Will always see return page of `httpd` like this. 38 ```shell 39 Demo: v1 40 ``` 41 42 ### Canary rollout part of traffic and replicas to new revision 43 ```shell 44 kubectl apply -f rollout-v2.yaml 45 ``` 46 47 Request back-end service by gateway several times. 48 ```shell 49 curl http://127.0.0.1:9082/server 50 ``` 51 52 This's a 90% chance still see return page of `v1`, and 10% see return page of `v2` like this. 53 54 ```shell 55 Demo: v2 56 ``` 57 58 ### Rollout rest traffic and replicas to new revision 59 60 ```shell 61 vela workflow resume canary-test 62 ``` 63 64 Wait a few minutes, when rollout have finished. Request back-end service by gateway several times. 65 ```shell 66 curl http://127.0.0.1:9082/server 67 ``` 68 69 Will always see return page of `v2`. 70 71 72 73 74