Draining backend

I am trying to achieve zero down time deployment with Traefik. It is a legacy Java app that holds long living connections and a user that started a session with a running container, should finish there, and only new connections should go to the new container being deployed. Basically,
1- The container is running
2- Users connect to it
3- New version is deployed
4- Both containers are running simultaneously
5- Old sessions still go to the initial container but new ones go to the just deployed container.
6- After the old pod has no more connections it dies .
How would I be able to achieve that?