title: Path-based sticky session with Kubernetes
body: <p>I have a system on Kubernetes and I need path-based sticky session but couldn't find anything about it on the Internet.</p>
  
  <p><strong>Scenario</strong></p>
  
  <p>My system exposes 2 endpoints</p>
  
  <pre><code>/start
  /&lt;sessionid&gt;/dosomething
  </code></pre>
  
  <p>When client hits to <code>/start</code>, a session id is returned. Client will then make requests to <code>/&lt;sessionid&gt;/dosomething</code>. This means the session id is dynamically generated.</p>
  
  <p>I want to make sure all requests with the same session id in its path are always routed to the same backend (and keep in mind the <strong>session ids are dynamically generated</strong>).</p>
  
  <p><strong>Note</strong>
  I prefer solutions that rely heavily on networking rather than on the application itself (I don't want the routing logic to be inside application code)</p>