Canary Ingress weight with cookie in response for sticky session #12444
Labels
kind/support
Categorizes issue or PR as a support question.
needs-priority
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
We had an idea to implement canary deployments while using sticky session so, for instance, 20% of our traffic uses canary while the others use 80%, all the while these requests stick with the initial behaviour, meaning if a request went to the canary deployment the first time, we want it there again and again.
Now I have tried setting this by using the file attached below, as the session-cookie-name should write a cookie in the response (i.e. enabling the stickiness) and the canary annotations should just recognize the cookie set before, while the weight is set to 20 so that at first we have 20% of the traffic routed to the canary
`apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
namespace: test
annotations:
name: ingress-echo
spec:
ingressClassName: nginx
rules:
host: canary.example.com
http:
paths:
path: /echo
pathType: Exact
backend:
service:
name: echo-v1
port:
number: 8080
tls:
hosts:
canary.example.com
secretName: ingress-echo-tls
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
namespace: test
annotations:
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/session-cookie-name: "http-cookie"
nginx.ingress.kubernetes.io/session-cookie-expires: "172800"
nginx.ingress.kubernetes.io/session-cookie-max-age: "172800"
nginx.ingress.kubernetes.io/canary: "true"
nginx.ingress.kubernetes.io/canary-weight: "20"
name: ingress-echo-canary-cookie
spec:
ingressClassName: nginx
rules:
host: canary.example.com
http:
paths:
path: /echo
pathType: Exact
backend:
service:
name: echo-v2
port:
number: 8080
tls:
hosts:
canary.example.cloud
secretName: ingress-echo-canary-cookie-tls`
The text was updated successfully, but these errors were encountered: