Skip to content
EgyKode
07 · PackagingLab 43 / 59
Guided labhelm

Managing EKS Cluster Add-ons with Helm & IRSA

Install the controllers a cluster needs to be useful, each with its own AWS identity instead of node credentials.

Time
39 min
Level
Intermediate
Objectives
4 objectives
Cost
Billable

Where this fits in the platform

Before you start

CostBillable

Cluster add-ons commonly provision real infrastructure — a load balancer, EBS volumes for persistent storage — that outlives `helm uninstall` if a finalizer fails.

How to clean up

The scenario#

The Load Balancer Controller works because someone attached its policy to the node role. Every Pod on every node now has permission to create and delete load balancers, and nothing in the cluster shows that.

Hands-on environment

Run it on AWS

This lab builds real cloud infrastructure, so it needs your own AWS account. Follow the cost and cleanup notes above — the resources are yours, and so is the bill.

Anything you tick here is your own record. EgyKode cannot see inside that terminal, so the success criteria stay self-assessed even when the environment checks your work for you.

The role, trusted by one ServiceAccount

Step 1 of 3

What you are building#

An empty EKS cluster cannot do much: it cannot provision a load balancer from an Ingress, cannot report CPU for an HPA, and cannot attach a volume. Those come from controllers you install — and the interesting part is how they get AWS permissions.

text
  Pod
   |  projected token: "I am system:serviceaccount:kube-system:alb-controller"
   v
  EKS OIDC provider  ->  AWS STS  ->  temporary credentials for ONE role

Without IRSA there are two options and both are bad: an access key in a Secret, which never rotates, or a policy on the node role, which grants it to every Pod on the node. IRSA gives one workload one role, with credentials that expire.


Build it#

Verify it worked#

Terminal
# The Pod has an identity of its own
kubectl exec -n kube-system deploy/aws-load-balancer-controller -- env | grep AWS_ROLE_ARN
kubectl exec -n kube-system deploy/aws-load-balancer-controller -- \
  ls /var/run/secrets/eks.amazonaws.com/serviceaccount/
 
# It IS that role, not the node role
kubectl run awscli --rm -it --image=amazon/aws-cli --restart=Never \
  -n kube-system --overrides='{"spec":{"serviceAccountName":"aws-load-balancer-controller"}}' \
  -- sts get-caller-identity
# Arn: .../alb-controller/botocore-session-...
 
# The negative test — a Pod WITHOUT the annotation
kubectl run awscli-plain --rm -it --image=amazon/aws-cli --restart=Never \
  -- sts get-caller-identity
# returns the NODE role — proves the scoping is real
 
# metrics-server actually serves metrics
kubectl top nodes
kubectl top pods -A | head
 
# The controller can do its job
kubectl logs -n kube-system deploy/aws-load-balancer-controller --tail=20

The negative test is the one that proves the point. Showing the controller works does not distinguish IRSA from a policy on the node role — showing that an unannotated Pod gets something different does.


Clean up#

DestructiveThis removes real resources. Check which environment you are in first.

Terminal
helm uninstall aws-load-balancer-controller metrics-server -n kube-system
terraform destroy -target=aws_iam_role.lbc

Cost of this lab: Low. IAM roles are free. The controllers run on nodes you are already paying for; anything they provision is not.

Success criteria

0 of 4

The concept behind it

Ready to try it without help?Do the challenge

Phase complete · 07 Packaging

You can now: The application installs from a versioned chart, upgrades safely, and rolls back in seconds.

Next phase

Lab 43 of 59 on the project path

08 · Continuous deliveryJenkins Fundamentals & Role-Based AccessRun Jenkins in a container, build a job from a webhook, and stop every authenticated user being an administrator.50 minBeginner

Previous: Helm Upgrades, Rollbacks & Release Strategy