Amazon EKS cluster access
Before you create an Amazon EKS compute environment, give the Kubernetes service account access to S3 for Fusion, and give the IAM role or user in your Amazon EKS credentials access to the cluster.
Configure EKS service account IAM role for Fusion v2
To use Fusion v2 in your Amazon EKS compute environment, use an AWS S3 bucket as the work directory. Both the head and compute service accounts (if separate) must have access to that bucket.
If you plan to use legacy storage instead of Fusion, skip this section.
-
Create an IAM role with the following permissions:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::<YOUR-BUCKET>"
]
},
{
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:PutObjectTagging",
"s3:DeleteObject"
],
"Resource": [
"arn:aws:s3:::<YOUR-BUCKET>/*"
],
"Effect": "Allow"
}
]
}Replace
<YOUR-BUCKET>with the name of the bucket used as the work directory. -
Add a trust relationship between the IAM role and the Kubernetes service account (or accounts) that Seqera uses to manage the EKS cluster (
tower-launcher-sain the default configuration):{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Federated": "arn:aws:iam::<YOUR-ACCOUNT-ID>:oidc-provider/oidc.eks.<YOUR-REGION>.amazonaws.com/id/<YOUR-CLUSTER-ID>"
},
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": {
"StringEquals": {
"oidc.eks.<YOUR-REGION>.amazonaws.com/id/<YOUR-CLUSTER-ID>:aud": "sts.amazonaws.com",
"oidc.eks.<YOUR-REGION>.amazonaws.com/id/<YOUR-CLUSTER-ID>:sub": "system:serviceaccount:<YOUR-EKS-NAMESPACE>:<YOUR-EKS-SERVICE-ACCOUNT>"
}
}
}
]
}Replace
<YOUR-ACCOUNT-ID>,<YOUR-REGION>,<YOUR-CLUSTER-ID>,<YOUR-EKS-NAMESPACE>, and<YOUR-EKS-SERVICE-ACCOUNT>with the corresponding values. -
Annotate the Kubernetes service account with the IAM role:
kubectl annotate serviceaccount <YOUR-EKS-SERVICE-ACCOUNT> --namespace <YOUR-EKS-NAMESPACE> eks.amazonaws.com/role-arn=arn:aws:iam::<YOUR-ACCOUNT-ID>:role/<YOUR-IAM-ROLE>Replace
<YOUR-EKS-SERVICE-ACCOUNT>(by defaulttower-launcher-sa, as created in the cluster preparation guide),<YOUR-EKS-NAMESPACE>, and<YOUR-IAM-ROLE>with the corresponding values defined earlier.
Pods that use that service account can then assume the IAM role and access the S3 bucket specified as the work directory. See the AWS documentation for further details.
Allow an IAM user or role access to EKS
Configure the EKS cluster to allow the IAM user (or the IAM role it assumes) to access the cluster and manage pods.
-
In the AWS IAM console, get the ARN of the IAM user or IAM role in your Amazon EKS credentials.
noteYou use the AWS credentials for the IAM user in the Seqera compute environment configuration.
-
Edit the EKS
aws-authConfigMap to allow the IAM user to access the cluster and manage pods. This step may require cluster administrator privileges:kubectl edit configmap -n kube-system aws-auth -
In the editor that opens, add the following entry to the
mapUserssection. Replace<AWS-IAM-USER-ARN>with the user ARN from the AWS IAM console:mapUsers: |
- userarn: <AWS-IAM-USER-ARN>
username: tower-launcher-user
groups:
- tower-launcher-roleAlternatively, allow an IAM role to authenticate to the cluster. In this case, specify the role ARN in the Assume role field when you add the Amazon EKS credentials in Seqera. The role must have a trust relationship with the Seqera IAM user. Add the role
<AWS-IAM-ROLE-ARN>to themapRolessection of the EKS auth configuration instead:mapRoles: |
- rolearn: <AWS-IAM-ROLE-ARN>
username: tower-launcher-role
groups:
- tower-launcher-roleSee the AWS documentation for more details on modifying the
aws-authConfigMap of an EKS cluster.