<p>Suppose I have a RabbitMQ instance and a set of pods that pick messages from RabbitMQ and process them. How do I make Kubernetes increase the number of pods as the queue size increases?</p>

<p>(I'm mentioning RabbitMQ, but that's just an example. Pick your favorite message queue software or load balancer if you wish.)</p>

<p>The top-level solution to this is quite straightforward:</p>

<p>Set up a separate container that is connected to your queue, and uses the Kubernetes API to scale the deployments.</p>

<p>There exist some solutions to this problem already, but they do however not look like they are actively maintained and production ready, but might help:</p>

<ul>
<li><a href="https://github.com/mbogus/kube-amqp-autoscale" rel="noreferrer">https://github.com/mbogus/kube-amqp-autoscale</a></li>
<li><a href="https://github.com/mbogus/docker-kube-amqp-autoscale" rel="noreferrer">https://github.com/mbogus/docker-kube-amqp-autoscale</a></li>
<li><a href="https://github.com/onfido/k8s-rabbit-pod-autoscaler" rel="noreferrer">https://github.com/onfido/k8s-rabbit-pod-autoscaler</a></li>
</ul>
