Traefik Ingress controller + sticky sessions

We are evaluating the Traefik Ingress controller --> Ingress provider.

This works fine for non-sticky sessions, but now I like to check the session persistency part.

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
traefik.ingress.kubernetes.io/affinity: "true"
traefik.ingress.kubernetes.io/session-cookie-name: traefik_srv_id
name: tme-ing-jetty-deploytestjetty-traefik
namespace: tme-ns-test-dev
spec:
ingressClassName: traefik
rules:
...

But seems sticky sessions are not enabled.

I use the correct way of configuring the Ingress resource?

Seems this is the way to do it inside the service

apiVersion: v1
kind: Service
metadata:
annotations:
traefik.ingress.kubernetes.io/service.sticky.cookie: "true"
traefik.ingress.kubernetes.io/service.sticky.cookie.name: "the-name"

Hello @Walter.Heestermans

Thanks for trying Traefik.

Here is the list of all available annotations that might be added on a service level:

when you use Traefik as Ingress with Kubernetes Ingress provider.

You can also consider to use Kubernetes CRD and use Traefik Service to address challenges with session stickiness. Here are the examples:

Please let us know if you have any other questions concerning Traefik.