Add KEDA scaledObject option
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
What does this MR do?
This MR adds the possibility of using a KEDA scaledObject for runners autoscaling.
The new template is based on https://keda.sh/docs/2.17/reference/scaledobject-spec/
Why was this MR needed?
KEDA scaledObject is more powerful than HPA : https://keda.sh/docs/2.17/scalers/
For example we can autoscale with kubernetes-workload scaler :
- our runner gitlab-runner-x has 100 concurrent jobs configured
- we deploy it with 1 minReplica
- when we have 90 executor pods with label 'managed-by-runner=gitlab-runner-x', we want to scale to authorize more jobs by adding one runner replica
- if we have 5 maxReplicas configured, it will scale again by adding one runner replica when we'll have 180, then 270, and then 360 executor pods
What's the best way to test this MR?
gitlab-runner(keda-scaled-object)$ helm unittest .
### Chart [ gitlab-runner ] .
PASS test deployment tests/deployment_test.yaml
PASS test ingress session tests/ingress-session_test.yaml
PASS test role and role-binding tests/rbac_test.yaml
PASS test scaled-object tests/scaled-object_test.yaml
PASS test service-account tests/service-account_test.yaml
Charts: 1 passed, 1 total
Test Suites: 5 passed, 5 total
Tests: 39 passed, 39 total
Snapshot: 2 passed, 2 total
Time: 9.858005817s
What are the relevant issue numbers?
Edited by Geoffrey McQuat