DEV Community

John  Ajera
John Ajera

Posted on

Accessing Amazon EKS from a Jumphost using Access Entries

πŸ” How to Access Amazon EKS from a Jumphost (Modern Access Entries Method)

Amazon EKS Access Entries let you assign Kubernetes API permissions to IAM identities without modifying the legacy aws-auth ConfigMap. This guide shows how to set up a jumphost for kubectl access using read-only or admin-view permissions β€” the modern, secure, and auditable way.


πŸš€ Overview: What Needs to Be Done

Step Description
βœ… Install tools Make sure AWS CLI and kubectl are available
βœ… IAM setup Grant the jumphost's IAM role minimum required permissions
βœ… EKS Access Entry Attach Kubernetes-level access policies like AmazonEKSViewPolicy
βœ… Configure kubeconfig Use AWS CLI to connect kubectl to the cluster

πŸ“¦ Step 1: Install AWS CLI and kubectl

βœ… AWS CLI

  • Pre-installed on Amazon Linux 2 and Amazon Linux 2023
  • AWS CLI v2 is required for aws eks update-kubeconfig
  • For others: Install AWS CLI
aws --version
Enter fullscreen mode Exit fullscreen mode

βœ… kubectl

kubectl version --client
Enter fullscreen mode Exit fullscreen mode

πŸ” Step 2: IAM Policy for Jumphost Role

The jumphost typically assumes an IAM role automatically if it's an EC2 instance using an instance profile. For non-EC2 environments, the IAM role can be assumed via aws sts assume-role or temporary credentials.

The following permissions allow the role to fetch cluster metadata and authenticate:

data "aws_iam_role" "jumphost" {
  name = var.jumphost_role_name
}

data "aws_region" "current" {}

data "aws_caller_identity" "current" {}

resource "aws_iam_policy" "eks_describe_cluster" {
  name = "EKSDescribeCluster"
  policy = jsonencode({
    Version = "2012-10-17",
    Statement = [
      {
        Sid    = "DescribeClusterAccess",
        Effect = "Allow",
        Action = ["eks:DescribeCluster"],
        Resource = "arn:aws:eks:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:cluster/${var.cluster_name}"
      },
      {
        Sid    = "ListAssociatedAccessPolicies",
        Effect = "Allow",
        Action = ["eks:ListAssociatedAccessPolicies"],
        Resource = "*"
      }
    ]
  })
}

resource "aws_iam_role_policy_attachment" "jumphost_describe_cluster" {
  role       = data.aws_iam_role.jumphost.name
  policy_arn = aws_iam_policy.eks_describe_cluster.arn
}
Enter fullscreen mode Exit fullscreen mode

This is required to use aws eks update-kubeconfig and mandatory when using access policies like AmazonEKSAdminViewPolicy.


πŸ”§ Step 3: Grant EKS Access via Terraform

EKS Access Entries work without the legacy aws-auth ConfigMap. You no longer need to manage Kubernetes RBAC manually β€” AWS manages it through access policies.

Use EKS Access Entries and associate them with AWS-managed access policies:

resource "aws_eks_access_entry" "jumphost" {
  cluster_name  = var.eks_cluster_name
  principal_arn = "arn:aws:iam::${var.account_id}:role/${var.jumphost_role_name}"
}

resource "aws_eks_access_policy_association" "view" {
  cluster_name  = var.eks_cluster_name
  principal_arn = aws_eks_access_entry.jumphost.principal_arn
  policy_arn    = "arn:aws:eks::aws:cluster-access-policy/AmazonEKSViewPolicy"
}

resource "aws_eks_access_policy_association" "admin_view" {
  cluster_name  = var.eks_cluster_name
  principal_arn = aws_eks_access_entry.jumphost.principal_arn
  policy_arn    = "arn:aws:eks::aws:cluster-access-policy/AmazonEKSAdminViewPolicy"
}
Enter fullscreen mode Exit fullscreen mode

You need both the EKS access policy and the IAM permissions to make this work.


πŸ§ͺ Step 4: Verify Access from the Jumphost

πŸ” 1. Check access association

aws eks list-associated-access-policies \
  --cluster-name <cluster-name> \
  --principal-arn arn:aws:iam::<account-id>:role/<jumphost-role>
Enter fullscreen mode Exit fullscreen mode

You should see AmazonEKSViewPolicy or AmazonEKSAdminViewPolicy.

πŸ”§ 2. Update kubeconfig

aws eks update-kubeconfig --region <region> --name <cluster-name>
Enter fullscreen mode Exit fullscreen mode

βœ… 3. Test read-only kubectl access

kubectl get nodes
kubectl get pods -A
kubectl get svc -A
kubectl get events -A
kubectl get deployments -A
Enter fullscreen mode Exit fullscreen mode

βœ… Summary

  • πŸ›  Tools: AWS CLI + kubectl installed
  • πŸ” IAM Permissions: eks:DescribeCluster, eks:ListAssociatedAccessPolicies
  • πŸ“œ EKS Access Entries: Associated with AmazonEKSViewPolicy or AmazonEKSAdminViewPolicy
  • βš™οΈ Tested: Via aws eks update-kubeconfig + kubectl get commands

This approach is clean, auditable, and fully compatible with Terraform. Ditch the manual aws-auth edits β€” use EKS Access Entries instead. βœ…

Heroku

Built for developers, by developers.

Whether you're building a simple prototype or a business-critical product, Heroku's fully-managed platform gives you the simplest path to delivering apps quickly β€” using the tools and languages you already love!

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

πŸ‘‹ Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay