Kubernetes deployment without sticky sessions

Hi, i’m trying to deploy an app to k8s cluster with 2 pods.
Our DevOps team isn’t fond of changing cluster settings with sticky sessions affinity.
Currently the app infinitely reloads user sessions between pods cause sticky sessions are not configured.
Is there a way to store user session in like Redis or some other tool and then inject it to the app and how can i achieve that?

You don’t need to change cluster settings.

You just need to define an ingress

Sticky sessions are mandatory, how you achieve this is your choice but when a user interacts with a Vaadin screen then all requests must be routed to the same node or things just don’t work. The centralized session store is just there for the case when a node goes down and the user gets rerouted, it’s not a transparant mechanism that allows you to load for each request the user session onto whatever node that handles the request. You need kubernetes-kit to enable redis or hazelcast session serialization. Sure you could try and do this yourself, but it’s way trickier than you think.

3 Likes