<p>I have the following scenario,</p>
<p>I have two deployments on Kubernetes, my first deployment needs to be shut down due to some issue
and user requests need to route to the second deployment and then the first deployment will shut
down, once the second is up and running.</p>
<p>How would I route user requests from the first to the second?
I know that there are readiness and liveness check but how would I specifically
specify in the script to send the requests to the second deployment.</p>
<p>Based on my limited knowledge I believe there might be some other ways to re-route the traffic from the first deployment to second deployment.
Also, my user request is a continuous video image being sent from the user to the Kubernetes system.</p>
<p>Thanks, help is highly appreciated.</p>

<p>With a &quot;second deployment&quot;, I assume that you mean a new version of your app, in Kubernetes this would be a change of the <code>Deployment</code> resource to use a different <code>image:</code>.</p>
<p>In Kubernetes, you usually have a few instances (&quot;replicas&quot;) of your app running. And when a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#updating-a-deployment" rel="nofollow noreferrer"><code>Deployment</code> is updated</a> to contain a new version (e.g. a new image), then Kubernetes automatically does a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#rollover-aka-multiple-updates-in-flight" rel="nofollow noreferrer">Rolling Update</a>. This means that it will create new instances from the new image - one by one - and at the same time terminate instances from the old version of the app. This means that you, during a short period of time will have both versions of the app running at the same time. User requests will be routed to any running instance. This can be changed to use a different <em>Deployment Strategy</em>, e.g. &quot;replace&quot; or you can create a more advanced setup.</p>
<blockquote>
<p>my user request is a continuous video image being sent from the user to the Kubernetes system</p>
</blockquote>
<p>Requests to apps running on Kubernetes should be designed in an <em>idempotent</em> way - such that the client can retry the request if the connection is interrupted.</p>
