Istio 10 金丝雀部署

Submitted by Lizhe on Tue, 06/23/2020 - 05:55

 

这里使用v2 当做新版本,在header中加入一个 lab:canary 用以区分用户

有 header 的用户导向 v2,没有的默认指向 v1

20200623020716

修改一下VirtualService

apiVersion: networking.istio.io/v1alpha3

kind: VirtualService

metadata:

  name: flaskapp-canary

  namespace: lizhe

spec:

  hosts:

  - flaskapp-service

  http:

  - match:

    - headers:

        lab:

          exact: canary

    route:

    - destination:

        host: flaskapp-service

        subset: v2

  - route:

    - destination:

        host: flaskapp-service

        subset: v1

 

 

for i in `seq 10`; do http --body http://flaskapp-service/env/version lab:canary; done

for i in `seq 10`; do http --body http://flaskapp-service/env/version; done

 

20200623021536

 

20200623021546