• DevOps
    Case Study

    How we built a resilient multi-account, multi-cloud solution for a Health Tech service provider!

    READ CASESTUDY
    icon

    24/7 DevOps as a Service

    Round-the-clock DevOps for uninterrupted efficiency.

    icon

    Infrastructure as a Code

    Crafting infrastructure with ingenious code.

    icon

    CI/CD Pipeline

    Automated CI/CD pipeline for seamless deployments.

    icon

    DevSecOps

    Integrated security in continuous DevOps practices.

    icon

    Hire DevOps Engineers

    Level up your team with DevOps visionaries.

    icon

    Consulting Services

    Navigate success with expert DevOps consulting.

  • TechOps
    Case Study

    How we built a scalable Odoo solution for a Travel Tech service provider!

    READ CASESTUDY

    WEB HOSTING SUPPORT

    icon

    HelpDesk Support

    Highly skilled 24/7 HelpDesk Support

    icon

    Product Support

    Boost your product support with our expertise.

    MANAGED SERVICES

    icon

    Server Management

    Don’t let server issues slow you down. Let us manage them for you.

    icon

    Server Monitoring

    Safeguard your server health with our comprehensive monitoring solutions.

    STAFF AUGMENTATION

    icon

    Hire an Admin

    Transform your business operations with our expert administrative support.

    icon

    Hire a Team

    Augment your workforce with highly skilled professionals from our diverse talent pool.

  • CloudOps
    Case Study

    How we helped a Private Deemed University in India, save US $3500/m on hosting charges!

    READ CASESTUDY
    icon

    AWS Well Architected Review

    Round-the-clock for uninterrupted efficiency

    icon

    Optimize

    Efficient CloudOps mastery for seamless cloud management

    icon

    Manage

    Automated CI/CD pipeline for seamless deployments

    icon

    Migrate

    Upgrade the journey, Migrate & Modernize seamlessly

    icon

    Modernize

    Simplify compliance complexities with our dedicated services

    icon

    FinOps as a Service

    FinOps as a Service

  • SecOps
    Case Study

    How we built a scalable Odoo solution for TravelTech service provider!

    READ CASESTUDY
    icon

    VAPT

    Vulnerability Assessment and Penetration Testing

    icon

    Source Code Review

    Ensuring source code security ans safe practices to reduce risks

    icon

    Security Consultation

    On demand services for improving server security

    icon

    System Hardening

    Reduced vulnerability and proactive protection

    icon

    Managed SoC

    Monitors and maintains system security. Quick response on incidents.

    icon

    Compliance as a Service

    Regulatory compliance, reduced risk

  • Insights
    Case Study

    How we helped a Private Deemed University in India, save US $3,500/m on hosting charges!

    READ CASESTUDY
    icon

    Blog

    Explore our latest articles and insights

    icon

    Case Studies

    Read about our client success stories

    icon

    Flipbook

    Explore our latest Flipbook

    icon

    Events

    Join us at upcoming events and conferences

    icon

    Webinars

    Watch our educational webinar series

  • Our Story
  • Contact Us

Interested to collaborate?

Get in touch with us!

Ready to elevate your business with certified cloud expertise? Contact us today to learn how our team can help you leverage cloud technology to drive growth, streamline operations, and enhance security.

  • AWSAWS
  • Azure CloudAzure Cloud
  • Google CloudGoogle Cloud
  • Akamai CloudAkamai Cloud
  • OVHOVH
  • Digital OceanDigital Ocean
  • HetznerHetzner
  • Kubernetes Consultancy Services
  • K8s & Cloud native Solutions
  • 24/7 Infrastructure Monitoring
  • DevOps as a Service
  • Cloud CI/CD Solutions
  • White Labeled MSP Support
  • Our story
  • Life@SupportSages
  • Insights
  • Careers
  • Events
  • Contact Us

Connect with us!


LinkedInFacebookXInstagramYouTube

aws partneraws advanced partner
SupportSages

Copyright © 2008 – 2026 SupportSages Pvt Ltd. All Rights Reserved.
Privacy PolicyLegal TermsData ProtectionCookie Policy
Simplifying Container Image Pulling in Amazon EKS: IAM Role for Pods

Simplifying Container Image Pulling in Amazon EKS: IAM Role for Pods

Tom Sebastian

  • 3 min read
Simplifying Container Image Pulling in Amazon EKS: IAM Role for Pods

Generating audio, please wait...

Amazon Elastic Kubernetes Service (EKS) is a powerful managed Kubernetes service that simplifies container management. When working with EKS, securely pulling container images is crucial, and this often involves AWS credentials. However, you can streamline this process by leveraging IAM roles for your Kubernetes pods, eliminating the need to manage AWS credentials directly.

In this guide, we’ll walk you through the steps to set up IAM roles for pods in Amazon EKS, allowing your pods to pull container images without the hassle of AWS credentials.

Prerequisites

Before we begin, make sure you have the following:

  1. An existing Amazon EKS cluster.
  2. An Amazon Elastic Container Registry (ECR) repository with the container image you want to use.

Step 1: Create an IAM Role for Service Accounts (IRSA)

Start by creating an IAM role that your pods can assume. This role should grant the necessary permissions to access the ECR repository. Here’s how to create it:

aws iam create-role \
--role-name my-ecr-access-role \
--assume-role-policy-document file://eks-trust-policy.json

Create a eks-trust-policy.json file with the following content:

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "eks.amazonaws.com"
},
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": {
"StringEquals": {
"sts:ExternalId": "eks-cluster-id"
}
}
}
]
}

Replace "eks-cluster-id" with the actual ID or name of your EKS cluster. This policy allows the EKS service to assume the IAM role with the specified external ID, enhancing security.

Step 2: Associate the IAM Role with a Kubernetes Service Account

Next, you need to associate the IAM role you created with a Kubernetes service account. This step is crucial for binding your IAM role to your Kubernetes pods. Annotate your service account as follows:

apiVersion: v1
kind: ServiceAccount
metadata:
name: my-app-service-account
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::123456789012:role/my-ecr-access-role

Step 3: Create a Kubernetes Deployment or Pod

Now that your service account is associated with the IAM role, create a Kubernetes deployment or pod that references this service account:

apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app-deployment
spec:
replicas: 2
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
serviceAccountName: my-app-service-account # Reference the service account here
containers:
- name: my-app-container
image: <your-ecr-image-uri>

Replace <your-ecr-image-uri> with the URI of the container image in your ECR repository.

Step 4: Pod IAM Roles and Policies

Ensure that your IAM role (my-ecr-access-role) has the necessary permissions to pull images from the ECR repository. Attach policies like AmazonEC2ContainerRegistryReadOnly to grant the required permissions.

Step 5: Deploy the Kubernetes Resources

Apply the Kubernetes YAML files to create the deployment and service account. The pods spawned by the deployment will automatically assume the IAM role associated with the service account.

With these steps completed, your EKS pods can effortlessly pull container images from ECR without managing AWS credentials directly. This approach enhances security and simplifies your Kubernetes cluster management.

In conclusion, leveraging IAM roles for pods in Amazon EKS enhances your container image pulling process, reducing the complexity of managing AWS credentials. This is particularly valuable for security-conscious and streamlined DevOps practices in Kubernetes deployments.

Explore AWS-backed automated image pulling on EKS and empower your containerized applications. Ideal for AWS enthusiasts and DevOps professionals, this guide simplifies complex configurations, ensuring secure image access and enhancing your deployment efficiency. Unleash the full potential of your EKS cluster — seamless, efficient, and secure container management awaits!


Happy deploying on Amazon EKS!

  • AWS
  • DevOps

Continue Your Journey With…

DevOps as a Service

DevOps as a Service

Let us do the heavy lifting for you

Promotional banner
Promotional banner

Troubleshooting AWS EC2 Launch Failures: How EBS Encryption Can Impact Your EKS Node Group

Troubleshooting AWS EC2 Launch Failures: How EBS Encryption Can Impact Your EKS Node Group
  • AWS
  • DevOps
logo

Posts by Tom Sebastian