Hi felas,
I am currently struggeling to apply a cookieless stickyness to our deployment with subsets.
The situation is as follows :
Virtual Service
The goal is , that the user keeps the Version which he was assigned to as long as his session remains.
This should apply even during / after a traffic shift.
We achieved this by setting cookies upon initial request. We had to do this, since it looked like the stickyness which applied in the Destination Rule did not apply while using weight based connections.
http:
# match for existing prod frontend sessions
- match:
- uri:
prefix: /test.html
headers:
Cookie:
regex: ^(.*;?)?(frontend_version=prod)(;.*)?
- destination:
host: frontend
port:
number: 80
subset: prod
# match for existing staging frontend sessions
- match:
- uri:
prefix: /test.html
headers:
Cookie:
regex: ^(.*;?)?(frontend_version=staging)(;.*)?
- destination:
host: frontend
port:
number: 80
subset: staging
# initial match for prod/staging frontend
- match:
- uri:
prefix: /test.html
- destination:
host: frontend
port:
number: 80
subset: prod
weight: 0
headers:
response:
add:
"Set-Cookie": frontend_version=prod; Path=/
- destination:
host: frontend
port:
number: 80
subset: staging
weight: 100
headers:
response:
add:
"Set-Cookie": frontend_version=staging; Path=/
Destination Rule
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: frontend-destrule
spec:
host: frontend
subsets:
- labels:
app.kubernetes.io/version: prod
name: prod
- labels:
app.kubernetes.io/version: staging
name: staging
trafficPolicy:
loadBalancer:
consistentHash:
# httpCookie:
# name: route_frontend
# path: /
# ttl: 0s
useSourceIp: true
Is there any option to do this without cookies ?