Is it possible to run Hydra and its builders in a Kubernetes cluster?


#1

Hello,

I’m exploring different options to run a CI system to build Nix projects on an existing Kubernetes cluster. Is Hydra suitable or adaptable for this or should I consider some other solution? How would other (preferably open source) CI tools fit in if Hydra cannot be used?


#2

I have not actually done this, but it seems like Hydra ought to work acceptably on a Kubernetes cluster. The hydra-server, hydra-evaluator, and hydra-queue-runner daemons can run together as adjacent containers in a pod, probably with a persistent storage volume so build logs stick around. Postgres on kubernetes is doable and thoroughly discussed elsewhere; it gets somewhat complicated if you require high availability, but for a simple setup all you really need is persistent storage. Projects like kubedb can make life easier for HA database setups.

For launching builder instances as pods, hydra-provisioner would be a good starting point. I’m just unsure about the mechanics of connecting them up as trusted remote nix daemons. Perhaps it’s not so different than managing ec2 instances.