redhat-actions / openshift-actions-runner-installer

GitHub Action to detect and create a self-hosted runner in Kubernetes.
MIT License
25 stars 14 forks source link

Autoscaling #11

Open fnmarquez opened 2 years ago

fnmarquez commented 2 years ago

Is it possible to autoscale runners on demand? (not manually from the workflow)

tetchel commented 2 years ago

There is no auto-scaling feature at this time.

Something you can do is patch the deployment as needed. Depending on your needs you could do something like scale it up or down during certain times of day (using a cron workflow) or maybe at the beginning/end of a workflow run.

You can patch the replicas count as follows:

$ oc patch deployment actions-runner-1627686781  -p '{ "spec": { "replicas": 2 } }'
deployment.apps/actions-runner-1627686781 patched
$ oc get deploy
NAME                        READY   UP-TO-DATE   AVAILABLE   AGE
actions-runner-1627686781   1/2     2            1           3m37s

The deployment name is the same as the Helm release name, or you can do:

oc get deploy -l=app.kubernetes.io/instance=$RELEASE_NAME