actions-runner-controller icon indicating copy to clipboard operation
actions-runner-controller copied to clipboard

Decouple runner scale-set-name from k8s deployment name

Open timmjd opened this issue 1 year ago • 2 comments

Issue

The current implementation does not allow to create multiple runners with the same GitHub Runner Name from within the same Kubernetes Namespace. As an example, it's not possible to have multiple ubuntu-latest on different GitHub orgs that are all deployed within a single namespace foo.

Reason

This is due to the metadata.name of the AutoscalingRunnerSet is hard wired to the spec.runnerScaleSetName - so two runners with the same name would cause a namespace collision inside kubernetes.

Fix

This fix will allow to decoupled the kubernetes deployment name from the GitHub runner name. By this it will be possible to have a ubuntu-latest-foo and a ubuntu-latest-bar deployment inside the same k8s namespace that would both create a runner set named ubuntu-latest - both in different GitHub orgs like foo and bar.

Deployment foo

runnerScaleSetName: ubuntu-latest
deploymentName: ubuntu-latest-foo

Deployment bar

runnerScaleSetName: ubuntu-latest
deploymentName: ubuntu-latest-bar

timmjd avatar Oct 24 '23 10:10 timmjd

This would probable provide a workaround for the absence of #2445 & #2921 due to it will reduce the complexity of infrastructure setup.

timmjd avatar Oct 24 '23 11:10 timmjd

This would probable provide a workaround for the absence of #2445 & #2921 due to it will reduce the complexity of infrastructure setup.

I don't see how it would provide a workaround, can you please elaborate? Those issues are related to being unable to tell GHA that a job can be run on any of the runners from a list. That's what is normally achieved by using labels: e.g., you have arch-specific runners ubuntu-arm64, ubuntu-amd64 and assign a more general "ubuntu" label to them which will pick whatever of the runners having this label is available.

shapirus avatar Dec 07 '23 15:12 shapirus