buildkite / agent-stack-k8s

Spin up an autoscaling stack of Buildkite Agents on Kubernetes
MIT License
80 stars 31 forks source link

Fail jobs without starting pods #363

Closed DrJosh9000 closed 2 months ago

DrJosh9000 commented 2 months ago

So a job is nonsense, a pod can't be constructed, or Kubernetes won't accept it. Currently, we build a whole 'nother pod containing an agent, a command container, an init container, etc using the default agent image, and tell it to...

echo "the error message" && exit 1

which smacks of cracking a walnut with the Mesta 50000.

This PR changes it so that the scheduler uses the new agent functionality introduced in buildkite/agent#2915 - core.Controller and core.JobController - to acquire and fail the job directly within the agent-stack-k8s controller.

Fixes #273