The request hit our dashboard at 3:17 a.m. A Kubernetes cluster needed an Ingress to securely serve application endpoints, while pulling data from AWS S3 with strict read-only access. No write. No accidental overwrites. Zero breach surface.
To make this work, you need to combine Kubernetes Ingress configuration with AWS IAM roles that enforce S3 read-only permissions. The goal is precise: deliver content from S3 through your services without exposing credentials or opening dangerous write paths.
Step 1: Define the IAM Role
Create a role in AWS with the AmazonS3ReadOnlyAccess managed policy. For tighter control, attach a custom policy specifying only the required bucket and object actions:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::your-bucket-name",
"arn:aws:s3:::your-bucket-name/*"
]
}
]
}
Step 2: Connect Kubernetes to AWS via IRSA
If you run on EKS, configure IAM Roles for Service Accounts (IRSA). Annotate the service account used by the pod accessing S3 with the role ARN. This ties the AWS read-only permissions directly to workloads in the cluster, without embedding AWS keys in environment variables or secrets.