Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kubernetes Mode Service Account doesn't propagate down to workers and provides default service account #3745

Open
4 tasks done
Hchanni opened this issue Sep 13, 2024 · 3 comments
Labels
bug Something isn't working gha-runner-scale-set Related to the gha-runner-scale-set mode needs triage Requires review from the maintainers

Comments

@Hchanni
Copy link

Hchanni commented Sep 13, 2024

Checks

Controller Version

0.9.3

Deployment Method

Helm

Checks

  • This isn't a question or user support case (For Q&A and community support, go to Discussions).
  • I've read the Changelog before submitting this issue and I'm sure it's not due to any recently-introduced backward-incompatible changes

To Reproduce

Spin up your basic quick start workflow, you'll see the runner has a service account, but the workers with the suffix "workflow" are given the default service account.

Describe the bug

We're running into severe permissions issues on our workflows because there is no way to provide the workers with the same service account as our scale-set.

Describe the expected behavior

I would expect the expected behaviour to be that there should be some way to add an option where you can choose to mimic the service account if need be. This complicates things greatly as we do not want to add the IRSA that is used for the runners as the default SA.

Additional Context

N/A

Controller Logs

N/A

Runner Pod Logs

N/A
@Hchanni Hchanni added bug Something isn't working gha-runner-scale-set Related to the gha-runner-scale-set mode needs triage Requires review from the maintainers labels Sep 13, 2024
@Hchanni Hchanni changed the title Kubernetes Mode Service Account doesn't propagate down to workers and provides it default Kubernetes Mode Service Account doesn't propagate down to workers and provides default service account Sep 13, 2024
Copy link
Contributor

Hello! Thank you for filing an issue.

The maintainers will triage your issue shortly.

In the meantime, please take a look at the troubleshooting guide for bug reports.

If this is a feature request, please review our contribution guidelines.

@marccortinas
Copy link

Hello! We really appreciate if you could fix this issue. I'm in the same scenario, let me share an screenshoot....
ServiceAccountNotPropagated

@marcopalmisano
Copy link

marcopalmisano commented Oct 31, 2024

Hi team :)
We found a workaround for this issue by populating the ACTIONS_RUNNER_CONTAINER_HOOK_TEMPLATE env variable, but we're gonna open a pull request next week to the hooks repository in order to make this automatic! 🚀

@Hchanni what you need to do is pointing the ACTIONS_RUNNER_CONTAINER_HOOK_TEMPLATE variable to a .yaml file that contains the "extras" you need to inject into the -workflow container.

You could put that in a ConfigMap, and mount it in a file in your RunnerScaleSet config.

--- # runnerset-cm.yaml
kind: ConfigMap
apiVersion: v1
metadata:
  name: our-runnerset-additional-config
data:
  override.yaml: |
    spec:
      serviceAccountName: our-runnerset-serviceaccount-name
# runnerset.yaml
...
env:
 - name: ACTIONS_RUNNER_CONTAINER_HOOK_TEMPLATE
    value: /home/runner/k8s/additionalPodTemplate.yaml
volumeMounts:
 - name: pod-additional-config
   mountPath: /home/runner/k8s/additionalPodTemplate.yaml
volumes:
 - name: pod-additional-config
   configMap:
     name: our-runnerset-additional-config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gha-runner-scale-set Related to the gha-runner-scale-set mode needs triage Requires review from the maintainers
Projects
None yet
Development

No branches or pull requests

3 participants