traefik sticky cookies

19/02/2021

add theses labels in traefik

- "traefik.http.services.whoami.loadbalancer.sticky.cookie=true"
- "traefik.http.services.whoami.loadBalancer.sticky.cookie.name=sticky"
        

if you call that url

curl -s 'https://whoami.raphaelpiccolo.com/'

you get a cookie :

Cookie: sticky=http://172.18.0.79:80

if we send it in next requests we land on the same container

curl -s -b "sticky=http://172.18.0.79:80" 'https://whoami.raphaelpiccolo.com/'

Raccourcis