rollouts-demo icon indicating copy to clipboard operation
rollouts-demo copied to clipboard

Fix istio demo: Internal request route not base on weight but replica count

Open StyleTang opened this issue 1 year ago • 1 comments

Notes

Hi Team, I find the Istio demo (both istio and istio-subset) fine-grained, weighted traffic shifting feature has issue for internal request.

A lot of uses are learning from this demo and they maybe not expert in istio, so we'd better to fix it and provide best practice for them, otherwise we will misleading them. (It is not easy for beginners to fix it by themselves, like me...)

Could you take some time to review it. Thanks

Architecture

The green path is external request, istio-rollout.apps.argoproj.io/color works well. because

  • VirtualService istio-rollout-vsvc apply to istio-rollout-gateway, and external request go through istio-ingressgateway(istio-rollout-gateway)
  • Host istio-rollout.apps.argoproj.io can be matched, so it can use http.route rule

The red path is internal request, because the VirtualService istio-rollout-vsvc not apply to service mesh, and istio-rollout.rollouts-demo-istio.svc.cluster.local go through mesh but not gateway, it only uses Service istio-rollout's endpoints, http.route rule doesn't work for this request. image

How to fix

The fix contains 2 parts.

  • VirtualService istio-rollout-vsvc apply to mesh
  • match hosts {servie}.{namespace}.svc.cluster.local, e.g. istio-rollout.rollouts-demo-istio.svc.cluster.local

StyleTang avatar Jan 28 '24 15:01 StyleTang

Link issue: Internal request route not base on weight but replica count

@zachaller Hi bro, sorry to bother you. I didn't get notification from your previous replies, thanks for your comment. Could you help me review this (or anyone else can help)?

Thanks

StyleTang avatar Jan 28 '24 15:01 StyleTang