actions-runner-controller/controllers
Yusuke Kuoka dbd7b486d2
feat: Support for scaling from/to zero (#465)
This is an attempt to support scaling from/to zero.

The basic idea is that we create a one-off "registration-only" runner pod on RunnerReplicaSet being scaled to zero, so that there is one "offline" runner, which enables GitHub Actions to queue jobs instead of discarding those.

GitHub Actions seems to immediately throw away the new job when there are no runners at all. Generally, having runners of any status, `busy`, `idle`, or `offline` would prevent GitHub actions from failing jobs. But retaining `busy` or `idle` runners means that we need to keep runner pods running, which conflicts with our desired to scale to/from zero, hence we retain `offline` runners.

In this change, I enhanced the runnerreplicaset controller to create a registration-only runner on very beginning of its reconciliation logic, only when a runnerreplicaset is scaled to zero. The runner controller creates the registration-only runner pod, waits for it to become "offline", and then removes the runner pod. The runner on GitHub stays `offline`, until the runner resource on K8s is deleted. As we remove the registration-only runner pod as soon as it registers, this doesn't block cluster-autoscaler.

Related to #447
2021-05-02 16:11:36 +09:00
..
metrics Add metrics of RunnerDeployment and HRA (#408) 2021-03-19 16:14:02 +09:00
testdata Fix panic on webhook for user-owned repository (#344) 2021-02-23 08:05:25 +09:00
autoscaling.go Do not delay min/maxReplicas propagation from HRA to RD due to caching (#406) 2021-03-19 12:58:02 +09:00
autoscaling_test.go Do not delay min/maxReplicas propagation from HRA to RD due to caching (#406) 2021-03-19 12:58:02 +09:00
horizontal_runner_autoscaler_webhook.go Make webhook-based autoscaler github event logs more operator-friendly (#384) 2021-03-10 09:40:44 +09:00
horizontal_runner_autoscaler_webhook_on_check_run.go Add CheckRun.Names scale-up trigger configuration (#390) 2021-03-14 10:21:42 +09:00
horizontal_runner_autoscaler_webhook_on_pull_request.go feat: HorizontalRunnerAutoscaler Webhook server (#282) 2021-02-07 17:37:27 +09:00
horizontal_runner_autoscaler_webhook_on_push.go feat: HorizontalRunnerAutoscaler Webhook server (#282) 2021-02-07 17:37:27 +09:00
horizontal_runner_autoscaler_webhook_test.go handle GET requests in webhook hra (#378) 2021-03-09 08:46:27 +09:00
horizontalrunnerautoscaler_controller.go Add metrics of RunnerDeployment and HRA (#408) 2021-03-19 16:14:02 +09:00
horizontalrunnerautoscaler_controller_test.go Fix HRA expired cache entries not cleaned up (#357) 2021-02-26 09:54:24 +09:00
integration_test.go feat: Support for scaling from/to zero (#465) 2021-05-02 16:11:36 +09:00
runner_controller.go feat: Support for scaling from/to zero (#465) 2021-05-02 16:11:36 +09:00
runnerdeployment_controller.go feat: Support for scaling from/to zero (#465) 2021-05-02 16:11:36 +09:00
runnerdeployment_controller_test.go Do include Runner controller in integration test (#409) 2021-03-19 16:14:15 +09:00
runnerreplicaset_controller.go feat: Support for scaling from/to zero (#465) 2021-05-02 16:11:36 +09:00
runnerreplicaset_controller_test.go feat: Support for scaling from/to zero (#465) 2021-05-02 16:11:36 +09:00
suite_test.go Do include Runner controller in integration test (#409) 2021-03-19 16:14:15 +09:00
utils.go feat: EKS IAM Roles for Service Accounts for Runner Pods (#226) 2020-12-08 17:56:06 +09:00
utils_test.go feat: EKS IAM Roles for Service Accounts for Runner Pods (#226) 2020-12-08 17:56:06 +09:00