actions-runner-controller: Runner Pod can't start up with ServiceAccount on EKS 1.15.10
I tried to deploy a runner with IAM Role for ServiceAccount (IRSA) in EKS 1.15.10, but the runner pod can’t start up at all:
kubectl get pod
NAME READY STATUS RESTARTS AGE
my-runner-lmzjc-znh8c 0/1 Terminating 0 10s
the manifest i used:
apiVersion: v1
kind: ServiceAccount
metadata:
name: actions-runner-system-sa
namespace: actions-runner-system
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::<AWS_ACCOUNT_ID>:role/<IAM_ROLE>
---
apiVersion: actions.summerwind.dev/v1alpha1
kind: RunnerDeployment
metadata:
name: my-runner
namespace: actions-runner-system
spec:
replicas: 1
template:
spec:
repository: example/repo
serviceAccountName: actions-runner-system-sa
automountServiceAccountToken: true
containers:
- name: runner
image: example/action-runner:latest
imagePullPolicy: Always
look into the event, i saw:
2s Warning FailedMount pod/my-runner-zsvsd-vfdpz Unable to mount volumes for pod "my-runner-zsvsd-vfdpz_actions-runner-system(1b78d4fb-25e6-4457-bd47-04ea06ae7d14)": timeout expired waiting for volumes to attach or mount for pod "actions-runner-system"/"my-runner-zsvsd-vfdpz". list of unmounted volumes=[aws-iam-token actions-runner-system-sa-token-8gmq9]. list of unattached volumes=[aws-iam-token actions-runner-system-sa-token-8gmq9]
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 17 (7 by maintainers)
Commits related to this issue
- Setup a wrapper class that can generate multiple Actions Service clients (#16) — committed to actions/actions-runner-controller by cory-miller 2 years ago
We already have the documentation for this at https://github.com/summerwind/actions-runner-controller#using-eks-iam-role-for-service-accounts so it should be straightforward today. Closing as resolved!
No without the annotation I was not able to get IAM working with IAM. I needed to include:
envs
,volumeMounts
andvolume
that the annotation automatically injects. The apps manager seemed to kill the pod if you let the annotation do this, I pressume because it fails some sort of validation?My final yaml (with aws account id’s replaced with $AWS_ACCOUNT_ID)
After that it was just normal the AWS assume role setup.
I think it’s related to EKS IRSA. It works for me when I remove the annotation
eks.amazonaws.com/role-arn: arn:aws:iam::<AWS_ACCOUNT_ID>:role/<IAM_ROLE>
.But with that annotation present, the controller keeps looping creating and destroying the runner pod.
EKS IRSA introduces envvars and volumes automatically in the pod:
Maybe those collide with some validation at the controller.
I’ve checked the pod definitions when using EKS IRSA and they’re fine. It’s the controller who destroys the pod.
I tested this on vanilla Kubernetes setup and service account was mounted to Runner Container without any issues.