<p>kubernetes newbie here, so this question might not make sense and apologies in advance. Please bear with me.</p>

<p>So as I understand it, the Ingress Controller communicates directly to the pods. One of the reasons is so it maintains co-relation with user cookies and sessions with the pod that issue them to the user.</p>

<p>But when the pod dies, so does those cookies and sessions? So the user ex. will have to re-login for example. Is that right?</p>

<p>Thanks in advance.</p>

Jplus2
<p>From the <a href="https://kubernetes.github.io/ingress-nginx/examples/affinity/cookie/" rel="nofollow noreferrer">docs</a>.</p>

<blockquote>
  <p>When the backend server is removed, the requests are re-routed to
  another upstream server. This does not require the cookie to be
  updated because the key's consistent hash will change.</p>
</blockquote>

<p>Assuming that you have more than one replicas(via deployment/replication controller) of the pod, this means if one of the replica pod dies, kubernetes removes it from the list of endpoints of the service, and consequently Lua balancer in nginx removes that endpoint from its upstream server list, which means consistent hash ring gets rebuilt and the request will be rerouted to other replica pods keeping the same session cookie.</p>

<p>Whether the user need to re-login or not depends on how the application stores or uses the cookie to decide if a user is logged in or not.</p>
