Controlling the user experience when doing canary or A/B deployments with Istio

10/12/2019

I have an application with multiple services called from a primary application service. I understand the basics of doing canary and A/B deployments, however all the examples I see show a round robin where each request switches between versions.

What I'd prefer is that once a given user/session is associated with a certain version it stays that way to avoid giving a confusing experience to the user.

How can this be achieved with Kubernetes or Istio/Envoy?

-- gunygoogoo
canary-deployment
envoyproxy
istio
kubernetes

2 Answers

10/15/2019

We've been grappling with this because we want to deploy test microservices into production and expose them only if the first request contains a "dark release" header.

As mentioned by Jonas, cookies and header values can in theory be used to achieve what you're looking for. It's very easy to achieve if the service that you are canarying is on the edge, and your user is directly accessing.

The problem is, you mention you have multiple services. If you have a chain where the user accesses edge service A which is then making calls to service B, service C etc, the headers or cookies will not be propagated from one service to another.

This is the same problem that we hit when trying to do distributed tracing. The Istio documents currently have this FAQ:

https://istio.io/faq/distributed-tracing/#istio-copy-headers

The long and short of that is that you will have to do header propagation manually. Luckily most of my microservices are built on Spring Boot and I can achieve header propagation with a simple 5-line class that intercepts all outgoing calls. But it is nonetheless invasive and has to be done everywhere. The antithesis of a service mesh.

It's possible there is a clever way around this but it's hard to infer from the docs what is possible and what isn't. I've seen a few github issues raised by Istio developers to address this but every one I've seen has gone stale after initial enthusiasm.

-- Dick Chesterwood
Source: StackOverflow

10/12/2019

You can do this with Istio using Request Routing - Route based on user identity but I don't know how mature the feature is. It may also be possible to route based on cookies or header values.

-- Jonas
Source: StackOverflow