Enable session affinity for canary release with nginx ingress controller

2/27/2019

I'm trying to setup canary-release with Nginx ingress controller. The problem is that it doesn't keep session affinity causing every request to be served by a random service.

My canary ingress:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  namespace: canary
  name: ingress-nginx
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/canary: "true"
    nginx.ingress.kubernetes.io/canary-weight: "50"

My default ingress:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress-nginx
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/affinity: cookie

Is it currently possible to enable session affinity for canary release with Nginx ingress?

-- Mauricio
canary-deployment
kubernetes
kubernetes-ingress
nginx
nginx-ingress

1 Answer

3/1/2019

Seems you are not the only who have this problem. There is an open issue on github with mostly the same problem: Session affinity doesn't work for canaries

Waiting for fix

-- VKR
Source: StackOverflow