Specify to Kubernetes when a Pod is "busy" Specify to Kubernetes when a Pod is "busy" kubernetes kubernetes

Specify to Kubernetes when a Pod is "busy"


You have to use LivenessProbe

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.

LivenessProbe can be TCP or HTTP


As prometherion suggested you can use the liveness probe and also i would suggest to add the rediness probe together.

you can have a look at the official document : https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/

Sometimes, applications are temporarily unable to serve traffic. For example when, application first need to load large data or configuration files during startup.

In such cases, you don’t want to kill the application, but you don’t want to send traffic either there to pods. K8s provides readiness probes to detect and mitigate these situations. A pod with containers reporting that they are not ready does not receive traffic through Kubernetes Services.