Circleci-k8s-agent: Kubernetes scaling solution for self-hosted runners

Hey everyone! Just dropping some open-source goodness that I’ve been working on this weekend for my company Cobalt.io. We wanted to test out self-hosted runners, but quickly discovered there was no easy way to scale the deployment of these runners in Kubernetes!

So I’ve written a Kubernetes-native agent that will poll the CircleCI API and spawn one-off jobs to fulfill them. It supports multiple resource classes and can even go across CircleCI accounts. It’s configured entirely via ConfigMaps and Secrets.

Keep in mind this is still in development and we haven’t even started using it in production, but I figured some eyeballs early on might have some good advice or feature requests!

We’re using this in combination with GKE’s Autopilot mode which essentially bills you by how much your pods request and completely handles the nodes for you. Essentially there’s zero scaling maintenance when combined with Autopilot!

2 Likes

Wow, this is great! Thank you for sharing @notfromstatefarm!

Hey @notfromstatefarm, I’m the product manager from the Runner team. This is awesome to see. Thanks so much for sharing!