Repository navigation
Closed
Labels
Description
What would you like added?
We're installing ARC on EKS cluster, then set up IRSA to grant permission to a service account.
We need a way to let job pod use the same service account as the runner pod, so that they have the same permission.
I saw this solution #798 , but it is no longer working due to Error: Volume mounts outside of the work folder are not supported
Why is this needed?
The runner will be used to build image then push to our private ECR registry. We were able to configure the runner pod to use the right service account with ECR push permission, but the workflow job pod that runs the actual job is using default service account that doesn't have ECR push permission.
Additional context
Manifests:
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: default
name: kubernetes-runner
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kubernetes-runner-role
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list", "create", "delete"]
- apiGroups: [""]
resources: ["pods/exec"]
verbs: ["get", "create"]
- apiGroups: [""]
resources: ["pods/log"]
verbs: ["get", "list", "watch",]
- apiGroups: ["batch"]
resources: ["jobs"]
verbs: ["get", "list", "create", "delete"]
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list", "create", "delete"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kubernetes-runner-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kubernetes-runner-role
subjects:
- kind: ServiceAccount
name: kubernetes-runner
namespace: default
---
apiVersion: actions.summerwind.dev/v1alpha1
kind: RunnerDeployment
metadata:
name: nonprivileged-runners
spec:
template:
spec:
securityContext:
# For Ubuntu 20.04 runner
fsGroup: 1000
containerMode: kubernetes
serviceAccountName: kubernetes-runner
workVolumeClaimTemplate:
storageClassName: "gp2"
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
labels:
- eks
- teamsvcs
- kaniko
repository: infra/runner-test
---
apiVersion: actions.summerwind.dev/v1alpha1
kind: HorizontalRunnerAutoscaler
metadata:
name: nonprivileged-runners-autoscaler
spec:
scaleTargetRef:
kind: RunnerDeployment
name: nonprivileged-runners
minReplicas: 1
maxReplicas: 10
metrics:
- type: TotalNumberOfQueuedAndInProgressWorkflowRuns
repositoryNames:
- infra/runner-test
Activity
github-actions commentedon Jul 19, 2023
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.
[-]Ability to use IRSA IAM role within a workflow job pod in Kubernetes mode[/-][+]Ability to use EKS IRSA IAM role within a workflow job pod in Kubernetes mode[/+][-]Ability to use EKS IRSA IAM role within a workflow job pod in Kubernetes mode[/-][+]Ability to share service account from runner pod to job pod in Kubernetes mode[/+]veronicatjan commentedon Jul 21, 2023
I'm able to achieve this goal by using this runner-container-hooks. actions/runner-container-hooks#50
gustoliv commentedon Aug 31, 2023
@veronicatjan could you give me an example of this configuration, please?
johnjeffers commentedon Oct 15, 2023
@veronicatjan can you please post an example of how you fixed this?
johnjeffers commentedon Oct 16, 2023
If anyone else comes across this thread looking for the solution, here you go: #2992 (comment)
igor9silva commentedon Jan 4, 2024
Thank you @johnjeffers!!!