title: Connect multiple users to the same kubernetes pod
body: <p>I have created a server named <a href="https://github.com/CyBear-Jinni/cbj_remote-pipes" rel="nofollow noreferrer">Remote Pipes</a> that get clients connections with streams and transfer data between them.</p>
  <p>On one side there is a computer Hub and on the other side there are a number of App clients.</p>
  <p>The Hub client connects to the Remote Pipes and a two-way stream remains open.</p>
  <p>All the Apps clients connect to the Remote Pipes and a <a href="https://github.com/CyBear-Jinni/cbj_remote-pipes/blob/main/lib/domain/hube_server/smart_server_u.dart" rel="nofollow noreferrer">two-way stream remains open</a>.</p>
  <p>Whenever the Hub wants to send data for the Apps clients he sends it to the Remote Pipes, and the Remote pipes send each connected App client the data through (already opened) opened stream.</p>
  <p>Whenever one of the app clients wants to send data for the Hub he sends it to the Remote Pipes which combines all streams from the Apps and sends them through a single (already opened) stream to the Hub.</p>
  <p><a href="https://i.stack.imgur.com/fbpjym.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fbpjym.jpg" alt="enter image description here" /></a></p>
  <p>Remote Pipes do not store data nor use local storage nor use local DB and each instance is intended for one family.</p>
  <p>So I want to create a Kubernetes pod with Remote Pipes for each family and all family members need to connect to the same pod.</p>
  <p>No need for a persistent pod, if one pod gets deleted (in case there are no connections) a new one is ok as long as all the family members Apps clients and the Hub client connect to the same pod.</p>
  <p><strong>The Question:</strong></p>
  <p>Searching for a way to make <strong>multiple users connect to the same kubernetes pod</strong> (like game/zoom lobbies?) and I am not sure what is the best option.</p>
  <p>The routing must be created <strong>dynamically and be scalable</strong> so routing based on ports and Name-based routing are not a good fit.</p>
  <p>Here are a number of terms that I found that may be related</p>
  <ol>
  <li>Stateful application</li>
  <li>Headless services</li>
  <li>Auto-labeling</li>
  <li><a href="https://github.com/linode/linode-cloud-controller-manager" rel="nofollow noreferrer">kube-proxy</a></li>
  <li>Host based routing</li>
  <li>Path based routing</li>
  <li>Header based routing</li>
  <li>Software/Application Load balancer</li>
  </ol>
  <p>I am using Linode so using Linode NodeBalancers is preferable if load balancer is required.</p>