If I have multiple deployments of a stable frontend & stable backend, and 1 deployment each of canary-frontend and canary-backend,
How do I ensure that the canary-frontend hits the canary-backend and the stable frontends only hit the stable backends?
I'm thinking that session affinity will only ensure that someone loggedin on my canary-frontend will return to my canary frontend, but it doesnt guarantee me that the canary-frontend will hit the canary backend.
Is there something such as a 'label affinity'?
Note I am using google container engine if that matters
I would suggest to have your canary deployment named canary-backend-service
and the canary frontend should call https://canary-backend-service
.
You can have an environment variable to switch between the stable and canary backend service, a bit like this:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: canary-frontend
spec:
template:
spec:
containers:
- name: frontend
image: frontend:v2.0.0-rc1
env:
- name: BACKEND
value: canary-backend
Then you will have to read the BACKEND
environment variable in your code instead of a fixed backend-service
hostname.