AWS EKS: From Absolute Beginner to Expert
This guide assumes you know nothing about containers, Kubernetes, or EKS. Each tab builds on the one before it. By the end you will be able to build an EKS cluster, store images in ECR, deploy apps, add the common add-ons, patch nodes, and upgrade a cluster safely.
Containers, Kubernetes, what EKS is
Tools, create a cluster, console tour
Compute, ECR, deploy, networking, storage
Security, add-ons, monitoring, patching
Upgrades, Auto Mode, troubleshooting
How to use this tutorial
๐ Levels, lessons & parts
Pick a level in the top row, then a lesson in the second row. Each lesson is split into short numbered parts. The Next โ button at the bottom always tells you where it goes next.โ Progress
Parts you have visited get a green number. A lesson is marked complete when you finish its last part, or when you click Mark complete. The bar at the top shows your overall progress.๐ฅ๏ธ Terminals
Black boxes are command windows. Lines starting with$ are commands you type. Grey lines are what the computer prints back. Use Copy to copy commands.โถ๏ธ Walkthroughs
Some terminals have a โถ Run step button. Click it to see each numbered step: the command, its output and what it means. Prefer to read it all at once? Click Show all steps.๐ฑ๏ธ Diagrams
Click parts of the diagrams to learn what each piece does.โ Review & quiz
The last part of each lesson has the key takeaways and a short quiz. Click an answer to check yourself.111122223333) and names (demo) are placeholders โ swap in your own.Containers 101
The problem containers solve
An app is more than its code. It also needs the right language version, libraries, and settings. When you move an app from your laptop to a server, something is often missing, and the app breaks. People call this the "it works on my machine" problem.
Three words to know
๐ Dockerfile
A recipe. A text file with step-by-step instructions to build your app's package.๐ฆ Image
The packed lunchbox, sealed and ready. Built from the Dockerfile. It never changes once built. It has a name and a tag (a version label like1.0).๐ Container
A running copy of an image. You can run many containers from one image, like printing many copies of one photo.A tiny example
# Start from a small official image that already has a web server FROM public.ecr.aws/nginx/nginx:stable-alpine # Copy our web page into the place nginx serves files from COPY index.html /usr/share/nginx/html/index.html # Tell people this container listens on port 80 EXPOSE 80
docker build -t hello-app:1.0 . [+] Building 3.1s (7/7) FINISHED => [1/2] FROM public.ecr.aws/nginx/nginx:stable-alpine => [2/2] COPY index.html /usr/share/nginx/html/index.html => naming to docker.io/library/hello-app:1.0
.) and built an image named hello-app with tag 1.0.docker images hello-app REPOSITORY TAG IMAGE ID CREATED SIZE hello-app 1.0 3f2a9c1d7b44 10 seconds ago 48MB
docker run -d -p 8080:80 --name web hello-app:1.0 a81c0f3b2e6d9c5e1f7a...
-d runs it in the background. -p 8080:80 connects port 8080 on your laptop to port 80 inside the container. Open http://localhost:8080 to see your page.docker ps CONTAINER ID IMAGE STATUS PORTS NAMES a81c0f3b2e6d hello-app:1.0 Up 5 seconds 0.0.0.0:8080->80/tcp web
docker ps lists running containers. Ours is "Up". Stop it with docker rm -f web.Why one container is not enough
Running one container on one laptop is easy. Real apps need many containers on many servers. Someone must decide where each container runs, restart it if it crashes, add more when traffic grows, and connect them to the internet. Doing this by hand is impossible at scale. That job is called orchestration, and Kubernetes is the most popular tool for it. That is the next tab.
Key takeaways
- A container packs your app with everything it needs.
- An image is the sealed package; a container is a running copy of it.
- Images are stored in a registry. On AWS, that is Amazon ECR.
- Kubernetes manages lots of containers across lots of servers.
Kubernetes 101
The building blocks
| Word | Simple meaning | Restaurant version |
|---|---|---|
| Cluster | The whole Kubernetes system: a brain plus the servers it controls. | The whole restaurant chain |
| Control plane | The brain. It stores what you asked for and makes decisions. | The head office |
| Node | One server (computer) that runs your containers. On AWS, usually an EC2 instance. | One kitchen |
| Pod | The smallest thing Kubernetes runs. A wrapper around one (sometimes more) containers. Each pod gets its own IP address. | One cook |
| Deployment | Says "run N copies of this pod, and update them safely." | "Always keep 3 pizza cooks" |
| ReplicaSet | Created by a Deployment. Makes sure the right number of pods exist. | The shift supervisor |
| Service | A stable name and address in front of a group of pods. Pods come and go; the Service stays. | The restaurant's phone number |
| Ingress | Rules for sending web traffic from the internet to Services (by website path or domain name). | The front-door host |
| Namespace | A folder to group things, like dev and prod. | Separate floors of the building |
| ConfigMap / Secret | Settings / passwords given to pods. | The recipe card / the safe code |
| DaemonSet | Runs exactly one pod on every node (good for log or monitoring agents). | One cleaner in every kitchen |
| PersistentVolume (PV) / Claim (PVC) | Disk storage that survives when a pod restarts. | A storage locker |
Desired state: the big idea
You write a file (in a format called YAML) that describes what you want. You send it to the cluster with a tool called kubectl. Kubernetes keeps comparing "what you asked for" with "what is really running" and fixes any difference. This is called the reconcile loop.
"3 copies of my app"
wanted vs. real
start/stop pods
Your first YAML, line by line
apiVersion: apps/v1 # which Kubernetes API "type family" this belongs to kind: Deployment # what we are creating metadata: name: hello # its name spec: replicas: 3 # I want 3 copies (pods) selector: matchLabels: { app: hello } # manage pods that have the label app=hello template: # the pod "cookie cutter" metadata: labels: { app: hello } # stamp this label on every pod spec: containers: - name: web image: public.ecr.aws/nginx/nginx:stable-alpine # which image to run ports: - containerPort: 80
๐ฎ Interactive: scaling simulator
Move the slider to change how many pod copies (replicas) you want. Each node here fits 4 pods. Turn the autoscaler on and off to see what happens when nodes are full.
Two kinds of scaling
Pod scaling (more copies)
The Horizontal Pod Autoscaler (HPA) adds or removes pods based on CPU or memory use. It needs the Metrics Server add-on.Node scaling (more servers)
When pods have nowhere to fit, they are Pending. A node autoscaler (Karpenter, Cluster Autoscaler, or EKS Auto Mode) adds servers, and removes empty ones later.Key takeaways
- You describe the desired state in YAML; Kubernetes makes it real and keeps it real.
- Pods run on nodes. Deployments keep the right number of pods. Services give them a stable address.
- Pod scaling and node scaling are different jobs done by different tools.
What is Amazon EKS?
Amazon EKS (Elastic Kubernetes Service) is Kubernetes run by AWS. Running the Kubernetes "brain" (control plane) yourself is hard: it must be backed up, patched, and kept highly available. With EKS, AWS runs the brain for you across several data centers. You focus on your apps and (unless you use Auto Mode) your worker nodes.
๐ฑ๏ธ Interactive architecture diagram
Click any box to learn what it is.
Who does what? (shared responsibility)
Pick a tab to see who looks after each layer of an EKS cluster. Orange layers are run by AWS, blue layers are yours, and yellow layers are shared. The dashed line marks where AWS's job ends and yours begins. The table below the diagram lists the same thing.
| Task | Standard EKS | EKS Auto Mode |
|---|---|---|
| Run, patch, and back up the control plane | AWS | AWS |
| Choose, launch, and scale worker nodes | You (with tools) | AWS |
| Patch the node operating system | You (replace AMIs) | AWS |
| Install/upgrade core add-ons (networking, DNS, storage driver, LB controller) | You | AWS (built in) |
| Upgrade Kubernetes version | You start it | You start it (nodes follow) |
| Your apps, images, YAML, IAM permissions, data | You | You |
What does it cost?
- Control plane: $0.10 per cluster per hour while the version is in standard support; $0.60 per cluster per hour in extended support (about $73/month vs. $438/month).
- Worker nodes: normal EC2 prices (or Fargate prices).
- Auto Mode: an extra management fee per instance it manages, on top of the EC2 price. EC2 discounts (Savings Plans, Spot) do not reduce this fee.
- Other: load balancers, EBS disks, NAT gateways, data transfer, CloudWatch logs.
Kubernetes versions on EKS
Kubernetes ships a new minor version (like 1.36 โ 1.37) about every four months. On EKS, each version gets 14 months of standard support, then 12 months of extended support (at the higher price). After that, AWS upgrades the control plane for you automatically.
| Version | EKS release | End of standard support | End of extended support |
|---|---|---|---|
| 1.37 | Oct 1, 2026 | Dec 1, 2027 | Dec 1, 2028 |
| 1.36 | Jun 2, 2026 | Aug 2, 2027 | Aug 2, 2028 |
| 1.35 | Jan 27, 2026 | Mar 27, 2027 | Mar 27, 2028 |
| 1.34 | Oct 2, 2025 | Dec 2, 2026 | Dec 2, 2027 |
| 1.33 | May 29, 2025 | Jul 29, 2026 (now extended) | Jul 29, 2027 |
| 1.32 | Jan 23, 2025 | Mar 23, 2026 (now extended) | Mar 23, 2027 |
| 1.31 | Sep 26, 2024 | Nov 26, 2025 (now extended) | Nov 26, 2026 |
aws eks describe-cluster-versions.There is also a platform version (like eks.12). AWS bumps this automatically for small fixes and security patches to the control plane. You do not need to do anything for it.
Key takeaways
- EKS = Kubernetes where AWS runs the brain.
- Your nodes and pods live in your VPC, spread across Availability Zones.
- Stay on a version in standard support to save money and stay safe.
Tools & Setup
โ๏ธ AWS CLI (aws)
Talks to AWS services. Creates clusters, ECR repos, IAM roles, add-ons.โธ๏ธ kubectl
Talks to Kubernetes inside your cluster. Creates pods, services, and reads logs. Use a version within one minor version of your cluster.๐ ๏ธ eksctl
A helper that builds a full EKS cluster (VPC, roles, nodes) with one command. Made with AWS for EKS.โต Helm
A "package manager" for Kubernetes. Installs apps like the AWS Load Balancer Controller from a "chart."Also install Docker (or another container builder like Finch or Podman) to build images.
Install (Linux / macOS examples)
# --- AWS CLI v2 (Linux x86_64) --- curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o awscliv2.zip unzip awscliv2.zip && sudo ./aws/install # macOS (Homebrew) alternative: brew install awscli kubectl eksctl helm # --- kubectl (match your cluster's minor version) --- curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" sudo install -m 0755 kubectl /usr/local/bin/kubectl # --- eksctl --- curl -sLO "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" tar -xzf eksctl_$(uname -s)_amd64.tar.gz -C /tmp && sudo mv /tmp/eksctl /usr/local/bin # --- Helm --- curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
winget or choco.โถ๏ธ Walkthrough: sign in and check everything
aws configure sso SSO session name (Recommended): my-sso SSO start URL [None]: https://my-company.awsapps.com/start SSO region [None]: us-west-2 ... CLI default client Region [None]: us-west-2 CLI profile name [AdministratorAccess-111122223333]: eks-admin
aws configure.)export AWS_PROFILE=eks-admin aws sts get-caller-identity { "UserId": "AROAEXAMPLEID:alex", "Account": "111122223333", "Arn": "arn:aws:sts::111122223333:assumed-role/AWSReservedSSO_AdministratorAccess_abc123/alex" }
kubectl version --client Client Version: v1.37.x Kustomize Version: v5.x eksctl version 0.2xx.0 helm version --short v3.x.x
aws eks describe-cluster-versions --query "clusterVersions[].[clusterVersion,versionStatus]" --output table ------------------------------------ | DescribeClusterVersions | +-------+--------------------------+ | 1.37 | STANDARD_SUPPORT | | 1.36 | STANDARD_SUPPORT | | 1.35 | STANDARD_SUPPORT | | 1.34 | STANDARD_SUPPORT | | 1.33 | EXTENDED_SUPPORT | | ... | ... | +-------+--------------------------+
--query trims the output; --output table makes it readable.us-west-2). Most "I can't find my cluster" problems are a wrong Region.Key takeaways
awstalks to AWS;kubectltalks to Kubernetes;eksctlbuilds clusters;helminstalls packages.- Sign in with SSO and check with
aws sts get-caller-identity.
Create Your First Cluster
kubectl to it, and how to look around.Three ways to build
1. eksctl (easiest)
One command builds the VPC, IAM roles, cluster, and nodes. Great for learning.2. AWS Console
Click through screens. Good to see every setting (see the Console Tour tab).3. Infrastructure as Code
Terraform, CloudFormation, or CDK. Best for real teams: repeatable and reviewed.Option A: Auto Mode cluster (recommended for beginners)
eksctl create cluster --name demo --region us-west-2 --enable-auto-mode [โน] eksctl version 0.2xx.0 [โน] using region us-west-2 [โน] subnets for us-west-2a - public:192.168.0.0/19 private:192.168.96.0/19 [โน] subnets for us-west-2b - public:192.168.32.0/19 private:192.168.128.0/19 [โน] subnets for us-west-2c - public:192.168.64.0/19 private:192.168.160.0/19 [โน] using Kubernetes version 1.37 [โน] creating EKS cluster "demo" in "us-west-2" region with Auto Mode [โน] building cluster stack "eksctl-demo-cluster" [โน] waiting for CloudFormation stack "eksctl-demo-cluster" ... [โ] saved kubeconfig as "/home/alex/.kube/config" [โ] EKS cluster "demo" in "us-west-2" region is ready
~/.kube/config. Auto Mode will create nodes only when you deploy pods.kubectl get nodes No resources found
kubectl create deployment hello --image=public.ecr.aws/nginx/nginx:stable-alpine --replicas=2 deployment.apps/hello created kubectl get pods -w NAME READY STATUS RESTARTS AGE hello-6b8f7d9c5d-4kq2x 0/1 Pending 0 2s hello-6b8f7d9c5d-r7m9z 0/1 Pending 0 2s hello-6b8f7d9c5d-4kq2x 0/1 ContainerCreating 0 48s hello-6b8f7d9c5d-4kq2x 1/1 Running 0 55s hello-6b8f7d9c5d-r7m9z 1/1 Running 0 56s
-w means "watch" โ press Ctrl+C to stop.kubectl get nodes -o wide NAME STATUS ROLES AGE VERSION INTERNAL-IP OS-IMAGE i-0a1b2c3d4e5f67890 Ready <none> 70s v1.37.x-eks-xxxxxxx 192.168.110.7 Bottlerocket (EKS Auto, Standard) ...
๐งช Practice lab: reach your app 3 ways (and undo each one)
Your hello deployment is running, but nothing can reach it yet. Here are the three common ways to see the nginx page. For each one you'll do it โ check it โ undo it โ check it's gone, so you can practice them as often as you like without leaving anything behind.
| Way | Who can reach the app | Creates AWS resources? | Use it for |
|---|---|---|---|
| 1. Port-forward | Only you, on your own computer | No: free | Quick personal checks and debugging |
| 2. Internal Service (ClusterIP) | Other pods inside the cluster | No: free | App-to-app traffic (frontend โ backend) |
| 3. Public load balancer | Anyone on the internet | Yes: an NLB, billed hourly | Real users |
us-west-2. If your cluster is in another Region (for example GovCloud us-gov-west-1), swap in your Region. If the public.ecr.aws/... image gives InvalidImageName, the image name was probably mangled when you copied it. Retype it, or use --image=nginx:alpine (from Docker Hub) for practice.Lab 1: Port-forward (a private tunnel from your laptop)
kubectl port-forward deployment/hello 8080:80 Forwarding from 127.0.0.1:8080 -> 80 Forwarding from [::1]:8080 -> 80
hello pod. The command keeps running: the tunnel only exists while it runs. Leave it open.curl -s http://localhost:8080 | grep title <title>Welcome to nginx!</title>
http://localhost:8080 in a browser.# In terminal 1, press Ctrl+C # Started it in the background with "&" instead? Use one of these: kill %1 # same terminal session pkill -f "port-forward deployment/hello" # from any terminal (macOS/Linux)
curl -s http://localhost:8080 curl: (7) Failed to connect to localhost port 8080: Connection refused
Lab 2: Internal Service + test from inside the cluster
kubectl expose deployment hello --port=80 kubectl get svc hello service/hello exposed NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE hello ClusterIP 10.100.57.201 <none> 80/TCP 5s
expose creates a Service named hello in front of the pods with label app=hello. Type ClusterIP means it has an internal address only: no load balancer, no cost. CoreDNS also gives it the name hello.kubectl run curltest --rm -it --image=curlimages/curl --restart=Never -- curl -s http://hello <!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> ... pod "curltest" deleted
curl, fetches http://hello the same way another app in the cluster would, prints the page, and deletes itself. The breakdown below explains every part of the command.kubectl delete svc hello kubectl delete pod curltest --ignore-not-found service "hello" deleted
--ignore-not-found keeps it quiet if the pod is already gone.kubectl get svc hello kubectl get pod curltest Error from server (NotFound): services "hello" not found Error from server (NotFound): pods "curltest" not found
hello pods were never touched.Lab 3: Public load balancer (reachable from the internet)
On Auto Mode, use a small YAML file instead of kubectl expose --type=LoadBalancer. expose can't set loadBalancerClass, the field that tells Auto Mode to build the load balancer. Without it, an older built-in controller may create a different (Classic) load balancer instead.
cat > hello-lb.yaml <<'EOF' apiVersion: v1 kind: Service metadata: name: hello-lb annotations: service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing spec: type: LoadBalancer loadBalancerClass: eks.amazonaws.com/nlb selector: app: hello ports: - port: 80 targetPort: 80 EOF kubectl apply -f hello-lb.yaml service/hello-lb created
type: LoadBalancer asks for an outside address. loadBalancerClass: eks.amazonaws.com/nlb tells Auto Mode to build an NLB. The annotation makes it internet-facing; the default is internal, reachable only inside the VPC. selector sends traffic to pods labeled app=hello. (Standard clusters with the AWS Load Balancer Controller use service.k8s.aws/nlb instead.)kubectl get svc hello-lb -w NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) hello-lb LoadBalancer 10.100.12.88 <pending> 80:31234/TCP hello-lb LoadBalancer 10.100.12.88 k8s-default-hellolb-1a2b3c4d5e-0123456789abcdef.elb.us-west-2.amazonaws.com 80:31234/TCP
<pending> while AWS builds the NLB (2โ3 minutes), then the NLB's hostname. Press Ctrl+C to stop watching.LB=$(kubectl get svc hello-lb -o jsonpath='{.status.loadBalancer.ingress[0].hostname}') curl -s http://$LB | grep title aws elbv2 describe-load-balancers --region us-west-2 --query "LoadBalancers[].[LoadBalancerName,Type,State.Code]" --output table <title>Welcome to nginx!</title> ----------------------------------------------------- | DescribeLoadBalancers | +--------------------------------+---------+--------+ | k8s-default-hellolb-1a2b3c4d5e | network| active| +--------------------------------+---------+--------+
k8s-). If curl fails at first, wait a minute for DNS and health checks.kubectl delete -f hello-lb.yaml service "hello-lb" deleted
kubectl get svc hello-lb aws elbv2 describe-load-balancers --region us-west-2 --query "LoadBalancers[].[LoadBalancerName,Type,State.Code]" --output table rm hello-lb.yaml Error from server (NotFound): services "hello-lb" not found (no k8s-... load balancer listed)
k8s-... NLB, so billing for it has stopped. rm removes the local file (optional).๐ Breakdown: kubectl run curltest --rm -it ...
Click each part of the command to see what it does.
| Part | What it means |
|---|---|
kubectl run | Create and start a single pod (not a Deployment). |
curltest | The pod's name. Any name works. |
--rm | Delete the pod automatically when the command finishes, so nothing is left behind. |
-it | -i (interactive) keeps the pod's input connected to your terminal. -t (tty) gives it a proper terminal. Together they show the output in your terminal and let --rm clean up when it ends. |
--image=curlimages/curl | The container image to run: a tiny Docker Hub image that contains the curl tool. nginx isn't meant for testing, so you bring a separate tool. |
--restart=Never | Run once. Without it, Kubernetes would restart the pod after curl exits, as if it had crashed. |
-- | The divider: everything before it is for kubectl; everything after it is the command run inside the container. |
curl | The tool that fetches a web page. |
-s | Silent: hide curl's progress meter and show only the page. |
http://hello | The address: the hello Service. CoreDNS turns the name into the Service's internal IP, and the Service forwards to an nginx pod. From another namespace use hello.default or hello.default.svc.cluster.local. |
What happens, in order:
curltestcurlimages/curlcurl -s http://hello--rm deletes the podCompared with port-forward, this test proves more: pod-to-pod networking, DNS and the Service all work, which is the same path your other apps would use.
# Open a shell in the test pod and try several commands by hand (type "exit" to leave) kubectl run curltest --rm -it --image=curlimages/curl --restart=Never -- sh # Show only the response headers kubectl run curltest --rm -it --image=curlimages/curl --restart=Never -- curl -sI http://hello # Reach a Service in another namespace kubectl run curltest --rm -it --image=curlimages/curl --restart=Never -- curl -s http://hello.shop.svc.cluster.local # Clean up a test pod that didn't delete itself (e.g., after Ctrl+C) kubectl delete pod curltest --ignore-not-found
Lab takeaways
- Port-forward = just you, free, gone when you press Ctrl+C.
- ClusterIP Service = inside the cluster only, free. Undo with
kubectl delete svc. - LoadBalancer Service = public, billed hourly. Always undo by deleting the Service, then confirm in AWS.
Option B: Standard cluster with a managed node group
For full control, describe the cluster in a config file. This is the "standard" way most existing EKS clusters are built.
apiVersion: eksctl.io/v1alpha5 kind: ClusterConfig metadata: name: demo-std region: us-west-2 version: "1.36" # older on purpose so we can practice upgrading later iam: withOIDC: true # needed only if you use IRSA addons: # install core add-ons as EKS-managed add-ons - name: vpc-cni - name: coredns - name: kube-proxy - name: eks-pod-identity-agent - name: aws-ebs-csi-driver useDefaultPodIdentityAssociations: true - name: metrics-server managedNodeGroups: - name: ng-general amiFamily: AmazonLinux2023 # AL2023 or Bottlerocket (AL2 is retired) instanceTypes: ["m6i.large", "m7i.large"] minSize: 2 desiredCapacity: 2 maxSize: 5 volumeSize: 50 # GiB root disk privateNetworking: true # nodes in private subnets (safer) labels: { team: platform } updateConfig: maxUnavailable: 1 # replace 1 node at a time during patching
eksctl create cluster -f cluster.yaml. This takes about 15โ20 minutes.Connect kubectl to any cluster
If you built the cluster another way (console, Terraform), tell kubectl how to reach it:
aws eks update-kubeconfig --region us-west-2 --name demo Added new context arn:aws:eks:us-west-2:111122223333:cluster/demo to /home/alex/.kube/config kubectl config get-contexts CURRENT NAME CLUSTER ... * arn:aws:eks:us-west-2:111122223333:cluster/demo ... kubectl get svc NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE kubernetes ClusterIP 10.100.0.1 <none> 443/TCP 20m
update-kubeconfigwrites the cluster address and an auth command into~/.kube/config.- A context = which cluster + which user. The
*marks the active one. Switch withkubectl config use-context NAME. - Seeing the
kubernetesservice proves you are connected.
Your kubectl cheat sheet
A short starter list. The full, searchable list (including "who am I?" checks) is on the Command Reference page.
| Command | What it does |
|---|---|
kubectl get pods -A | List pods in all namespaces |
kubectl get deploy,svc,ing -n NAMESPACE | List several kinds of things at once |
kubectl describe pod NAME | Full details + recent Events (best for debugging) |
kubectl logs NAME [-f] [--previous] | App output; -f follows live, --previous shows the crashed copy |
kubectl exec -it NAME -- sh | Open a shell inside a container |
kubectl apply -f file.yaml | Create or update from a file |
kubectl delete -f file.yaml | Delete what the file describes |
kubectl get events --sort-by=.lastTimestamp | Recent cluster events, newest last |
kubectl top nodes / pods | CPU & memory use (needs Metrics Server) |
kubectl explain deployment.spec | Built-in docs for any field |
๐งน Teardown A: Auto Mode cluster (demo)
kubectl get svc hello-lb should say NotFound). Deleting an Auto Mode cluster also deletes its load balancers, but undoing it yourself is good practice.This scenario created only two things: the cluster (via eksctl) and the hello deployment. eksctl tracks everything it built (VPC, subnets, NAT gateway, IAM roles, control plane) and deletes all of it in reverse. Deleting an Auto Mode cluster also deletes the Auto Mode nodes, so one command is enough.
eksctl delete cluster --name demo --region us-west-2 --wait [โน] deleting EKS cluster "demo" [โ] kubeconfig has been updated [โน] cleaning up AWS load balancers created by Kubernetes objects of Kind Service or Ingress [โน] deleting stack "eksctl-demo-cluster" ... [โ] all cluster resources were deleted
hello pods, the Auto Mode EC2 nodes, the control plane, and the CloudFormation stack eksctl made (VPC, subnets, NAT gateway, IAM roles). --wait keeps the command running until it's all gone (about 10โ15 minutes). The "cleaning up load balancers" line always appears; for this scenario there are none to remove.aws eks list-clusters --region us-west-2 { "clusters": [] } aws cloudformation list-stacks --region us-west-2 --stack-status-filter DELETE_FAILED --query "StackSummaries[].StackName" []
Did you keep using this cluster for the Level 3โ5 lessons? Expand for extra steps.
Later lessons add things eksctl doesn't know about. Delete these before running eksctl delete cluster, and skip any you didn't create:
kubectl delete svc hello-lb --ignore-not-found # Practice lab 3: NLB kubectl delete ingress --all -A # Networking lesson: ALBs kubectl delete svc -n shop hello-nlb # Networking lesson: NLB kubectl delete pvc --all -A # Storage lesson: EBS volumes kubectl delete nodepool spot-graviton # Compute lesson: custom NodePool aws logs delete-log-group --log-group-name /aws/eks/demo/cluster # Monitoring lesson: only if you turned on control plane logging
The ECR repository and any IAM roles you created by hand are covered in the leftover check.
๐งน Teardown B: Standard cluster (demo-std)
This scenario created only what's in cluster.yaml: the VPC, the cluster, the managed node group, the EKS add-ons and their Pod Identity roles, and the OIDC provider. eksctl made all of it, so one command deletes all of it. Use the same file you created the cluster with.
eksctl delete cluster -f cluster.yaml --wait [โน] deleting EKS cluster "demo-std" [โ] kubeconfig has been updated [โน] cleaning up AWS load balancers created by Kubernetes objects of Kind Service or Ingress [โน] will delete stack "eksctl-demo-std-nodegroup-ng-general" [โน] will delete stack "eksctl-demo-std-cluster" ... [โ] all cluster resources were deleted
aws eks list-clusters --region us-west-2 { "clusters": [] } aws cloudformation list-stacks --region us-west-2 --stack-status-filter DELETE_FAILED --query "StackSummaries[].StackName" []
Did you keep using this cluster for the Level 3โ5 lessons? Expand for extra steps.
Later lessons add things eksctl doesn't track. Order matters: delete load balancers and volumes while the AWS Load Balancer Controller and EBS CSI driver are still running, because they're what remove the AWS resources. Then run the eksctl command above. Skip anything you didn't create.
kubectl delete ingress --all -A # Networking lesson: ALBs kubectl get svc -A --field-selector spec.type=LoadBalancer # delete each NLB Service listed kubectl delete pvc --all -A # Storage lesson: EBS volumes kubectl delete nodepools --all # only if you installed Karpenter; wait for its nodes to go helm uninstall my-redis -n cache # Deploy lesson helm uninstall aws-load-balancer-controller -n kube-system # Networking lesson # -- now run: eksctl delete cluster -f cluster.yaml --wait -- aws iam detach-role-policy --role-name EfsCsiRole --policy-arn arn:aws:iam::aws:policy/service-role/AmazonEFSCSIDriverPolicy aws iam delete-role --role-name EfsCsiRole # Add-ons lesson (role you made by hand) aws logs delete-log-group --log-group-name /aws/eks/demo-std/cluster # only if you turned on logging
Also delete any EFS file system you created (EFS console), then run the leftover check.
terraform destroy or cdk destroy. Always tear down with the same tool you built with.Key takeaways
eksctl create cluster --enable-auto-modeis the fastest start.aws eks update-kubeconfigconnects kubectl.describeandlogsare your best friends.
AWS Console Tour: Every Setting Explained
In the console, go to Amazon EKS โ Clusters โ Create cluster. You will see two choices:
โก Quick configuration (with EKS Auto Mode)
Only a few fields: name, version, cluster IAM role, node IAM role, VPC, subnets. AWS picks good defaults for the rest. Can create the IAM roles for you.๐ง Custom configuration
Every setting is shown. You can turn Auto Mode on or off. The steps below follow this path.๐ฑ๏ธ Interactive mock: hover over a field
This is a simplified copy of the console. Click a step on the left, then hover over (or tap) a field to see what it means.
Full reference: create cluster (Custom configuration)
Step 1 โ Configure cluster
general-purpose and system).Recommended for new clusters unless you need custom AMIs or SSH into nodes.AmazonEKSClusterPolicy. Auto Mode clusters also need AmazonEKSComputePolicy, AmazonEKSBlockStoragePolicyV2, AmazonEKSLoadBalancingPolicy, and AmazonEKSNetworkingPolicy. Cannot be changed after creation.aws-auth method). You can move toward EKS API later, but not back.Use EKS API for new clusters.env=prod, owner=team-a. Used for cost reports and access rules.Step 2 โ Specify networking
kubernetes.io/role/elb=1 and private subnets kubernetes.io/role/internal-elb=1 so load balancers land in the right place.10.100.0.0/16 or 172.20.0.0/16). Must not overlap your VPC or connected networks.Step 3 โ Configure observability
amazon-cloudwatch-observability add-on for node, pod, and app metrics and logs.Step 4 โ Select add-ons
Pick the EKS add-ons to install now (more on the Add-ons tab). On standard clusters the defaults are Amazon VPC CNI, CoreDNS, kube-proxy, and usually EKS Pod Identity Agent. With Auto Mode, these core pieces are built in. You can also pick Amazon EBS CSI driver, EFS CSI driver, Mountpoint for S3, CloudWatch Observability, Metrics Server, Node monitoring agent, GuardDuty agent, and community or AWS Marketplace add-ons.
Step 5 โ Configure selected add-ons settings
Step 6 โ Review and create
Check everything. Creation takes ~10โ15 minutes. Status goes Creating โ Active.
Cluster page tabs (after creation)
Click a cluster's name in Amazon EKS โ Clusters and you land on its detail page, which has a row of tabs. Pick a tab below to see each item on it, what it is, and what you use it for. (AWS adjusts the console often, so exact labels may differ slightly.)
Add managed node group (Compute โ Add node group)
Configure node group
ng-general. Cannot change later.AmazonEKSWorkerNodePolicy, AmazonEC2ContainerRegistryReadOnly (or the newer AmazonEC2ContainerRegistryPullOnly) and, if VPC CNI uses the node role, AmazonEKS_CNI_Policy.workload=gpu).Set compute and scaling configuration
Specify networking
Add Fargate profile (Compute โ Add Fargate profile)
๐งน Teardown C: Cluster built in the AWS Console
The console doesn't record what it built as one group you can delete in one go, so you remove the pieces it made, in order. These are the steps for a cluster created exactly as in this tour:
- Compute tab โ Node groups (standard clusters only): select each node group โ Delete โ type its name โ Delete. Wait until the list is empty. Auto Mode clusters have no node groups; skip this step.
- Overview tab: if you turned on Deletion protection, choose Manage and turn it off.
- Delete the cluster: Clusters list โ select the cluster โ Delete โ type the name โ Delete. It shows Deleting and then disappears (10โ15 min). Auto Mode nodes are deleted with it.
- CloudFormation console: if you created the VPC from the AWS EKS VPC template, delete that stack. This removes the VPC, subnets and NAT gateway.
Only if you chose these options while creating the cluster:
- Control plane logging (Step 3): delete the
/aws/eks/CLUSTER-NAME/clusterlog group in CloudWatch. It isn't deleted with the cluster. - Prometheus scraper (Step 3): delete the scraper (and the workspace) in Amazon Managed Service for Prometheus. They are billed separately.
- Roles the console created for you: delete them in IAM (for example
AmazonEKSAutoClusterRoleandAmazonEKSAutoNodeRole). Optional, because roles are free.
Same thing with the AWS CLI
aws eks list-nodegroups --cluster-name demo-console aws eks delete-nodegroup --cluster-name demo-console --nodegroup-name ng-general aws eks wait nodegroup-deleted --cluster-name demo-console --nodegroup-name ng-general aws eks update-cluster-config --name demo-console --no-deletion-protection aws eks delete-cluster --name demo-console aws eks wait cluster-deleted --name demo-console aws cloudformation delete-stack --stack-name my-eks-vpc
aws eks wait ... pauses until the item is really gone, so each step finishes before the next one starts.Did you add things later (Fargate profiles, capabilities, apps with load balancers or disks)? Expand.
- Before deleting the cluster, run
kubectl delete ingress --all -A, delete eachLoadBalancerService, and runkubectl delete pvc --all -A. - Delete any Fargate profiles (Compute tab) and Capabilities such as Argo CD, ACK or kro (Capabilities tab). The cluster can't be deleted while they exist.
- Then follow the steps above and finish with the leftover check.
Key takeaways
- Some settings are permanent: name, cluster IAM role, IP family, service IP range, VPC.
- Use private subnets, EKS API auth mode, and turn on audit logs.
- Node group "update configuration" controls how patching rolls out.
Compute: Where Your Pods Run
| Option | Who manages servers | Good for | Watch out |
|---|---|---|---|
| EKS Auto Mode | AWS (fully) | Most new clusters; small teams | No SSH/custom AMI; extra fee; nodes replaced at least every 21 days |
| Managed node groups | AWS launches & updates; you choose and trigger | Classic, predictable setups | You must patch (click "Update") and scale |
| Karpenter (self-installed) | You install Karpenter; it picks instances | Fast, cost-smart scaling with lots of control | You upgrade Karpenter itself |
| Self-managed nodes | You (Auto Scaling groups) | Special OS needs | Most work; you handle everything |
| AWS Fargate | AWS (serverless pods) | Small, spiky, isolated jobs | No DaemonSets, no EBS volumes, no GPUs, slower start |
| EKS Hybrid Nodes | You (your own servers) | Using on-premises hardware | Needs a network link to AWS |
How Karpenter / Auto Mode chooses servers
NodePool example (Auto Mode)
Auto Mode comes with two built-in pools: general-purpose (On-Demand C/M/R types, x86) and system (for add-ons, tainted CriticalAddonsOnly). You cannot edit them, but you can add your own:
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: spot-graviton
spec:
template:
spec:
nodeClassRef: # Auto Mode's NodeClass (network, disk, role settings)
group: eks.amazonaws.com
kind: NodeClass
name: default
requirements:
- key: karpenter.sh/capacity-type
operator: In
values: ["spot", "on-demand"] # prefer Spot, fall back to On-Demand
- key: kubernetes.io/arch
operator: In
values: ["arm64"] # Graviton = cheaper per CPU
- key: eks.amazonaws.com/instance-category
operator: In
values: ["c", "m"]
limits:
cpu: "200" # never more than 200 vCPU total
disruption:
consolidationPolicy: WhenEmptyOrUnderutilized
consolidateAfter: 1m
nodeClassRef points to an EC2NodeClass (group karpenter.k8s.aws) and labels use karpenter.k8s.aws/....Requests and limits (tell the scheduler what you need)
resources:
requests: { cpu: "250m", memory: "256Mi" } # reserved for you; used for placement
limits: { memory: "512Mi" } # hard cap; going over memory = pod is killed (OOMKilled)
250m = 250 millicores = ยผ of a CPU. Always set requests โ autoscalers and the scheduler rely on them.Steering pods to nodes
nodeSelector
"Only run on nodes with this label." Simple and strict.Affinity / anti-affinity
"Prefer" or "require" rules โ e.g., spread copies across AZs.Taints & tolerations
Nodes repel pods unless the pod tolerates the taint (e.g., GPU nodes).Topology spread constraints
Evenly spread pods across zones/nodes for high availability.Key takeaways
- New clusters: start with Auto Mode. Existing clusters: managed node groups or Karpenter.
- Always set CPU/memory requests.
- Spot + Graviton saves a lot for workloads that can handle restarts.
Amazon ECR: Storing Your Images
Image address format
111122223333.dkr.ecr.us-west-2.amazonaws.com/hello-app:1.0
= account ID . registry in Region / repository name : tag
โถ๏ธ Walkthrough: build, push, and scan
aws ecr create-repository --repository-name hello-app \ --image-scanning-configuration scanOnPush=true \ --image-tag-mutability IMMUTABLE \ --encryption-configuration encryptionType=AES256 \ --region us-west-2 { "repository": { "repositoryArn": "arn:aws:ecr:us-west-2:111122223333:repository/hello-app", "repositoryName": "hello-app", "repositoryUri": "111122223333.dkr.ecr.us-west-2.amazonaws.com/hello-app", "imageTagMutability": "IMMUTABLE", "imageScanningConfiguration": { "scanOnPush": true }, ... } }
scanOnPush checks every new image for known security holes. IMMUTABLE means a tag like 1.0 can never be overwritten โ so "1.0" always means the same thing. Save the repositoryUri.aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 111122223333.dkr.ecr.us-west-2.amazonaws.com Login Succeeded
docker login.docker build --platform linux/amd64 -t hello-app:1.0 . docker tag hello-app:1.0 111122223333.dkr.ecr.us-west-2.amazonaws.com/hello-app:1.0 docker push 111122223333.dkr.ecr.us-west-2.amazonaws.com/hello-app:1.0 The push refers to repository [111122223333.dkr.ecr.us-west-2.amazonaws.com/hello-app] 5f70bf18a086: Pushed a3c1d0b2e7f1: Pushed 1.0: digest: sha256:9b7c...e21f size: 1365
--platform linux/amd64 builds for x86 nodes (important if you use an Apple Silicon Mac; use linux/arm64 for Graviton, or docker buildx for both). tag gives the image its full ECR address. push uploads it. The digest is a unique fingerprint.aws ecr describe-image-scan-findings --repository-name hello-app --image-id imageTag=1.0 \ --query "imageScanFindings.findingSeverityCounts" { "HIGH": 1, "MEDIUM": 4, "LOW": 7 }
aws ecr list-images --repository-name hello-app { "imageIds": [ { "imageDigest": "sha256:9b7c...e21f", "imageTag": "1.0" } ] }
How does EKS get permission to pull?
- Same account: the node IAM role needs
AmazonEC2ContainerRegistryReadOnlyorAmazonEC2ContainerRegistryPullOnly. eksctl and Auto Mode set this up. NoimagePullSecretsare needed. - Fargate: the pod execution role needs the same pull permission.
- Other account: add a repository policy in the ECR account that allows the node role (or the whole account) to pull.
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "AllowPullFromProdAccount",
"Effect": "Allow",
"Principal": { "AWS": "arn:aws:iam::444455556666:root" },
"Action": ["ecr:BatchGetImage", "ecr:GetDownloadUrlForLayer", "ecr:BatchCheckLayerAvailability"]
}]
}
aws ecr set-repository-policy --repository-name hello-app --policy-text file://cross-account-pull.json. The other account's node role also needs ECR pull permission in its own IAM policy.Keep ECR tidy: lifecycle policies
{
"rules": [
{ "rulePriority": 1, "description": "Delete untagged images after 7 days",
"selection": { "tagStatus": "untagged", "countType": "sinceImagePushed", "countUnit": "days", "countNumber": 7 },
"action": { "type": "expire" } },
{ "rulePriority": 2, "description": "Keep only the newest 30 images",
"selection": { "tagStatus": "any", "countType": "imageCountMoreThan", "countNumber": 30 },
"action": { "type": "expire" } }
]
}
aws ecr put-lifecycle-policy --repository-name hello-app --lifecycle-policy-text file://lifecycle.json โ old images are deleted automatically, saving storage cost. Test it first with the console's "lifecycle policy preview."More ECR features you will use
| Feature | What it does |
|---|---|
| Pull through cache | Copies images from public registries (Docker Hub, Quay, GitHub, ECR Public, Kubernetes registry) into your ECR the first time they are pulled. Faster, avoids Docker Hub rate limits, and gives you scanning. |
| Replication | Automatically copies images to other Regions or accounts (for disaster recovery or multi-Region apps). |
| Enhanced scanning | Amazon Inspector scans OS and language packages continuously, not just on push. |
| KMS encryption | Encrypt images with your own KMS key instead of the default AES-256. |
| Image signing | Sign images (AWS Signer + Notation) and only allow signed images into the cluster with a policy tool such as Kyverno. |
| Repository creation templates | Default settings for repos created automatically (by pull-through cache or replication). |
hello-app@sha256:...) or immutable tags. Never use :latest โ you cannot tell which version is running.Key takeaways
- Create repo โ log in โ build โ tag โ push.
- Turn on scan-on-push and immutable tags.
- Nodes pull with the node IAM role; cross-account needs a repository policy.
Deploy Applications
A complete app (Deployment + Service + HPA)
apiVersion: v1
kind: Namespace
metadata: { name: shop }
---
apiVersion: apps/v1
kind: Deployment
metadata: { name: hello, namespace: shop }
spec:
replicas: 3
revisionHistoryLimit: 5 # keep 5 old versions for rollback
strategy:
type: RollingUpdate
rollingUpdate: { maxSurge: 1, maxUnavailable: 0 } # add 1 new before removing 1 old
selector: { matchLabels: { app: hello } }
template:
metadata: { labels: { app: hello } }
spec:
topologySpreadConstraints: # spread across AZs
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: ScheduleAnyway
labelSelector: { matchLabels: { app: hello } }
containers:
- name: web
image: 111122223333.dkr.ecr.us-west-2.amazonaws.com/hello-app:1.0
ports: [{ containerPort: 80 }]
resources:
requests: { cpu: 100m, memory: 128Mi }
limits: { memory: 256Mi }
readinessProbe: # "ready for traffic?"
httpGet: { path: /, port: 80 }
periodSeconds: 5
livenessProbe: # "still alive? if not, restart me"
httpGet: { path: /, port: 80 }
initialDelaySeconds: 10
securityContext:
allowPrivilegeEscalation: false
---
apiVersion: v1
kind: Service
metadata: { name: hello, namespace: shop }
spec:
type: ClusterIP # inside-cluster address only
selector: { app: hello }
ports: [{ port: 80, targetPort: 80 }]
---
apiVersion: policy/v1
kind: PodDisruptionBudget # protects you during node patching
metadata: { name: hello, namespace: shop }
spec:
minAvailable: 2
selector: { matchLabels: { app: hello } }
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata: { name: hello, namespace: shop }
spec:
scaleTargetRef: { apiVersion: apps/v1, kind: Deployment, name: hello }
minReplicas: 3
maxReplicas: 20
metrics:
- type: Resource
resource: { name: cpu, target: { type: Utilization, averageUtilization: 70 } }โถ๏ธ Walkthrough: deploy, update, roll back
kubectl apply -f app.yaml namespace/shop created deployment.apps/hello created service/hello created poddisruptionbudget.policy/hello created horizontalpodautoscaler.autoscaling/hello created
apply sent the whole file. Each object reports "created". Run it again later and it says "unchanged" or "configured" โ apply is safe to repeat.kubectl -n shop get deploy,pods,svc,hpa NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/hello 3/3 3 3 40s NAME READY STATUS RESTARTS AGE pod/hello-7c9d8f6b5-2xk8p 1/1 Running 0 40s pod/hello-7c9d8f6b5-9qwr4 1/1 Running 0 40s pod/hello-7c9d8f6b5-tz6lm 1/1 Running 0 40s NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/hello ClusterIP 10.100.142.17 <none> 80/TCP 40s NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS horizontalpodautoscaler.autoscaling/hello Deployment/hello cpu: 2%/70% 3 20 3
<unknown>, Metrics Server is missing.kubectl -n shop port-forward svc/hello 8080:80 Forwarding from 127.0.0.1:8080 -> 80
http://localhost:8080. Ctrl+C to stop. (The Networking tab shows how to expose it to the internet.)kubectl -n shop set image deployment/hello web=111122223333.dkr.ecr.us-west-2.amazonaws.com/hello-app:1.1 deployment.apps/hello image updated kubectl -n shop rollout status deployment/hello Waiting for deployment "hello" rollout to finish: 1 out of 3 new replicas have been updated... Waiting for deployment "hello" rollout to finish: 2 out of 3 new replicas have been updated... deployment "hello" successfully rolled out
set image.)kubectl -n shop rollout history deployment/hello REVISION CHANGE-CAUSE 1 <none> 2 <none> kubectl -n shop rollout undo deployment/hello deployment.apps/hello rolled back
rollout undo goes back to the previous revision in seconds. Add --to-revision=N to pick one.kubectl -n shop describe pod hello-7c9d8f6b5-2xk8p | tail -8 Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Scheduled 3m default-scheduler Successfully assigned shop/hello-... to i-0a1b2c3d4e5f67890 Normal Pulling 3m kubelet Pulling image "111122223333.dkr.ecr...hello-app:1.0" Normal Pulled 3m kubelet Successfully pulled image in 2.1s Normal Created 3m kubelet Created container: web Normal Started 3m kubelet Started container web
Configuration and secrets
kubectl -n shop create configmap hello-config --from-literal=COLOR=blue kubectl -n shop create secret generic db-pass --from-literal=PASSWORD='s3cr3t' # then in the container spec: envFrom: [{configMapRef: {name: hello-config}}, {secretRef: {name: db-pass}}]
Helm: install packaged apps
helm repo add bitnami https://charts.bitnami.com/bitnami && helm repo update helm install my-redis bitnami/redis -n cache --create-namespace --set architecture=standalone NAME: my-redis NAMESPACE: cache STATUS: deployed REVISION: 1 helm list -A helm upgrade my-redis bitnami/redis -n cache -f values.yaml helm rollback my-redis 1 -n cache
GitOps (how pros deploy)
Instead of running kubectl apply by hand, teams keep YAML in Git and let a tool like Argo CD or Flux sync the cluster to match Git. Every change is reviewed in a pull request and easy to undo. EKS offers a fully managed Argo CD capability so you do not have to run Argo CD yourself.
Key takeaways
- Use probes, requests, PDBs, and topology spread for reliable apps.
rollout status/rollout undomake updates safe.- Helm packages apps; GitOps automates deploys.
Networking & Load Balancing
How pods get addresses: the Amazon VPC CNI
On EKS, each pod gets a real IP address from your VPC subnet. This makes pods first-class network citizens (security groups and VPC tools work), but it uses lots of IPs. Each EC2 type has a limit on network cards and IPs, which limits pods per node.
ENABLE_PREFIX_DELEGATION=true on the VPC CNI) to give each node blocks of 16 IPs, use larger subnets, add a secondary CIDR (custom networking), or use IPv6.Service types
| Type | Reachable from | Use it for |
|---|---|---|
| ClusterIP (default) | Only inside the cluster | Backend services, databases |
| NodePort | A port on every node | Rarely used directly |
| LoadBalancer | Internet or VPC via an AWS NLB | TCP/UDP apps, gRPC, non-HTTP |
| Ingress (not a Service type, an object) | Internet via an AWS ALB | Websites and HTTP APIs; path/host routing; HTTPS |
Expose the app with an ALB (Ingress)
apiVersion: eks.amazonaws.com/v1
kind: IngressClassParams
metadata: { name: alb }
spec:
scheme: internet-facing
---
apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata: { name: alb }
spec:
controller: eks.amazonaws.com/alb
parameters:
apiGroup: eks.amazonaws.com
kind: IngressClassParams
name: alb# 1. IAM role for the controller (Pod Identity) # using AWS's published IAM policy JSON helm repo add eks https://aws.github.io/eks-charts helm install aws-load-balancer-controller \ eks/aws-load-balancer-controller \ -n kube-system \ --set clusterName=demo-std \ --set serviceAccount.name=aws-load-balancer-controller \ --set vpcId=vpc-0abc123 kubectl -n kube-system get deploy aws-load-balancer-controller NAME READY UP-TO-DATE aws-load-balancer-controller 2/2 2 # IngressClass "alb" (controller ingress.k8s.aws/alb) # is created by the chart.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: hello
namespace: shop
annotations:
alb.ingress.kubernetes.io/scheme: internet-facing # public (use "internal" for private)
alb.ingress.kubernetes.io/target-type: ip # send traffic straight to pod IPs
# alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:... (HTTPS with ACM)
spec:
ingressClassName: alb
rules:
- http:
paths:
- path: /
pathType: Prefix
backend: { service: { name: hello, port: { number: 80 } } }kubectl apply -f ingress.yaml kubectl -n shop get ingress hello NAME CLASS HOSTS ADDRESS PORTS AGE hello alb * k8s-shop-hello-1a2b3c4d5e-123456789.us-west-2.elb.amazonaws.com 80 2m
kubectl describe ingress hello -n shop and look at Events โ usually missing subnet tags or IAM permissions.Expose with an NLB (Service type LoadBalancer)
apiVersion: v1
kind: Service
metadata:
name: hello-nlb
namespace: shop
annotations:
service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip
# Standard clusters with the LB Controller also add:
# service.beta.kubernetes.io/aws-load-balancer-type: external
spec:
type: LoadBalancer
loadBalancerClass: eks.amazonaws.com/nlb # Auto Mode. (LB Controller: service.k8s.aws/nlb)
selector: { app: hello }
ports: [{ port: 80, targetPort: 80 }]DNS inside the cluster (CoreDNS)
Every Service gets a name: hello.shop.svc.cluster.local (or just hello from the same namespace). CoreDNS answers these lookups. Add ExternalDNS to create Route 53 records for your Ingresses automatically.
Network policies (pod firewalls)
By default, any pod can talk to any pod. A NetworkPolicy limits that. The VPC CNI can enforce them (turn on enableNetworkPolicy in the add-on settings; built in on Auto Mode).
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata: { name: api-allow-frontend, namespace: shop }
spec:
podSelector: { matchLabels: { app: api } } # protect pods labeled app=api
policyTypes: ["Ingress"]
ingress:
- from: [{ podSelector: { matchLabels: { app: frontend } } }] # only frontend may connect
ports: [{ port: 8080 }]Key takeaways
- Pods get real VPC IPs โ plan big subnets.
- Ingress โ ALB (HTTP). Service LoadBalancer โ NLB (TCP/UDP).
- Auto Mode builds load balancers itself; standard clusters need the AWS Load Balancer Controller.
Storage: Keeping Data
A container's files disappear when it restarts. To keep data, attach a volume.
"type of disk"
"I want 10 GiB"
real EBS volume created
Choose the right storage
| Storage | Driver | Shared by many pods? | Best for |
|---|---|---|---|
| Amazon EBS | EBS CSI driver (built into Auto Mode) | No (one node, one AZ) | Databases, single-writer apps |
| Amazon EFS | EFS CSI driver | Yes, across AZs | Shared files, CMS uploads |
| Amazon S3 | Mountpoint for S3 CSI driver | Yes (read-heavy) | ML datasets, big read-mostly files |
| FSx (Lustre, NetApp ONTAP, OpenZFS) | FSx CSI drivers | Yes | High-performance computing, enterprise NAS |
| Instance store / emptyDir | Built in | No; lost when pod/node goes | Scratch and cache |
EBS example
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: gp3
annotations: { storageclass.kubernetes.io/is-default-class: "true" }
provisioner: ebs.csi.eks.amazonaws.com # Auto Mode. Standard EBS CSI add-on: ebs.csi.aws.com
volumeBindingMode: WaitForFirstConsumer # create the disk in the same AZ as the pod
reclaimPolicy: Delete # "Retain" keeps the disk after the PVC is deleted
allowVolumeExpansion: true
parameters:
type: gp3
encrypted: "true"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata: { name: data, namespace: shop }
spec:
accessModes: ["ReadWriteOnce"] # one node at a time
storageClassName: gp3
resources: { requests: { storage: 10Gi } }kubectl -n shop get pvc NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE data Pending gp3 5s # ...after a pod that uses it is scheduled... data Bound pvc-6f1e... 10Gi RWO gp3 40s
WaitForFirstConsumer โ the disk is created only when a pod needs it, so it lands in that pod's AZ. For databases, use a StatefulSet, which gives each replica its own PVC.Backups and snapshots
Install the CSI snapshot controller add-on to take VolumeSnapshots of EBS volumes. For whole-cluster backup (YAML + volumes), use AWS Backup for EKS or Velero.
Key takeaways
- StorageClass โ PVC โ PV.
- EBS = one pod/AZ; EFS = shared; S3 = big read-mostly data.
- Use
WaitForFirstConsumerand encryption.
Security & Access
1. People โ cluster
Access entries map an IAM user/role to cluster permissions.2. Pods โ AWS
EKS Pod Identity (or IRSA) gives a pod an IAM role, e.g., to read S3.3. Inside Kubernetes
RBAC roles say who can do what to which objects.1. Access entries (give a team access)
aws eks create-access-entry --cluster-name demo \ --principal-arn arn:aws:iam::111122223333:role/DevTeam { "accessEntry": { "clusterName": "demo", "principalArn": "arn:aws:iam::111122223333:role/DevTeam", "kubernetesGroups": [], "username": "arn:aws:sts::111122223333:assumed-role/DevTeam/{{SessionName}}", "type": "STANDARD" } }
DevTeam IAM role sign in to the cluster. By itself, this gives no permissions yet.aws eks associate-access-policy --cluster-name demo \ --principal-arn arn:aws:iam::111122223333:role/DevTeam \ --policy-arn arn:aws:eks::aws:cluster-access-policy/AmazonEKSViewPolicy \ --access-scope type=namespace,namespaces=shop { "clusterName": "demo", "principalArn": "arn:aws:iam::111122223333:role/DevTeam", "associatedAccessPolicy": { "policyArn": "arn:aws:eks::aws:cluster-access-policy/AmazonEKSViewPolicy", "accessScope": { "type": "namespace", "namespaces": ["shop"] } } }
shop namespace. Policies: AmazonEKSClusterAdminPolicy (everything), AmazonEKSAdminPolicy, AmazonEKSEditPolicy, AmazonEKSViewPolicy.aws eks list-access-entries --cluster-name demo { "accessEntries": [ "arn:aws:iam::111122223333:role/AWSReservedSSO_AdministratorAccess_abc123", "arn:aws:iam::111122223333:role/DevTeam", "arn:aws:iam::111122223333:role/eksctl-demo-...-NodeRole" ] }
aws-auth ConfigMap in kube-system. It is easy to break and lock everyone out. Move to access entries: set authentication mode to EKS API and ConfigMap, recreate the mappings as access entries, then switch to EKS API.2. Pods calling AWS: Pod Identity vs IRSA
| EKS Pod Identity (recommended) | IRSA (older) | |
|---|---|---|
| Setup | Install Pod Identity Agent add-on (built into Auto Mode); create an association | Create an OIDC provider per cluster; edit the role trust policy |
| Role trust policy | Trusts pods.eks.amazonaws.com once โ reuse in any cluster | Must list each cluster's OIDC URL |
| Limits | No OIDC provider limit | 100 OIDC providers per account by default |
| Session tags (ABAC) | Yes | No |
| Works on Fargate / outside EKS | Not on Fargate | Yes (Fargate, self-managed K8s) |
# trust-policy.json lets EKS Pod Identity use the role cat > trust-policy.json <<'EOF' { "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Principal": { "Service": "pods.eks.amazonaws.com" }, "Action": ["sts:AssumeRole", "sts:TagSession"] }] } EOF aws iam create-role --role-name ShopS3Read --assume-role-policy-document file://trust-policy.json aws iam attach-role-policy --role-name ShopS3Read --policy-arn arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess kubectl -n shop create serviceaccount s3-reader aws eks create-pod-identity-association --cluster-name demo --namespace shop \ --service-account s3-reader --role-arn arn:aws:iam::111122223333:role/ShopS3Read # In the Deployment pod spec: serviceAccountName: s3-reader
3. Kubernetes RBAC
apiVersion: rbac.authorization.k8s.io/v1 kind: Role # permissions inside one namespace metadata: { name: pod-restarter, namespace: shop } rules: - apiGroups: [""] resources: ["pods"] verbs: ["get", "list", "delete"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding # who gets the Role metadata: { name: oncall-restarters, namespace: shop } subjects: - kind: Group name: oncall # set via access entry "kubernetesGroups" apiGroup: rbac.authorization.k8s.io roleRef: { kind: Role, name: pod-restarter, apiGroup: rbac.authorization.k8s.io }
kubectl auth can-i delete pods -n shop --as-group=oncall --as=test.Security checklist
- Private API endpoint (or limited CIDRs); nodes in private subnets.
- Access entries with least privilege; no shared admin users.
- Pod Identity per app; block pods from using the node role (IMDSv2 hop limit 1 โ AL2023 default).
- Pod Security Standards: label namespaces
pod-security.kubernetes.io/enforce=restricted(or baseline). - KMS envelope encryption for Secrets; secrets in Secrets Manager.
- Scan images in ECR; run Amazon GuardDuty EKS Protection / Runtime Monitoring.
- Policy engine (Kyverno or OPA Gatekeeper) to block risky YAML.
- Audit logs on.
Key takeaways
- Access entries = who gets into the cluster.
- Pod Identity = what a pod can do in AWS.
- RBAC = what someone can do inside Kubernetes.
Add-ons: The Usual Toolkit
An add-on is extra software that gives the cluster abilities (networking, DNS, storage, monitoring). EKS add-ons are installed and version-tested by AWS through the EKS API. Others are installed with Helm.
The typical add-on list
| Add-on | What it does (simple) | How to install | Auto Mode? |
|---|---|---|---|
Amazon VPC CNI (vpc-cni) | Gives pods VPC IP addresses | EKS add-on (default) | Built in |
| CoreDNS | Name lookups inside the cluster | EKS add-on (default) | Built in |
| kube-proxy | Routes Service traffic on each node | EKS add-on (default) | Built in |
| EKS Pod Identity Agent | Hands IAM credentials to pods | EKS add-on | Built in |
| Amazon EBS CSI driver | Creates EBS disks for PVCs | EKS add-on | Built in |
| AWS Load Balancer Controller | Creates ALBs/NLBs for Ingress/Services | Helm | Built in |
| Karpenter or Cluster Autoscaler | Adds/removes nodes | Helm | Built in |
| Node monitoring agent | Detects node health problems; enables auto repair | EKS add-on | Built in |
| Metrics Server | CPU/memory numbers for HPA and kubectl top | EKS add-on or Helm | Install it |
| Amazon EFS CSI driver | Shared file storage | EKS add-on | Install if needed |
| Mountpoint for Amazon S3 CSI | Mount S3 buckets | EKS add-on | Install if needed |
| CSI snapshot controller | Volume snapshots | EKS add-on | Install if needed |
| Amazon CloudWatch Observability | Container Insights metrics + logs (Fluent Bit) | EKS add-on | Install it |
| AWS Distro for OpenTelemetry (ADOT) | Traces/metrics to X-Ray, Prometheus, etc. | EKS add-on | Optional |
| GuardDuty runtime agent | Threat detection on nodes | EKS add-on (via GuardDuty) | Optional |
| ExternalDNS | Creates Route 53 DNS records | EKS community add-on or Helm | Optional |
| cert-manager | Issues TLS certificates automatically | Add-on catalog or Helm | Optional |
| Secrets Store CSI Driver + AWS provider | Loads Secrets Manager / Parameter Store values into pods | EKS add-on or Helm | Optional |
| Argo CD / ACK / kro | GitOps; manage AWS resources with YAML; build composite resources | EKS Capabilities (AWS-managed) or Helm | Optional |
โถ๏ธ Walkthrough: find, install, and update an add-on
aws eks list-addons --cluster-name demo-std { "addons": [ "coredns", "eks-pod-identity-agent", "kube-proxy", "metrics-server", "vpc-cni", "aws-ebs-csi-driver" ] }
aws eks describe-addon-versions --addon-name vpc-cni --kubernetes-version 1.36 \ --query "addons[].addonVersions[].[addonVersion, compatibilities[0].defaultVersion]" --output table ------------------------------- | DescribeAddonVersions | +------------------+----------+ | v1.2x.y-eksbuild.1 | False | | v1.2x.x-eksbuild.1 | True | | ... | ... | +------------------+----------+
True marks AWS's default. Newer ones may be available.aws eks create-addon --cluster-name demo-std --addon-name aws-efs-csi-driver \ --pod-identity-associations serviceAccount=efs-csi-controller-sa,roleArn=arn:aws:iam::111122223333:role/EfsCsiRole { "addon": { "addonName": "aws-efs-csi-driver", "status": "CREATING", "addonVersion": "v2.x.x-eksbuild.1", ... } }
aws eks update-addon --cluster-name demo-std --addon-name vpc-cni \ --addon-version v1.2x.y-eksbuild.1 --resolve-conflicts PRESERVE { "update": { "id": "7f1c...", "status": "InProgress", "type": "AddonUpdate", ... } } aws eks describe-addon --cluster-name demo-std --addon-name vpc-cni --query "addon.[addonVersion,status]" [ "v1.2x.y-eksbuild.1", "ACTIVE" ]
PRESERVE keeps any settings you changed by hand. Status goes UPDATING โ ACTIVE. Update add-ons one at a time and check health after each.--configuration-values. Example: aws eks update-addon --cluster-name demo-std --addon-name coredns --configuration-values '{"replicaCount":3}'. See the allowed fields with aws eks describe-addon-configuration --addon-name coredns --addon-version VERSION.Key takeaways
- VPC CNI, CoreDNS, kube-proxy, Pod Identity Agent, and EBS CSI are near-universal.
- Add the LB Controller, an autoscaler, Metrics Server, and CloudWatch Observability on standard clusters.
- Auto Mode bundles most of the core list.
Monitoring & Logs
๐ Metrics
Numbers over time: CPU, memory, requests per second. "How busy?"๐ Logs
Text lines your apps and the cluster write. "What happened?"๐งต Traces
The path of one request through many services. "Where is it slow?"AWS options
| Need | AWS-native choice | Open-source choice |
|---|---|---|
| Cluster/node/pod metrics | CloudWatch Container Insights (CloudWatch Observability add-on) | Prometheus โ Amazon Managed Service for Prometheus |
| Dashboards | CloudWatch dashboards; EKS console Observability tab | Amazon Managed Grafana |
| App logs | Fluent Bit (in the add-on) โ CloudWatch Logs | Fluent Bit โ OpenSearch / Loki |
| Control plane logs | EKS control plane logging โ CloudWatch Logs | โ |
| Traces | ADOT โ AWS X-Ray / CloudWatch Application Signals | OpenTelemetry โ Jaeger/Tempo |
| Upgrade/config problems | Cluster insights | Pluto, kubent |
# Container Insights + logs aws eks create-addon --cluster-name demo --addon-name amazon-cloudwatch-observability # Control plane logs (audit + authenticator) aws eks update-cluster-config --name demo \ --logging '{"clusterLogging":[{"types":["audit","authenticator","api"],"enabled":true}]}' # Set log retention so costs don't grow forever aws logs put-retention-policy --log-group-name /aws/eks/demo/cluster --retention-in-days 30
First-response commands
kubectl get nodes # any NotReady? kubectl get pods -A | grep -v Running # anything unhappy? kubectl top nodes # who is busy? kubectl top pods -A --sort-by=memory | head # memory hogs kubectl get events -A --sort-by=.lastTimestamp | tail -20 # what just happened kubectl logs deploy/hello -n shop --tail=50 # app output
Key takeaways
- Turn on Container Insights (or Prometheus) and audit logs on day one.
- Set log retention.
- Events + logs + top solve most problems.
Patching: Keeping Everything Up to Date
The four layers
| Layer | Who patches | How |
|---|---|---|
| 1. Control plane | AWS | Automatic platform version updates (eks.N). Nothing to do. |
| 2. Nodes (OS + kubelet) | You (standard) / AWS (Auto Mode) | Replace nodes with a newer AMI. |
| 3. Add-ons | You (standard) / AWS for built-ins (Auto Mode) | aws eks update-addon / helm upgrade |
| 4. Your apps & images | You | Rebuild on a patched base image; redeploy. |
How a managed node group update works
(no new pods)
(evict pods, respecting PDBs)
โถ๏ธ Walkthrough: patch a managed node group
aws eks describe-nodegroup --cluster-name demo-std --nodegroup-name ng-general \ --query "nodegroup.[version,releaseVersion,amiType]" [ "1.36", "1.36.x-20261001", "AL2023_x86_64_STANDARD" ]
releaseVersion is the AMI build. The console shows "Update now" on the node group when a newer AMI exists.aws ssm get-parameter --name /aws/service/eks/optimized-ami/1.36/amazon-linux-2023/x86_64/standard/recommended/release_version \ --query Parameter.Value --output text 1.36.x-20261110
aws eks update-nodegroup-version --cluster-name demo-std --nodegroup-name ng-general { "update": { "id": "a2b9...", "status": "InProgress", "type": "VersionUpdate", "params": [ { "type": "Version", "value": "1.36" }, { "type": "ReleaseVersion", "value": "1.36.x-20261110" } ] } }
maxUnavailable.kubectl get nodes -w NAME STATUS VERSION ip-192-168-101-12.us-west-2.compute.internal Ready v1.36.x-eks-aaa ip-192-168-140-77.us-west-2.compute.internal Ready v1.36.x-eks-aaa ip-192-168-120-5.us-west-2.compute.internal Ready v1.36.x-eks-bbb โ new ip-192-168-101-12.us-west-2.compute.internal Ready,SchedulingDisabled v1.36.x-eks-aaa โ cordoned ...
SchedulingDisabled (cordoned), drained, then removed.aws eks describe-update --name demo-std --nodegroup-name ng-general --update-id a2b9... { "update": { "status": "Successful", ... } }
Failed with PodEvictionFailure, a PodDisruptionBudget blocked draining (e.g., minAvailable equals replicas). Fix the PDB, or as a last resort use --force.Patching with other node types
| Node type | How patching works |
|---|---|
| Auto Mode | Automatic. Nodes are replaced with patched images, and no node lives longer than 21 days. Control timing with NodePool disruption budgets (e.g., only during a maintenance window) and protect apps with PDBs. |
| Karpenter | Karpenter's drift feature replaces nodes when the AMI in the EC2NodeClass changes. Use expireAfter to force regular refreshes. |
| Self-managed | Update the launch template AMI; do an Auto Scaling group instance refresh; drain nodes yourself. |
| Fargate | AWS patches the hosts. Pods may be evicted and restarted to apply patches โ PDBs help. |
Key takeaways
- AWS patches the control plane; you (or Auto Mode) patch nodes by replacing them.
aws eks update-nodegroup-versionrolls new AMIs.- PDBs + replicas = zero-downtime patching.
Upgrading EKS (Kubernetes Versions)
The rules
- One minor version at a time (1.35 โ 1.36 โ 1.37). No skipping.
- Control plane first, then nodes, then add-ons.
- Nodes can't be newer than the control plane. kubelet may be up to a few minor versions older (check the version skew policy for your version), but keep them close.
- Kubernetes removes old APIs in some versions. YAML using them will fail after upgrade.
- You can roll back the control plane one minor version within 7 days of an in-place upgrade (with conditions).
The upgrade flow
โ Interactive upgrade checklist
โถ๏ธ Walkthrough: the actual upgrade
aws eks list-insights --cluster-name demo-std --filter '{"categories":["UPGRADE_READINESS"]}' \ --query "insights[].[name,insightStatus.status]" --output table ----------------------------------------------------------------- | ListInsights | +-------------------------------------------------+-------------+ | Deprecated APIs removed in Kubernetes v1.37 | PASSING | | Kubelet version skew | PASSING | | EKS add-on version compatibility | WARNING | | Cluster health issues | PASSING | +-------------------------------------------------+-------------+
aws eks describe-insight --cluster-name demo-std --id ID.aws eks update-addon --cluster-name demo-std --addon-name vpc-cni --addon-version <version-compatible-with-1.37> { "update": { "status": "InProgress", "type": "AddonUpdate", ... } }
aws eks update-cluster-version --name demo-std --kubernetes-version 1.37 { "update": { "id": "b5f0e4f2-...", "status": "InProgress", "type": "VersionUpdate", "params": [ { "type": "Version", "value": "1.37" }, { "type": "PlatformVersion", "value": "eks.1" } ], "errors": [] } }
ACTIVE โ UPDATING โ ACTIVE. Running apps keep working; the API may briefly hiccup. If EKS's health checks fail, it automatically reverts.aws eks describe-update --name demo-std --update-id b5f0e4f2-... { "update": { "status": "Successful", "type": "VersionUpdate", ... } } kubectl version Client Version: v1.37.x Server Version: v1.37.x-eks-xxxxxxx
aws eks update-nodegroup-version --cluster-name demo-std --nodegroup-name ng-general --kubernetes-version 1.37 { "update": { "status": "InProgress", "type": "VersionUpdate", ... } } # eksctl equivalent: eksctl upgrade nodegroup --cluster demo-std --name ng-general --kubernetes-version 1.37
for a in coredns kube-proxy eks-pod-identity-agent aws-ebs-csi-driver metrics-server; do v=$(aws eks describe-addon-versions --addon-name $a --kubernetes-version 1.37 \ --query "addons[0].addonVersions[?compatibilities[0].defaultVersion]|[0].addonVersion" --output text) echo "updating $a -> $v" aws eks update-addon --cluster-name demo-std --addon-name $a --addon-version $v --resolve-conflicts PRESERVE >/dev/null done updating coredns -> v1.1x.x-eksbuild.1 updating kube-proxy -> v1.37.x-eksbuild.1 updating eks-pod-identity-agent -> v1.3.x-eksbuild.1 updating aws-ebs-csi-driver -> v1.5x.x-eksbuild.1 updating metrics-server -> v0.8.x-eksbuild.1
helm upgrade any Helm add-ons (LB Controller, Karpenter) to versions that support 1.37.kubectl get nodes NAME STATUS VERSION ip-192-168-120-5.us-west-2.compute.internal Ready v1.37.x-eks-ccc ip-192-168-151-9.us-west-2.compute.internal Ready v1.37.x-eks-ccc kubectl get pods -A | grep -v -E "Running|Completed" NAMESPACE NAME READY STATUS RESTARTS AGE
Something went wrong? Roll back (within 7 days)
EKS can roll the control plane back one minor version within 7 days of an in-place upgrade. etcd data, workloads, and volumes are kept. Not rolled back: add-ons, managed node groups, self-managed nodes (do those yourself โ nodes first, since nodes can't be newer than the control plane). Auto Mode nodes are rolled back for you.
# 1. Check rollback readiness aws eks list-insights --cluster-name demo-std --filter '{"categories":["ROLLBACK_READINESS"]}' # 2. Roll back managed node groups to 1.36 first (if they were upgraded) aws eks update-nodegroup-version --cluster-name demo-std --nodegroup-name ng-general --kubernetes-version 1.36 # 3. Roll back the control plane (same command, previous version) aws eks update-cluster-version --name demo-std --kubernetes-version 1.36 { "update": { "status": "InProgress", "type": "VersionRollback", ... } }
Upgrade strategies
In-place (above)
Upgrade the same cluster. Simple, cheap. Now has a 7-day rollback safety net.Blue/green
Build a new cluster on the new version, move traffic over (DNS weights or GitOps), then delete the old one. Safest for big jumps, costs more, needs everything in code.Key takeaways
- Insights โ control plane โ nodes โ add-ons โ verify.
- One minor version at a time; plan around the support calendar.
- Rollback exists for 7 days, for the control plane.
EKS Auto Mode vs Standard EKS
EKS Auto Mode extends AWS's management from the control plane to the data plane: nodes, autoscaling (Karpenter-based), load balancing, EBS storage, pod networking, DNS, Pod Identity, and GPU drivers. Standard EKS gives you the control plane and leaves the rest to you.
๐ Comparison chart
| Area | Standard EKS (managed node groups / Karpenter) | EKS Auto Mode | Fargate |
|---|---|---|---|
| Control plane | AWS-managed | AWS-managed | AWS-managed |
| Node provisioning | You configure node groups or install Karpenter | Automatic (built-in Karpenter) | No nodes to manage (1 pod = 1 micro-VM) |
| Node OS / AMI | You choose: AL2023, Bottlerocket, Windows, custom | AWS-chosen Bottlerocket-based, locked (read-only root, SELinux) | AWS-managed |
| OS patching | You trigger AMI updates | Automatic; max node lifetime 21 days | AWS |
| Core add-ons (VPC CNI, CoreDNS, kube-proxy, Pod Identity, EBS CSI) | You install & upgrade (EKS add-ons) | Built in, AWS upgrades | Partially (you manage CoreDNS etc.) |
| Load balancers | Install AWS Load Balancer Controller | Built in | Needs LB Controller (IP targets) |
| Block storage (EBS) | Install EBS CSI add-on | Built in | Not supported (EFS only) |
| GPU / ML chips | You choose GPU AMIs + device plugins | NVIDIA & Neuron drivers included | No |
| SSH / SSM into nodes | Allowed | Not allowed (debug via kubectl) | No |
| DaemonSets | Yes | Yes | No (use sidecars) |
| Custom AMIs / user data | Yes | No (NodeClass options only) | No |
| Spot instances | Yes | Yes (via NodePool) | No (Fargate Spot is ECS-only) |
| Node health repair | Optional (node auto repair) | Built in | AWS |
| Kubernetes upgrades | You upgrade control plane, then nodes, then add-ons | You upgrade control plane; nodes & built-in components follow | You upgrade control plane; restart pods |
| Price | $0.10/hr cluster + EC2 | $0.10/hr cluster + EC2 + Auto Mode fee per managed instance (not reduced by EC2 discounts) | $0.10/hr cluster + per-pod vCPU/memory pricing |
| Operational effort | High | Low | Low |
| Control / flexibility | Highest | Medium | Lowest |
| Best for | Teams needing custom OS, special networking, deep tuning | Most new workloads; small/medium platform teams | Small, isolated, bursty pods |
Things that are different in Auto Mode (gotchas)
- Built-in API groups and names: StorageClass provisioner
ebs.csi.eks.amazonaws.com, IngressClass controllereks.amazonaws.com/alb, ServiceloadBalancerClass: eks.amazonaws.com/nlb, NodeClass groupeks.amazonaws.com. - Built-in node pools
general-purposeandsystemcan be enabled/disabled but not edited โ create your own NodePools for Spot, ARM, or GPU. - The cluster IAM role needs extra policies (Compute, BlockStorageV2, LoadBalancing, Networking); a node IAM role is required.
- Nodes are replaced regularly (โค21 days). Apps must tolerate restarts โ use replicas and PDBs.
- You can turn Auto Mode on for an existing cluster and migrate workloads gradually from node groups.
๐ฏ Decision helper
Tick what is true for you:
Enable Auto Mode on an existing cluster
# Cluster role must first have the extra Auto Mode policies attached. aws eks update-cluster-config --name demo-std \ --compute-config '{"enabled":true,"nodeRoleArn":"arn:aws:iam::111122223333:role/AmazonEKSAutoNodeRole","nodePools":["general-purpose","system"]}' \ --kubernetes-network-config '{"elasticLoadBalancing":{"enabled":true}}' \ --storage-config '{"blockStorage":{"enabled":true}}'
Key takeaways
- Auto Mode = AWS also runs your nodes and core add-ons.
- Trade-off: less control and an extra fee, for much less work.
- Great default for new clusters.
Expert Operations
๐ฉบ Troubleshooting guide (click to expand)
Pod stuck in Pending
Meaning: no node can take it. Check: kubectl describe pod โ Events. Common reasons: Insufficient cpu/memory (autoscaler not working or at max), node selector/taint mismatch, PVC in a different AZ, too many pods per node (IP limit). Fix: lower requests, raise NodePool limits / node group max, fix labels/tolerations.
ImagePullBackOff / ErrImagePull
Wrong image name/tag, image not in that Region, node role missing ECR pull permissions, cross-account repo policy missing, private subnets with no NAT or VPC endpoints (ecr.api, ecr.dkr, S3 gateway), or architecture mismatch (ARM image on x86 node shows exec format error after pulling).
CrashLoopBackOff
The app starts and dies repeatedly. Run kubectl logs POD --previous. Usually a missing env var/secret, bad config, failing liveness probe (too strict), or OOMKilled (raise memory limit โ see kubectl describe pod "Last State").
Node NotReady
kubelet can't reach the API server or the node is unhealthy. Check the node's security groups, VPC CNI pods (kubectl -n kube-system get pods -l k8s-app=aws-node), disk pressure, and the EKS console's node health issues. Node auto repair can replace it.
Unauthorized / Forbidden with kubectl
Unauthorized = your IAM identity has no access entry (or wrong AWS profile/Region โ run aws sts get-caller-identity). Forbidden = you're known but lack RBAC/access policy for that action.
Ingress has no ADDRESS
kubectl describe ingress. Usually: subnets missing kubernetes.io/role/elb tags, LB Controller missing IAM permissions or not running, wrong ingressClassName, or Service name/port typo.
Pods can't get an IP (failed to assign an IP address)
Subnet is out of IPs or the instance hit its ENI limit. Turn on prefix delegation, add subnets/secondary CIDR, or use larger instance types.
Node group update fails with PodEvictionFailure
A PDB blocked draining. Check kubectl get pdb -A for ALLOWED DISRUPTIONS = 0. Scale the app up or relax the PDB, then retry.
Can't delete the VPC after deleting the cluster
Load balancers or ENIs made by the cluster are still there. Always delete Services of type LoadBalancer and Ingresses before deleting the cluster.
Best practices that separate experts from beginners
๐ก๏ธ Reliability
- โฅ2 replicas, PDBs, probes, topology spread across 3 AZs
- Graceful shutdown (handle SIGTERM,
preStophook) - Turn on ARC zonal shift
- Back up with AWS Backup or Velero; test restores
๐ฐ Cost
- Right-size requests (look at real usage)
- Spot + Graviton for flexible work
- Consolidation in Karpenter/Auto Mode
- Stay in standard support (6ร cheaper control plane)
- ECR lifecycle policies; log retention; VPC endpoints vs NAT costs
๐ Security
- Private endpoint, access entries, Pod Identity
- Pod Security Standards + Kyverno/Gatekeeper
- Signed, scanned images from ECR
- GuardDuty, audit logs, KMS secrets encryption
โ๏ธ Operations
- Everything in code (Terraform/CDK + GitOps)
- Upgrade at least twice a year; non-prod first
- Patch nodes monthly (or let Auto Mode do it)
- Use EKS cluster insights before every change
Multi-cluster & advanced topics
| Topic | One-line summary |
|---|---|
| Multi-tenancy | Namespaces + RBAC + quotas (ResourceQuota, LimitRange) + network policies โ or separate clusters for hard isolation. |
| Multi-Region / DR | Clusters in two Regions, ECR replication, GitOps to keep them in sync, Route 53 failover. |
| EKS Capabilities | AWS-managed Argo CD, ACK (create AWS resources like RDS/S3 from Kubernetes YAML), and kro โ running on AWS-owned infrastructure. |
| Provisioned Control Plane | Pre-sized, higher-capacity control plane tiers for very large clusters. |
| EKS Hybrid Nodes | Join on-prem servers to an EKS cluster. |
| EKS Anywhere / EKS on Outposts | Run EKS-style clusters in your own data center or on AWS Outposts. |
| Windows nodes | Run Windows containers in managed node groups (needs a Linux node group too for system pods). |
๐งน Clean up & leftover check (avoid surprise bills)
If you only built a practice cluster, its teardown above is all you need. Use this section if you followed the later lessons (ECR, load balancers, storage, IAM roles), or just want to double-check. First tear down your cluster(s) with the matching guide: Teardown A (Auto Mode) and B (Standard) on the First Cluster page, or Teardown C (Console) on the Console Tour page. Then delete the things that live outside any cluster, and run the leftover check.
1. Shared resources from the lessons
# ECR repository and all its images (storage is billed per GB-month) aws ecr delete-repository --repository-name hello-app --force # Local Docker images (free, but frees disk space) docker rmi hello-app:1.0 111122223333.dkr.ecr.us-west-2.amazonaws.com/hello-app:1.0 # IAM roles you created by hand (detach policies first, then delete) aws iam list-attached-role-policies --role-name ShopS3Read aws iam detach-role-policy --role-name ShopS3Read --policy-arn arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess aws iam delete-role --role-name ShopS3Read
2. Leftover check: run this in every Region you used
Each command should come back empty. If it doesn't, delete what's listed.
export AWS_REGION=us-west-2 aws eks list-clusters { "clusters": [] }
aws ec2 describe-instances --filters Name=instance-state-name,Values=running,pending --query "Reservations[].Instances[].[InstanceId,InstanceType]" --output table (no output)
aws elbv2 describe-load-balancers --query "LoadBalancers[].[LoadBalancerName,Type]" --output table (no output)
k8s- came from your cluster. Delete them in EC2 โ Load Balancers. They also block VPC deletion.aws ec2 describe-volumes --filters Name=status,Values=available --query "Volumes[].[VolumeId,Size,CreateTime]" --output table (no output)
reclaimPolicy: Retain or a cluster deleted before its PVCs. "available" means not attached to anything but still billed.aws ec2 describe-nat-gateways --filter Name=state,Values=available --query "NatGateways[].[NatGatewayId,VpcId]" --output table aws ec2 describe-addresses --query "Addresses[?AssociationId==null].[PublicIp,AllocationId]" --output table (no output)
aws cloudformation list-stacks --stack-status-filter DELETE_FAILED CREATE_COMPLETE --query "StackSummaries[?contains(StackName,'eks')].[StackName,StackStatus]" --output table (no output)
DELETE_FAILED usually means a load balancer or ENI was still in the VPC. Delete that resource, then delete the stack again.aws logs describe-log-groups --log-group-name-prefix /aws/eks --query "logGroups[].logGroupName" aws logs describe-log-groups --log-group-name-prefix /aws/containerinsights --query "logGroups[].logGroupName" aws ecr describe-repositories --query "repositories[].repositoryName" aws efs describe-file-systems --query "FileSystems[].[FileSystemId,Name]" []
aws logs delete-log-group, aws ecr delete-repository --force, or the EFS console).๐ Final exam
You made it!
You can now explain EKS, build clusters, push images to ECR, deploy and expose apps, set up storage, security, add-ons, monitoring, patch nodes, upgrade and roll back versions, and choose between Auto Mode and standard EKS. Next step: rebuild everything with Terraform or CDK and GitOps โ that is how expert teams run EKS.
Command Reference: Manage & Troubleshoot EKS
kubectl, aws, eksctl or helm command for everyday work and troubleshooting.๐ชช "Who am I?" How kubectl sees you
When you run a kubectl command on EKS, several things happen in a chain. Knowing the chain tells you where to look when access fails.
kubeconfig: which cluster + which user entry
aws eks get-token runs with your AWS profilecluster maps your IAM ARN to a Kubernetes user + groups
access policies + RBAC decide what you can do
kubectl config current-context arn:aws:eks:us-west-2:111122223333:cluster/demo kubectl config get-contexts CURRENT NAME CLUSTER AUTHINFO NAMESPACE * arn:aws:eks:us-west-2:111122223333:cluster/demo arn:aws:eks:us-west-2:111122223333:cluster/demo arn:aws:eks:us-west-2:111122223333:cluster/demo arn:aws:eks:us-west-2:111122223333:cluster/demo-std arn:aws:eks:us-west-2:111122223333:cluster/demo-std arn:aws:eks:us-west-2:111122223333:cluster/demo-std shop
* marks the active context. A context = cluster + user (AUTHINFO) + optional default namespace. Always check this before running delete or apply, especially if you have prod and test clusters.kubectl config view --minify clusters: - cluster: server: https://ABCD1234EXAMPLE.gr7.us-west-2.eks.amazonaws.com name: arn:aws:eks:us-west-2:111122223333:cluster/demo contexts: - context: cluster: arn:aws:eks:us-west-2:111122223333:cluster/demo user: arn:aws:eks:us-west-2:111122223333:cluster/demo users: - name: arn:aws:eks:us-west-2:111122223333:cluster/demo user: exec: command: aws args: [--region, us-west-2, eks, get-token, --cluster-name, demo, --output, json] env: - name: AWS_PROFILE value: eks-admin
--minify shows only the active context. The exec section is the key part: kubectl runs aws eks get-token to sign in. If there's an AWS_PROFILE entry, that profile is used. If not, whatever AWS credentials your shell currently has are used. Different terminals can therefore be different people!aws sts get-caller-identity { "UserId": "AROAEXAMPLEID:alex", "Account": "111122223333", "Arn": "arn:aws:sts::111122223333:assumed-role/AWSReservedSSO_AdministratorAccess_abc123/alex" }
get-token uses (unless the kubeconfig sets a different AWS_PROFILE; check with AWS_PROFILE=eks-admin aws sts get-caller-identity). Also confirm the Account is the one the cluster lives in.kubectl auth whoami ATTRIBUTE VALUE Username arn:aws:sts::111122223333:assumed-role/AWSReservedSSO_AdministratorAccess_abc123/alex UID aws-iam-authenticator:111122223333:AROAEXAMPLEID Groups [system:authenticated] Extra: arn [arn:aws:sts::111122223333:assumed-role/AWSReservedSSO_AdministratorAccess_abc123/alex] Extra: canonicalArn [arn:aws:iam::111122223333:role/AWSReservedSSO_AdministratorAccess_abc123] Extra: sessionName [alex]
aws eks list-associated-access-policies --cluster-name demo \ --principal-arn arn:aws:iam::111122223333:role/AWSReservedSSO_AdministratorAccess_abc123 { "associatedAccessPolicies": [ { "policyArn": "arn:aws:eks::aws:cluster-access-policy/AmazonEKSClusterAdminPolicy", "accessScope": { "type": "cluster", "namespaces": [] } } ] }
kubectl auth can-i delete pods -n shop yes kubectl auth can-i --list -n shop | head Resources Non-Resource URLs Resource Names Verbs *.* [] [] [*] ...
can-i checks one action; --list shows everything you're allowed in that namespace. Admins can test another user with --as / --as-group.aws eks update-kubeconfig --name demo --alias demo --profile eks-admin), set a default namespace per context (kubectl config set-context --current --namespace=shop), and show the current context in your shell prompt (tools like kube-ps1, or Starship).๐ Command cheat sheet
Type to search, or click a category. Click Copy to copy a command. Replace demo, shop, POD, NODE etc. with your own names.
๐ฉบ Symptom โ first commands
| Symptom | Run these first | Look for |
|---|---|---|
| Unauthorized from kubectl | kubectl config current-contextaws sts get-caller-identityaws eks list-access-entries --cluster-name demo | Wrong cluster/profile/account/Region, or your role has no access entry. |
| Forbidden from kubectl | kubectl auth whoamikubectl auth can-i VERB RESOURCE -n NS | Known identity, but the access policy or RBAC doesn't allow that action or namespace. |
| Pod Pending | kubectl describe pod PODkubectl get nodepools,nodeclaims (Auto Mode/Karpenter) | Events: Insufficient cpu/memory, taints, node selector, volume AZ, NodePool limits. |
| ImagePullBackOff | kubectl describe pod PODaws ecr describe-images --repository-name REPO | Typo in image/tag, wrong Region, missing ECR permission, no network route to ECR. |
| CrashLoopBackOff | kubectl logs POD --previouskubectl describe pod POD | App error, missing config/secret, OOMKilled, failing liveness probe. |
| Service not reachable | kubectl get endpointslices -n NS -l kubernetes.io/service-name=SVCkubectl describe ingress ING -n NS | No endpoints = selector doesn't match pod labels or pods aren't Ready. Ingress events show LB errors. |
| Node NotReady | kubectl describe node NODEkubectl -n kube-system get pods -o wide | grep NODE | Conditions (DiskPressure, MemoryPressure), aws-node/kube-proxy pods failing. |
| Upgrade or update failed | aws eks list-updates --name demoaws eks describe-update --name demo --update-id IDaws eks list-insights --cluster-name demo | The update's error list; insights with ERROR status. |
Glossary & Sources
Official sources used
- Amazon EKS โ Kubernetes version lifecycle & release calendar
- Amazon EKS โ Automate cluster infrastructure with EKS Auto Mode
- EKS Best Practices โ Auto Mode (built-in NodePools)
- Amazon EKS โ Create a Node Pool for EKS Auto Mode
- Amazon EKS โ Auto Mode cluster IAM role
- Amazon EKS โ Update existing cluster to new Kubernetes version
- Amazon EKS โ Roll back a cluster to a previous Kubernetes version
- Amazon EKS โ Cluster insights / upgrade insights
- Amazon EKS โ Cluster upgrade policy
- Amazon EKS โ Pod Identity vs IRSA
- EKS Best Practices โ Identity and Access Management
- Amazon EKS โ AL2 AMI deprecation (AL2023 / Bottlerocket)
- EKS API โ NodegroupUpdateConfig (maxUnavailable, update strategy)
- AWS Containers Blog โ Extended support pricing
- AWS Containers Blog โ Auto Mode cost and management fee
- AWS Containers Blog โ Provisioned Control Plane
- AWS What's New โ EKS Capabilities (Argo CD, ACK, kro)
- AWS re:Post โ How do I plan an upgrade for my EKS cluster?
- Amazon EKS Pricing ยท Amazon ECR User Guide ยท Kubernetes documentation ยท eksctl docs ยท Karpenter docs