I am trying to find a solution to a problem. I have a server pod, in K8S, which needs to go through a graceful shutdown, which can take anywhere up to an hour. In-memory user state, and it needs to wait for all the users to actually log out.
It's not hard to have the app refuse to stop until the condition is met on SIGTERM. And for it to begin failing health checks in that circumstance, so users don't open connections to it.
But what I'm trying to do is have it stop allowing NEW SESSIONS. That is, users with existing affinity to it should be able to open new connections. However, Traefik should direct users without sessions to a different pod.
Has anybody done this before? I can have Traefik health checks disallow connections. But then sticky session get sent to a different pod. There doesn't seem to be a way to have Traefik continue forwarding existing sessions to it, but not allow new ones.