Kubernetes Deployment

Was there someone able to run Vaadin 10 on Kubernetes ? I’m wondering if it’s possible or not.

What I did:

It works but if I kill one of the nodes, the app is getting errors. Ex:

java.lang.UnsupportedOperationException: Unexpected message id from the client. Expected sync id: 42, got 43. Message start: {"csrfToken":"85701115-77da-4b38-b6dc-6396e4065d2d","rpc":[{"type":"mSync","node":46,"feature":1,"property":"checked","value":true}]
,"syncId":171,"clientId":43}
at com.vaadin.flow.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:302)
at com.vaadin.flow.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:89)
at com.vaadin.flow.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)

So if you were successful, what was your deployment strategies ? Do are you able to deploy or kill a node without user disruption ? I’m afraid that if there’s rescheduling, the app will crash while the user is using it.

I’m wondering if you can trust sticky sessions / session affinity to always redirect the user to the same Kubernetes pod? I understand it works well with a loadbalancer which has a hardcoded number of nodes, but Kubernetes is dynamic. Let’s say you have huge peak in usage and Kubernetes creates 10 pods. After the peak it will kill some of the pods and the user would be redirected to another pod. Is there a way to prevent this from happening?

(Why this is important: Vaadin is a stateful application and it keeps the user session in the backend. If the user is suddenly moved to another pod (which has another Vaadin instance), the session will be terminated.)

It depends if you add scaling on your pod.

Also that’s why I’m trying to use an external session manager so that the state is not stored in the pod but in a different DB.

You can see other explanation here: https://vaadin.com/forum/thread/17277282/spring-boot-vaadin-flow-spring-session-redis-spring-security-sessi