SessionAffinity on k3s #3719
Replies: 1 comment 1 reply
-
How do clients access your service? Are you using the integrated Traefik? If you are using the integrated traefik and try to handle external requests, the issue is probably that the Service doesn't see the real IP of the client, but only the IP of the integrated load-balancer (klipper-lb) of K3s. This is an issue that pops up on the issue tracker all the time. If my assumption is right and you're using the integrated Traefik, then there are tons of workarounds to handle this issue - and none of them are really satisfactory. A simple workaround is to customize the bundled Traefik to not use a Service of type "LoadBalancer", but deploying Traefik as a DaemonSet and binding it directly to the host-ports instead. You can do this by deploying this manifest: apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
name: traefik
namespace: kube-system
spec:
valuesContent: |-
deployment:
kind: 'DaemonSet'
ports:
web:
port: 8000
hostPort: 80
websecure:
port: 8443
hostPort: 443
service:
enabled: false |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm using k3s to develop and prototype OBS WebRTC broadcasting.
I'm pretty new to k3s.
One issue I am struggling with is getting sessionAffinity to work.
My http requests are moving between different backends even though I have sessionAffinity on the service.
Thanks for any ideas/pointers. Cameron
Here is my yaml
Beta Was this translation helpful? Give feedback.
All reactions