Skip to content

Remove invalid Traefik Middleware stickySession resource from Orchestra#247

Open
spantaleev wants to merge 1 commit intoOpenUnison:masterfrom
spantaleev:fix/traefik-sticky-middleware
Open

Remove invalid Traefik Middleware stickySession resource from Orchestra#247
spantaleev wants to merge 1 commit intoOpenUnison:masterfrom
spantaleev:fix/traefik-sticky-middleware

Conversation

@spantaleev
Copy link
Contributor

The Traefik template currently emits:

apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
  name: sticky-cookie
spec:
  stickySession: ...

This fails validation/apply against Traefik CRDs because stickySession is not a valid top-level field in middlewares.traefik.io (v1alpha1).

Important distinction:

  • Traefik does support sticky sessions, but via sticky on service/load-balancer definitions (e.g. IngressRoute route services), not as Middleware spec.stickySession.
  • In this template, sticky behavior is already configured correctly on IngressRoute service entries (routes[].services[].sticky.cookie), so removing the extra Middleware is safe and preserves affinity behavior.

References:

This regression seems to have been introduced in commit 6337576 where the sticky-cookie Middleware was added.

@mlbiam
Copy link
Contributor

mlbiam commented Feb 24, 2026

@spantaleev good catch. looks like it got by because the CRD doesn't enforce extra attributes. Please bump the orchestra version too before i can merge

The Traefik template currently emits:

```yml
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
  name: sticky-cookie
spec:
  stickySession: ...
```

This fails validation/apply against Traefik CRDs because stickySession is not a valid top-level field in middlewares.traefik.io (v1alpha1).

Important distinction:

- Traefik does support sticky sessions, but via sticky on service/load-balancer definitions (e.g. `IngressRoute` route services), not as Middleware `spec.stickySession`.
- In this template, sticky behavior is already configured correctly on IngressRoute service entries (`routes[].services[].sticky.cookie`), so removing the extra Middleware is safe and preserves affinity behavior.

References:

- Traefik Kubernetes CRD definitions (v2.10, v3.6): sticky is defined in service contexts; no Middleware `stickySession`
  - https://raw.githubusercontent.com/traefik/traefik/v2.10/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml
  - https://raw.githubusercontent.com/traefik/traefik/v3.6/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml

- Traefik service sticky-sessions docs:
  https://doc.traefik.io/traefik/v3.6/reference/routing-configuration/http/load-balancing/service/#sticky-sessions

This regression seems to have been introduced in commit 6337576 where the `sticky-cookie` Middleware was added.
@spantaleev spantaleev force-pushed the fix/traefik-sticky-middleware branch from 42e3b06 to 63b755d Compare February 25, 2026 06:31
@spantaleev
Copy link
Contributor Author

I've also bumped the Orchestra version now. Sorry for the delay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants