I want to apply blue green in a Kubernetes environment with multiple microservices using istio.
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: mesh-istio-bluegreen
spec:
hosts:
- mesh-istio-bluegreen.pipecd.dev
gateways:
- mesh-istio-bluegreen
http:
- route:
- destination:
host: mesh-istio-bluegreen
subset: blue
weight: 100
- route:
- destination:
host: mesh-istio-bluegreen
subset: green
weight: 0
The above code is a official example and assumes that the destination rule already exists.
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: mesh-istio-bluegreen
spec:
hosts:
- mesh-istio-bluegreen.pipecd.dev
gateways:
- mesh-istio-bluegreen
http:
- route:
- destination:
host: mesh-istio-bluegreen
subset: blue
weight: 0
- route:
- destination:
host: mesh-istio-bluegreen
subset: green
weight: 100
When switch over, then above virtual service will be applied.
Then my question is this: What happens to the connection to blue when switch over from blue to green? Existing connections routes to blue? or green?
I searched and implemented several options to apply blue green deployment. I considered 3 options: route53 weight, nlb, and argo rollout.
- The method of using route53 weight and nlb is that **existing connections connected to blue ** continue to be connected to blue, and only new requests are connected to green.
- When using argo rollout, all connections (including existing connections) are connected to green immediately after the switch over.
However, in the case of istio, it is difficult because its internal operation is not much known. If anyone knows anything about this please help.
정혜일 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.