<p>One of my micro service is running on Kubernetes.
I would like to specify to K8s load balancer when a pod is busy because the behaviour that I get currently is not ok.</p>

<p><strong>One example:</strong></p>

<p>I have 8 pods running, each pod can process 1 request at a time. Each request take from 70 to 100% of the CPU core allocated to the pod.
But when I send 8 requests to my application, Kubernetes does not dispatch those requests to the 8 pods but try to use only one. And since I'm blocking (via threadpool) each replica of app to use only one thread at a time, of course requests are queued for pod 1.</p>

<p><strong>So my question is:</strong> How can I tell Kubernetes that POD 1 is busy and that load-balancer must dispatch request 2 to POD 2 ?</p>

<p><strong>Note:</strong> For dev and test purpose I'm using Docker Desktop (Docker for Windows) on Windows 10 and kubectl.</p>

<p>You have to use <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#define-a-liveness-command" rel="nofollow noreferrer">LivenessProbe</a></p>

<p>when a Pod will not able to handle a request its IP will be removed from Service endpoints, so no traffic will be forwarded to it.</p>

<p>LivenessProbe can be <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#define-a-tcp-liveness-probe" rel="nofollow noreferrer">TCP</a> or <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#define-a-liveness-http-request" rel="nofollow noreferrer">HTTP</a></p>
