<p>I want an application to pull an item off a queue, process the item on the queue and then destroy itself. Pull -> Process -> Destroy.</p>

<p>I've looked at using the job pattern Queue with Pod Per Work Item as that fits the usecase however it isn't appropriate when I need the job to autoscale aka 0/1 pods when queue is empty and scale to a point when items are added. The only way I can see doing this is via a deployment but that removes the pattern of Queue with Pod per Work Item. There must be a fresh container per item.</p>

<p>Is there a way to have the job pattern Queue with Pod Per Work Item but with auto-scaling? </p>

Softey
<p>I am a bit confused, so I'll just say this: if you don't mind a failed pod, and you wish that a failed pod will not be recreated by Kubernetes, you can do that in your code by catching all errors and exiting gracefully (not advised).
Please also note, that for deployments, the only accepted <code>restartPolicy</code> is always. So pods of a deployments who crash will always be restarted by Kubernetes, and will probably fails for the same reason, leading to a <code>CrashLoopBackOff</code>.</p>

<p>If you want to scale a deployment depending on the length of a RabbitMQ queue's length, check <a href="https://github.com/kedacore/keda" rel="nofollow noreferrer">KEDA</a>. It is an event-driven autoscaling platform.
Make sure to also check their example with <a href="https://github.com/kedacore/sample-go-rabbitmq" rel="nofollow noreferrer">RabbitMQ</a></p>

<p>Another possibility is a job/deployment, that routinely checks the length of the queue in question and executes <code>kubectl</code> commands to scale your deployment.
<a href="https://github.com/onfido/k8s-rabbit-pod-autoscaler" rel="nofollow noreferrer">Here</a> is the cleanest one I could find, at least for my taste </p>
