Closed as not planned
Description
From discussing with @coadler, Terraform takes up the vast majority of CPU resources on the average Coder deployment. Provisioner demand is also highly variable, spiking when developers are beginning and ending their work days. For reasons of cost, performance, and reliability, we should have a well-supported path to horizontally scale provisioners. Our largest deployments run Kubernetes, so it's the natural place to start.
I believe this scaling can be simply accomplished with these product tweaks:
- Expose build-queue-length as a metric that the Horizontal Pod Autoscaler can target
- Add a provisionerd flag to run one build then exit, creating ephemerality and down-scaling
- Provide a provisionerd helm chart wrapping this all together