<p>I am currently trying to scale automatically a deployment when the readiness probe hass failed for its pods currently running.</p>
<p>A pod is IDLE until a POST request is sent to it and while it is processing the request, it is not answering any other request.</p>
<p>To know when a processing is in progress, I created an endpoint returning TRUE if the pod is IDLE, FALSE otherwise.</p>
<p>I configure the readiness probe to query this endpoint to mark it as unavailable when a processing is in progress (and to mark it back to available when it is not processing anymore).</p>
<p>By default I have a limited pool of pods (like 5) that can answer requests.</p>
<p>But I still want to be able to send another POST with other parameters to trigger another processing when all my 5 pods are unavailable.</p>
<p>So, when the readiness probe fails for all pods, I want to scale the deployment in order to have other pods availbel to answer requests.</p>
<p>The issue here is that I did not find how to do such a thing with K8S or if this is even possible. Is there someone who could help me on this?</p>
<p>An alternative would be to create a 'watcher' pod who would watch all the readiness probe for a given deployement and when I fails for all pods, the watch would be in charge of scaling the deployement.</p>
<p>But this alternative implies development that I would like to avoid if it is natively possible to do in K8S.</p>
<p>Thank you :)</p>

Gabi
<p>A readinessprobe by itself shouldn't be able to scale a deployment. By default, the only thing it can do is removing the Pod's IP from the endpoints of all the services that match the Pod.</p>
<p>The only solution that comes to my mind is what you said, so having an Horizontal Pod Autoscaler with custom metrics pointing to a Pod that keeps track of all the readinessprobes.</p>
