Helm Hour 4: Moving to the Cloud Platform (AWS)
- Draw the Helm deployment architecture on EKS and distinguish the capabilities already built into EKS Auto Mode (load balancing, EBS block storage, Karpenter-style node provisioning, Pod Identity Agent) and the components a standard cluster requires you to install with Helm or EKS add-ons, and avoid reinstalling LBC / Karpenter on Auto Mode.
- Push the chart as an OCI artifact to Amazon ECR:
aws ecr get-login-password | helm registry login, the Repository must be created in advance (or a CREATE_ON_PUSH creation template configured); the Repository name = push path + chart name; the tag = chart version; understand immutable tags why every release must bump the chart version. - Design a "cloud-neutral" chart: Parameterize the ServiceAccount name and annotations, so the same chart can use IRSA (
eks.amazonaws.com/role-arnannotation) as well as Pod Identity (association created on the AWS side, with no annotation on the SA). - Install from the eks-charts Repository AWS Load Balancer Controller, configure IAM and subnet tags, generate an ALB from Ingress annotations, and be able to explain "how one Ingress becomes an ALB and target groups."
- Install with Helm Karpenter (and its NodePool / EC2NodeClass),EBS CSI,External Secrets Operator, and use Pod Identity to fetch from Secrets Manager and sync secrets.
- Build a keyless pipeline: OIDC exchanges for temporary AWS credentials →
aws eks update-kubeconfig→helm upgrade --install --rollback-on-failure, and use EKS access entries to limit the pipeline role to a single namespace. - Troubleshoot the four typical failures of Helm deployments in the cloud (ECR 401, ALB not created, Karpenter not scaling out, Unauthorized), clean up in the correct order, and avoid orphaned ALB / EBS volumes that keep billing.
1-Hour Time Allocation
| # | Time | Module | Core Content | Animation / Interaction | Lab (EKS cluster helm-lab, ca-central-1) |
|---|---|---|---|---|---|
| 0 | Before Class | Warm-up and EKS Setup | Permissions, costs, tool versions; create the cluster with eksctl (access entries + Pod Identity Agent) | Environment self-check list | kubectl get nodes 2 Ready |
| 1 | 00–05 | Helm Deployment Architecture on EKS | Three layers of components: platform add-ons / cluster-level charts / application charts; built into Auto Mode vs self-installed; EKS add-ons vs Helm charts | "Should I install it with Helm?" component selector | Inventory existing cluster components |
| 2 | 05–13 | ECR as an OCI chart repository | registry login, pre-created repositories, naming rules, push/pull/install, digest, immutable tags, CREATE_ON_PUSH template | Animation of the HTTP exchange for helm push to ECR | Push the myapp chart to charts/myapp |
| 3 | 13–21 | Pod Identity / IRSA and Chart Design | SA parameterization, annotation passthrough, Pod Identity associations on the AWS side, trust policy, timing of credential injection | Animation comparing the Pod Identity and IRSA credential chains | Create an association for the myapp SA and verify it |
| 4 | 21–29 | AWS Load Balancer Controller chart | eks-charts, IAM policy, subnet tags, CRD upgrades, Ingress/Service annotations, IngressGroup, current state of Gateway API | Core animation: the full Ingress → ALB process (faults can be injected) | Install LBC, expose myapp externally through an ALB |
| 5 | 29–37 | Karpenter and Other AWS-Related Charts | Karpenter chart + NodePool/EC2NodeClass; EBS CSI (add-on vs chart); ESO + Secrets Manager | Karpenter node provisioning simulator | ESO syncs secrets via Pod Identity |
| 6 | 37–45 | Deploy to EKS from a pipeline | OIDC → STS → update-kubeconfig → helm upgrade; access entries; Azure Pipelines and GitHub Actions variants | Pipeline credential exchange animation | Pipeline upgrade + automatic rollback on failure |
| 7 | 45–54 | Troubleshooting in the Cloud | ECR 401 / name unknown, ALB not created, Karpenter not scaling out, Unauthorized | Fault reproduction simulator + Interactive troubleshooting tree | Reproduce and fix 4 faults |
| 8 | 54–60 | Cost, Cleanup, and Self-Check | Cost breakdown, cleanup order (uninstall releases that create cloud resources first), orphaned resource checks | Cost calculator + cleanup-order sorting game | Full cleanup and verification of zero leftovers |
| — | After Class | Cheat sheet · Capstone Lab | myapp: ECR → EKS → ALB → Secrets Manager → pipeline upgrade/rollback → cleanup in order | Final quiz (12 questions) | Capstone Lab |
Knowledge Coverage Matrix
| Target Skills | M1 | M2 | M3 | M4 | M5 | M6 | M7 | M8 | Key Commands | Lab |
|---|---|---|---|---|---|---|---|---|---|---|
| Distinguish Auto Mode built-in capabilities from components you must install yourself | ✓ | · | · | ✓ | ✓ | · | · | · | aws eks describe-cluster,list-addons | Component inventory |
| Push the chart to ECR and install it from ECR | · | ✓ | · | · | · | ✓ | ✓ | · | helm registry login,helm push | charts/myapp |
| Handle immutable tags and version policy | · | ✓ | · | · | · | ✓ | ✓ | · | put-image-tag-mutability | Repeated push lab |
| Design a chart that supports IRSA / Pod Identity | · | · | ✓ | ✓ | ✓ | · | ✓ | · | create-pod-identity-association | myapp SA |
| Install and configure LBC, Ingress → ALB | ✓ | · | · | ✓ | · | · | ✓ | ✓ | helm upgrade --install aws-load-balancer-controller | Expose myapp via ALB |
| Helm installation of Karpenter / EBS CSI / ESO | ✓ | · | ✓ | · | ✓ | · | ✓ | ✓ | oci://public.ecr.aws/karpenter/karpenter | ESO secret sync |
| Keyless pipeline deployment | · | ✓ | · | · | · | ✓ | ✓ | · | update-kubeconfig,create-access-entry | Upgrade + rollback |
| Locating faults in the cloud | · | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | · | kubectl describe, controller logs | 4 faults |
| Cost control and safe cleanup | · | · | · | ✓ | ✓ | · | · | ✓ | helm uninstall,eksctl delete cluster | Zero-leftover verification |
What this lesson does not cover (and where to learn it)
| Topic | Why not in this lesson | Where to learn |
|---|---|---|
| Helm basics (install / upgrade / rollback usage) | Covered in K8s Lesson 6 and Lesson 1 of this course | Kubernetes 8 hours · Helm Lesson 1 |
| EKS itself: VPC CNI, node types, upgrades, and the full access entries model | Belongs to the Kubernetes on AWS topic; this lesson only covers the parts directly related to Helm deployment | K8s Lesson 7 (EKS) |
| Chart authoring details (templates, schema, tests) | Lesson 2 topic | Helm Lesson 2 |
| AKS / ACR / Workload Identity | Azure version | Helm Lesson 3 |
| GitOps deployment with Argo CD / Flux, Helmfile | Lesson 5 topic (this lesson only covers push-based pipelines) | Helm Lesson 5 |
| Managing EKS and helm_release with Terraform | Belongs to the IaC topic | Terraform 8 hours |
How to use this courseware
Principles · Diagrams · Animations · Commands · Labs · Production Cases · Troubleshooting · Quizzes · Audio · Video. Read "Principles" and "Animations" first, then do the "Labs". All labs incur AWS costs, so read the Module 0 cost notes first.
A quiz score of 70% or higher, or clicking "Mark this module complete", counts toward progress; it is saved in this browser (cleared on refresh if local storage is disabled).
The "Voice" tab reads the script aloud using the browser's built-in Web Speech API (en-US); if no Chinese voice pack is installed, you can read the script directly.
--atomic has been renamed to --rollback-on-failure,--wait uses kstatus, and new installs use server-side apply by default.Module 0 · Warm-up and EKS Setup (complete before class)
- Complete Lesson 1 and Lesson 2: you have locally
myappchart (Flask + gunicorn + Redis,/healthz),helm lintpassing; this lesson adds on top of itserviceAccount,ingress,externalSecretthree sets of values. - An AWS account that can create EKS / EC2 / VPC / IAM / ECR / ELB / Secrets Manager resources (a personal lab account is best; for an enterprise account, check SCP restrictions first).
- Tools: AWS CLI v2, eksctl 0.231.0, kubectl 1.37 (may differ from the cluster by ±1 minor version), Helm 4.3.2, Docker (to build the myapp image), jq.
Costs, permissions, and security risks (read before you start)
| Resource | Billing (order-of-magnitude estimate for ca-central-1) | Notes |
|---|---|---|
| EKS control plane | 0.10 USD / hour (standard support period) | Extended support costs more; see the EKS pricing page for current prices |
| Nodes: 2 × m6i.large (managed node group) | about 0.1 USD / hour / node | The Karpenter lab temporarily adds 1 more node |
| NAT gateway (eksctl creates one by default) | about 0.05 USD / hour + data processing fees | One of the easiest costs to forget |
| ALB | about 0.02–0.03 USD / hour + LCUs | Created by LBC from the Ingress,must be deleted before deleting the cluster |
| ECR storage | about 0.10 USD / GB / month | the chart is only a few KB; the image is about 100 MB |
| Secrets Manager | about 0.40 USD / secret / month + API call fees | Force deletion stops billing immediately |
Total about 0.4–0.5 USD / hour. Clean up on the same day, followingModule 8 for cleanup. Required permissions: in the lab account, the simplest option is an IAM Identity Center user with AdministratorAccess; minimum permissions require eks:*, ec2:* (VPC/subnets/security groups/instances), iam:CreateRole/PassRole/CreatePolicy/CreateOpenIDConnectProvider, cloudformation:* (used by eksctl), ecr:*, elasticloadbalancing:Describe*, secretsmanager:*. Security risks: Do not create long-lived access keys for the pipeline (Module 6 uses OIDC); ALBs are publicly reachable by default, so do not put sensitive data behind them before the lab ends.
Step 1: Check tools and identity
aws --version eksctl version kubectl version --client helm version --short aws sts get-caller-identity export AWS_REGION=ca-central-1 CLUSTER=helm-lab export ACCT=$(aws sts get-caller-identity --query Account --output text) export REG=$ACCT.dkr.ecr.$AWS_REGION.amazonaws.com echo "$ACCT $REG"
aws-cli/2.x.x Python/3.x Linux/6.x
0.231.0
Client Version: v1.37.1
v4.3.2+g...
{
"UserId": "AROAEXAMPLE:andy",
"Account": "111122223333",
"Arn": "arn:aws:sts::111122223333:assumed-role/AWSReservedSSO_Admin_xxxx/andy"
}
111122223333 111122223333.dkr.ecr.ca-central-1.amazonaws.com
Step 2: Create helm-lab with eksctl (Standard mode + access entries + Pod Identity Agent)
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: helm-lab
region: ca-central-1
version: "1.37"
tags:
karpenter.sh/discovery: helm-lab # used by Module 5 Karpenter to discover subnets and security groups
accessConfig:
authenticationMode: API # use access entries only
iam:
withOIDC: true # enabled only to compare with IRSA; Pod Identity does not need it
addons:
- name: vpc-cni
- name: coredns
- name: kube-proxy
- name: eks-pod-identity-agent # required in Standard mode; built into Auto Mode
- name: aws-ebs-csi-driver
useDefaultPodIdentityAssociations: true
managedNodeGroups:
- name: ng-base
instanceType: m6i.large
desiredCapacity: 2
minSize: 2
maxSize: 3
privateNetworking: true
labels: { role: base }
eksctl create cluster -f helm-lab.yaml # about 15–20 min kubectl get nodes -o wide aws eks list-addons --cluster-name $CLUSTER --output table
NAME STATUS ROLES AGE VERSION ip-192-168-101-23.ca-central-1.compute.internal Ready <none> 3m v1.37.x-eks-xxxx ip-192-168-140-77.ca-central-1.compute.internal Ready <none> 3m v1.37.x-eks-xxxx ----------------------------- | ListAddons | +---------------------------+ || addons || |+-------------------------+| || aws-ebs-csi-driver || || coredns || || eks-pod-identity-agent || || kube-proxy || || vpc-cni || |+-------------------------+|
eks-lab uses Auto Mode; the two are complementary.kubernetes.io/role/elb=1, and private subnets tagged with kubernetes.io/role/internal-elb=1. LBC uses these tags to discover subnets automatically. If you use an existing VPC, check the tags first as described in Module 4.Step 3: Prepare the myapp image (reuse the Docker lesson)
aws ecr create-repository --repository-name myapp --image-scanning-configuration scanOnPush=true \ --image-tag-mutability IMMUTABLE --region $AWS_REGION aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $REG cd ~/helmlab/myapp-src # source directory for building myapp in Lesson 1 (listens on 5000, has /healthz) docker build -t $REG/myapp:1.0 --build-arg APP_VERSION=1.0 . docker build -t $REG/myapp:1.1 --build-arg APP_VERSION=1.1 . docker push $REG/myapp:1.0 && docker push $REG/myapp:1.1
Image Repository myapp and the chart Repository charts/myapp (Module 2) separately: mixing image tags and chart version tags in one repository causes conflicts and makes it harder to set different lifecycle policies. The node role of a managed node group includes by default AmazonEC2ContainerRegistryPullOnly (or the older ReadOnly), so it can pull images from ECR in this account directly.
Warm-up: answer from memory (30 seconds)
helm upgrade --install release records are stored where?
By default they are stored in a Secret in the release's namespace, named sh.helm.release.v1.<name>.v<N> (Lesson 1). This means the pipeline role needs at least permission to read and write Secrets in the target namespace; Module 6 uses this when granting access entries.
In an OCI Repository,helm push and helm install how do they differ in reference format?
helm push The target of does not include the chart name and tag (oci://host/charts), the chart name automatically becomes the last segment of the Repository and the version becomes the tag; helm install/pull/show you must write the full reference oci://host/charts/myapp --version 0.4.0.
In Helm 4, --atomic was changed to what?
--rollback-on-failure (the old flag still works but prints a warning).
Module 1 · Helm Deployment Architecture on EKS
- Draw the three-layer structure of Helm deployments on EKS: platform layer (VPC CNI, CoreDNS, kube-proxy, Pod Identity Agent, EBS CSI, etc.) → cluster-level charts (LBC, Karpenter, ESO, cert-manager, ...) → application charts (myapp).
- Name the capabilities built into EKS Auto Mode, and know that on an Auto Mode cluster you should not install LBC / Karpenter / EBS CSI with Helm again to manage the same kinds of resources.
- Choose between “EKS managed add-ons” and “Helm charts,” and explain the role Helm plays in each choice.
What: which layers make up a Helm deployment on EKS
The EKS control plane is managed by AWS. Helm is just a Kubernetes API client: it renders templates, calls the API Server, and writes release records as Secrets,and it does not call any AWS API directly. The controllers inside the cluster are what actually talk to AWS (LBC calls ELBv2, Karpenter calls EC2, ESO calls Secrets Manager), and they need IAM identities. This is the theme that recurs throughout this lesson: Helm installs the controllers; the controllers call AWS using IAM.
| Layer | Typical components | Who installs it in Standard mode | In Auto Mode |
|---|---|---|---|
| Platform layer (nodes and networking) | VPC CNI, CoreDNS, kube-proxy, eks-pod-identity-agent | EKS managed add-ons (aws eks create-addon / eksctl addons:) | AWS-managed; the corresponding DaemonSet/Deployment is not visible in the cluster |
| Storage | EBS CSI driver (ebs.csi.aws.com) | EKS add-on (recommended) or Helm chart aws-ebs-csi-driver | Built-in driver ebs.csi.eks.amazonaws.com, you must create the StorageClass yourself; the EFS CSI still needs to be installed manually |
| Load balancing | AWS Load Balancer Controller | Helm chart (eks-charts, Module 4 of this lesson) | Built in: IngressClass controller eks.amazonaws.com/alb, Service loadBalancerClass: eks.amazonaws.com/nlb |
| Node provisioning | Karpenter / Cluster Autoscaler | Helm chart (oci://public.ecr.aws/karpenter/karpenter, Module 5) | Built-in managed Karpenter; NodePool + NodeClass (eks.amazonaws.com/v1) |
| Secrets / certificates / DNS / observability | External Secrets, Secrets Store CSI + ASCP, cert-manager, external-dns, Prometheus | Helm chart (some also have EKS community or marketplace add-ons) | Likewise must be self-installed (not built into Auto Mode) |
| Applications | myapp, shop | Helm chart (pulled from ECR, Module 2) + pipeline (Module 6) | Same |
Why: why the boundaries must be drawn first
- Two controllers competing for the same resources: If you install LBC again on an Auto Mode cluster and IngressClass / loadBalancerClass is ambiguous, two controllers may both ignore (or both try to handle) the same Ingress/Service. The correct approach is to explicitly specify, for each object,
ingressClassName/loadBalancerClass. During migration the two coexist briefly and are switched over one by one. - An EKS add-on and Helm both managing the same component (for example, first
create-addon aws-ebs-csi-driverand then againhelm install aws-ebs-csi-driver): the two "owners" take turns overwriting the same objects; Helm 4's server-side apply reports field-manager conflicts, and the EKS add-on changes the configuration back to its own version. - Upgrade cadences differ: EKS add-ons have a compatibility list matched to cluster versions (
describe-addon-versions); with a Helm chart you must track the chart and controller versions and CRD upgrades yourself (Helm does not upgradecrds/CRDs in the directory).
How: choosing between an EKS add-on and a Helm chart
| EKS managed add-on | Helm chart | |
|---|---|---|
| Install/upgrade | aws eks create-addon / update-addon, with compatibility with the cluster version verified by AWS | helm upgrade --install, you are responsible for the version matrix and CRDs |
| Configuration | --configuration-values (a restricted subset of JSON Schema) | Full values; a post-renderer can be added (in Helm 4 it must be a plugin) |
| IAM | can directly include a Pod Identity association (--pod-identity-associations) | set the SA in the chart; the association and annotations are created separately on the AWS side |
| Drift handling | Managed fields that are changed get corrected,--resolve-conflicts controls override behavior | Helm 4 SSA conflicts require --force-conflicts or manual handling |
| Suited for | components that AWS provides as add-ons, such as VPC CNI, CoreDNS, kube-proxy, Pod Identity Agent, EBS/EFS CSI, ADOT | LBC, Karpenter, ESO, cert-manager, and business applications |
When: Helm's role across three cluster types
- Standard mode + managed node groups (main path of this lesson): The platform layer uses EKS add-ons; LBC / Karpenter / ESO use Helm; applications use Helm.
- Auto Mode: Helm only handles what Auto Mode does not provide, plus applications: ESO, cert-manager, external-dns, monitoring, myapp. IngressClass and IngressClassParams, and NodePool and NodeClass, can be placed in your platform chart as ordinary resources.
- Mixed migration period: Old Ingresses keep using the LBC
albclass, and new Ingresses use the Auto Mode class; after everything is migrated,helm uninstall aws-load-balancer-controller.
helm list , so do not use Helm to upgrade objects created by an add-on.Architecture diagram: full view of Helm deployment on EKS
Decision diagram: who should install this component?
Interactive: “Should I install it with Helm?” component selector
Select the cluster type first, then click a component. The right side shows the recommended install method, Helm's role, and common “duplicate install” pitfalls.
Core commands: inventory “who installed what” in the cluster
| Command | Purpose | Notes |
|---|---|---|
aws eks describe-cluster --name $CLUSTER --query cluster.computeConfig | Whether Auto Mode is enabled | enabled: true indicates Auto Mode; also check storageConfig,kubernetesNetworkConfig.elasticLoadBalancing |
aws eks list-addons --cluster-name $CLUSTER | List EKS managed add-ons | Objects managed by add-ons do not appear in helm list |
helm list -A | List all Helm releases | Cluster-level charts are usually in kube-system / a dedicated namespace |
kubectl get ingressclass,storageclass | Check who provides load balancing / storage | ingress.k8s.aws/alb = LBC; eks.amazonaws.com/alb = Auto Mode |
kubectl get deploy,ds -n kube-system -L app.kubernetes.io/managed-by | Distinguish objects by manager | Objects managed by Helm carry app.kubernetes.io/managed-by=Helm |
aws eks describe-addon-versions --addon-name aws-ebs-csi-driver --kubernetes-version 1.37 | Add-on compatible versions | Check before choosing an add-on version |
aws eks describe-cluster --name $CLUSTER \
--query '{auto:cluster.computeConfig.enabled,lb:cluster.kubernetesNetworkConfig.elasticLoadBalancing.enabled,auth:cluster.accessConfig.authenticationMode}'
helm list -A
kubectl get ingressclass,storageclass
kubectl get deploy,ds -n kube-system -L app.kubernetes.io/managed-by
{
"auto": null,
"lb": null,
"auth": "API"
}
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
storageclass.storage.k8s.io/gp2 kubernetes.io/aws-ebs Delete WaitForFirstConsumer false 25m
NAME READY UP-TO-DATE AVAILABLE MANAGED-BY
deployment.apps/coredns 2/2 2 2
deployment.apps/ebs-csi-controller 2/2 2 2
NAME DESIRED CURRENT READY MANAGED-BY
daemonset.apps/aws-node 2 2 2
daemonset.apps/ebs-csi-node 2 2 2
daemonset.apps/eks-pod-identity-agent 2 2 2
daemonset.apps/kube-proxy 2 2 2
How to verify: In Standard mode, computeConfig is empty; platform components are all in kube-system and carry no Helm labels (they are managed by EKS add-ons). On an Auto Mode cluster you will not see Pods such as aws-node, kube-proxy, or ebs-csi. Common mistakes: Treating gp2 (an in-tree name, actually handled by CSI migration) as gp3; Module 5 creates a new gp3 StorageClass. Production use: Put this inventory into the cluster handover checklist to ensure each capability has exactly one owner.
Lab 1: write a "component ownership list" for helm-lab (about 4 min)
aws eks list-addons --cluster-name $CLUSTER --query addons --output text | tr '\t' '\n' | sed 's/^/addon /' helm list -A -o json | jq -r '.[] | "helm \(.namespace)/\(.name) \(.chart)"'
addon aws-ebs-csi-driver addon coredns addon eks-pod-identity-agent addon kube-proxy addon vpc-cni
aws eks list-pod-identity-associations --cluster-name $CLUSTER \ --query 'associations[].[namespace,serviceAccount,associationId]' --output table
-------------------------------------------------------------- | ListPodIdentityAssociations | +-------------+--------------------------+-------------------+ | kube-system| ebs-csi-controller-sa | a-abcd1234efgh5 | +-------------+--------------------------+-------------------+
This is what "the association is on the AWS side" means: kubectl get sa ebs-csi-controller-sa -n kube-system -o yaml shows no IAM annotations.
Capability Owner Version / Source Network / DNS EKS add-on vpc-cni, coredns, kube-proxy Pod credentials EKS add-on eks-pod-identity-agent Block storage EKS add-on aws-ebs-csi-driver (Pod Identity) Load balancing Helm (Module 4) eks/aws-load-balancer-controller 3.6.3 Node provisioning Helm (Module 5, optional) oci://public.ecr.aws/karpenter/karpenter 1.15.2 Secret sync Helm (Module 5) external-secrets/external-secrets 2.15.0 Applications Helm (Module 2/6) oci://$REG/charts/myapp
Case 1: two ALBs appeared after migrating to Auto Mode
Problem: The team enabled Auto Mode on an existing cluster without uninstalling LBC; the newly created IngressClass was also named alb, which overrode the original definition. Approach: Inventory each Ingress's ingressClassName, and create separate names for Auto Mode (e.g. alb-auto) IngressClass + IngressClassParams; the application chart parameterizes ingress.className it, switching in batches; uninstall LBC once everything is migrated. Limitation: Switching IngressClass creates a new ALB, and DNS records must be switched at the same time.
Case 2: EBS CSI managed by both an add-on and Helm
Problem: The platform team used Terraform to create the aws-ebs-csi-driver add-on, and the application team installed a Helm chart with the same name in Argo CD; the two keep overwriting the Deployment every few minutes. Approach: Make the add-on the sole owner; helm uninstall before that, confirm the chart will not delete the CSIDriver object created by the add-on (if necessary, --keep-history and check manually). Configuration: When custom parameters are needed, use --configuration-values.
Case 3: a platform chart standardizes cluster-level components
Problem: 10 clusters each manually installed helm install LBC/ESO, with inconsistent versions. Approach: Build a "platform chart inventory" (Helmfile or Argo CD ApplicationSet, Lesson 5) that pins chart versions, values, and CRD upgrade steps; in the inventory for Auto Mode clusters, remove LBC/Karpenter and keep only the IngressClass/NodePool resources. Limitations: CRD upgrades still need a separate step.
Common errors and fixes
Error: UPGRADE FAILED: conflict occurred while applying object kube-system/ebs-csi-controller apps/v1, Kind=Deployment: Apply failed with 1 conflict: conflict with "eks" ...
Cause: Helm 4 uses server-side apply, and the target object's fields are already owned by another manager (here, the EKS add-on).
kubectl get deploy ebs-csi-controller -n kube-system --show-managed-fields -o yaml | grep -A2 manager: aws eks list-addons --cluster-name $CLUSTER
Fix: Do not have Helm manage a component that an add-on already manages; pick one. If you really need to take over, first delete the add-on (aws eks delete-addon --preserve keep the objects), then let Helm take over.
The Ingress has no address, the events are empty, and kubectl get ingressclass shows both ingress.k8s.aws/alb and eks.amazonaws.com/alb
Cause:ingressClassName It points to a class that does not exist or is misspelled, or it relies on the "default IngressClass" while the cluster has two default classes.
kubectl get ingressclass -o custom-columns=NAME:.metadata.name,CTRL:.spec.controller,DEFAULT:.metadata.annotations.ingressclass\.kubernetes\.io/is-default-class kubectl get ingress -A -o custom-columns=NS:.metadata.namespace,NAME:.metadata.name,CLASS:.spec.ingressClassName
Fix: Set the class explicitly in the application chart ingressClassName and keep only one default class.
After running helm install karpenter on an Auto Mode cluster, two NodePool CRD sets conflict / nodes are reclaimed unexpectedly
Cause: Auto Mode already runs managed Karpenter, and the self-installed Karpenter duplicates it.
Fix: Uninstall the self-installed Karpenter and use the Auto Mode NodePool instead (nodeClassRef.group: eks.amazonaws.com). See K8s Lesson 7, Module 5.
helm list -A does not show coredns / vpc-cni, but you want to upgrade them with helm upgrade
Cause: They are EKS managed add-ons, not Helm releases.
aws eks describe-addon --cluster-name $CLUSTER --addon-name coredns --query addon.addonVersion aws eks update-addon --cluster-name $CLUSTER --addon-name coredns --addon-version VERSION --resolve-conflicts PRESERVE
1. Use one command to determine whether the cluster has Auto Mode load balancing enabled.
aws eks describe-cluster --name $CLUSTER --query cluster.kubernetesNetworkConfig.elasticLoadBalancing.enabled
2. List all Deployments in kube-system that are managed by Helm.
kubectl get deploy -n kube-system -l app.kubernetes.io/managed-by=Helm
A company has created new EKS clusters with Auto Mode enabled, but its platform Helmfile still includes LBC, Karpenter, aws-ebs-csi-driver, external-secrets, and cert-manager. How should it be adjusted?
Remove LBC, Karpenter, and aws-ebs-csi-driver (Auto Mode provides these capabilities built in); keep external-secrets and cert-manager (Auto Mode does not include them). Add a platform chart that renders the IngressClass + IngressClassParams, NodePool + NodeClass, and gp3 StorageClass (provisioner ebs.csi.eks.amazonaws.com) that Auto Mode requires. The application chart's ingress.className changes to the Auto Mode class name.
Verified teaching videos
Official docs
- Automate cluster infrastructure with EKS Auto Mode
- Amazon EKS add-ons
- Deploy applications with Helm on Amazon EKS
- Helm docs
Video storyboard (about 75 seconds)
This courseware cannot generate video directly; the storyboard below can be handed to a video tool.
Visual: a three-layer cake: the bottom layer “platform add-ons,” the middle layer “cluster-level charts,” the top layer “application charts.”
Narration: on EKS, Helm installs the middle and top layers; the bottom layer is handled by EKS managed add-ons.
Visual: an "Auto Mode" toggle switch; the LBC and Karpenter icons from the middle layer float into an AWS cloud.
Narration: once Auto Mode is enabled, load balancing, storage, and node provisioning are managed by AWS; do not install them again with Helm.
Visual: an LBC Pod extends a line to the ELB icon, with IAM written on the line.
Narration: remember: Helm only talks to the Kubernetes API; the controllers that call AWS need their own IAM identities.
Module 2 · ECR as an OCI Chart Repository
- Use
aws ecr get-login-password | helm registry login --username AWS --password-stdin <registry>to log in; know that the token expires after 12 hours and that the login target must be just a hostname. - Explain
helm push myapp-0.4.0.tgz oci://$REG/chartswhere it is written in ECR (charts/myapp), with which tag (0.4.0), and why the Repository must exist first. - Understand how ECR immutable tags (IMMUTABLE / IMMUTABLE_WITH_EXCLUSION) affect the chart release process, and use a digest to pin production deployments.
What: how ECR stores Helm charts
Amazon ECR is a private registry that follows the OCI Distribution specification; besides container images it can also store OCI artifacts. helm push Packaging .tgz as an OCI manifest: the media type of the config layer is application/vnd.cncf.helm.config.v1+json, and the chart content layer is application/vnd.cncf.helm.chart.content.v1.tar+gzip (if there is .prov a signature file, it is uploaded as an extra layer). aws ecr describe-images In artifactMediaType the field confirms that it is a chart and not an image.
Naming rules (the most error-prone part)
| The command you write | The Repository in ECR | Tag |
|---|---|---|
helm push myapp-0.4.0.tgz oci://$REG | myapp | 0.4.0 |
helm push myapp-0.4.0.tgz oci://$REG/charts | charts/myapp | 0.4.0 |
helm install x oci://$REG/charts/myapp --version 0.4.0 | Pull charts/myapp:0.4.0 | — |
Key points from the helm.sh documentation: a push reference must not include the chart name and tag; the chart name becomes the last segment of the Repository, and the tag comes from the chart's SemVer version. pull / show / template / install / upgrade, however, need the full reference that includes the chart name. This course's convention: charts go under the charts/ prefix, and images go in repositories without a prefix, to avoid myapp:1.0 (images) and myapp:0.4.0 (charts) being mixed in the same Repository.
Why: why the Repository must be created in advance
Unlike Docker Hub and GHCR, ECR does not create Repositories automatically on push: pushing to a non-existent Repository returns name unknown: The repository with name 'charts/myapp' does not exist …. The official AWS Helm push steps explicitly require first aws ecr create-repository, and the Repository name must match the chart name. Since 2025-12, ECR supports create on push: a push creates the Repository automatically only when a repository creation template (repository creation template; applicable scenarios include CREATE_ON_PUSH) whose prefix matches the push. Without a matching template, the push still fails. For production, create Repositories explicitly with Terraform/CloudFormation, and set scanning, encryption, tag mutability, and lifecycle policies.
How: login and credentials
aws ecr get-login-passwordCallingecr:GetAuthorizationToken, the returned password is valid for the entire registry (account + region),valid for 12 hours; the username is fixed asAWS.helm registry loginmust be just a hostname (a port is allowed), with nooci://or path. Credentials are saved in Helm's registry configuration file (by default~/.config/helm/registry/config.json, which can be changed with--registry-configor the environment variableHELM_REGISTRY_CONFIGto change the location).- IAM actions required for push:
ecr:GetAuthorizationToken,ecr:BatchCheckLayerAvailability,ecr:InitiateLayerUpload,ecr:UploadLayerPart,ecr:CompleteLayerUpload,ecr:PutImage; pull needsecr:BatchGetImage,ecr:GetDownloadUrlForLayer. - ECR Public (such as the
public.ecr.aws) can be pulled anonymously; logging in requiresaws ecr-public get-login-password --region us-east-1. Stale leftover public.ecr.aws credentials can actually cause 403: the Karpenter official docs recommend firsthelm registry logout public.ecr.aws.
Impact of immutable tags on charts
| Setting | Behavior | Meaning for chart releases |
|---|---|---|
MUTABLE | The same tag can be overwritten | 0.4.0 Today and tomorrow may be two different packages; rolling back to "0.4.0" is no longer reliable |
IMMUTABLE | Pushing an existing tag returns ImageTagAlreadyExistsException | Every release must bump the chart version version; re-running the same commit in CI fails, so you need "skip if it already exists" logic |
IMMUTABLE_WITH_EXCLUSION / MUTABLE_WITH_EXCLUSION | A wildcard filter excludes a few tags from the rule | For example, everything except latest,*-dev is immutable |
Helm charts version must be SemVer 2; OCI tags do not allow +, so when Helm pushes it replaces the + in build metadata with _ (and converts it back on pull). To avoid confusion, when CI generates pre-release versions, use forms like 0.4.1-rc.20261115.7 that do not contain + . The strongest way to pin is a digest:helm install … oci://$REG/charts/myapp@sha256:…, and a digest itself is immutable, regardless of Repository settings.
When: ECR vs other chart repositories
| ECR (private) | ACR (Lesson 3) | GitHub Pages / chart-releaser HTTP repository | |
|---|---|---|---|
| Protocol | OCI | OCI | index.yaml + tgz |
| Authentication | IAM (12-hour token) | Entra ID (az acr login) | Usually public |
| Automatic repository creation | No (unless a CREATE_ON_PUSH template) | Yes | — |
| Immutable | Repository-level setting + exclusion filter | Locked per tag/Repository | None |
| helm search | Not supported (OCI has no index) | Not supported | Supported |
helm repo add "You can add ECR"—OCI Repositories do not use helm repo add; write oci:// references directly in the command. ② "If docker login succeeded, Helm can push"—Helm has its own registry configuration file (some versions fall back to reading Docker credentials, but do not rely on it); explicitly helm registry login. ③ "ECR creates the Repository automatically on push"—it does not by default, unless a matching CREATE_ON_PUSH template is configured.Sequence diagram: helm push to ECR
Structure diagram: the ECR layout for this lesson
Animation: what happens in ECR during one helm push
Choose a scenario, then click "Play." The log area shows real command output and HTTP exchanges (hostnames and digests are examples).
Core commands and parameters
| Command | Purpose | Key parameters / notes |
|---|---|---|
aws ecr create-repository | Pre-create the chart Repository | --repository-name charts/myapp --image-tag-mutability IMMUTABLE |
aws ecr get-login-password | helm registry login | Log in to the registry | --username AWS --password-stdin $REG; the target is just the hostname |
helm package | Package | --version,--app-version overwrites Chart.yaml |
helm push | Push | oci://$REG/charts (excluding the chart name) |
helm show chart|values oci://… | View without downloading | --version 0.4.0 |
helm pull oci://… | Download tgz | --version,--untar |
helm upgrade --install … oci://…@sha256:… | install by digest | Strongest way to pin |
aws ecr describe-images | View tags, digest, and media type | --query 'imageDetails[].[imageTags[0],imageDigest,artifactMediaType]' |
aws ecr create-repository-creation-template | CREATE_ON_PUSH template | --prefix charts --applied-for CREATE_ON_PUSH |
# 1) Pre-create the Repository (name = push path + chart name) aws ecr create-repository --repository-name charts/myapp \ --image-tag-mutability IMMUTABLE --region $AWS_REGION # 2) Log in (hostname only, without oci://) aws ecr get-login-password --region $AWS_REGION | \ helm registry login --username AWS --password-stdin $REG # 3) Package and push helm package ./myapp --version 0.4.0 --app-version 1.0 helm push myapp-0.4.0.tgz oci://$REG/charts
{ "repository": { "repositoryName": "charts/myapp", "imageTagMutability": "IMMUTABLE", ... } }
Login Succeeded
Successfully packaged chart and saved it to: /home/andy/myapp-0.4.0.tgz
Pushed: 111122223333.dkr.ecr.ca-central-1.amazonaws.com/charts/myapp:0.4.0
Digest: sha256:6f1c0e5a7d2b9c3e8f4a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d0e
# 4) Verify that it is a chart, not an image aws ecr describe-images --repository-name charts/myapp \ --query 'imageDetails[].[imageTags[0],artifactMediaType,imageSizeInBytes]' --output table # 5) View without downloading helm show chart oci://$REG/charts/myapp --version 0.4.0
------------------------------------------------------------------- | DescribeImages | +-------+---------------------------------------------+-----------+ | 0.4.0| application/vnd.cncf.helm.config.v1+json | 4123 | +-------+---------------------------------------------+-----------+ apiVersion: v2 appVersion: "1.0" name: myapp type: application version: 0.4.0
How to verify:artifactMediaType the helm.config output indicates the push was a chart. Common mistakes: Putting oci://$REG/charts/myapp into helm push, which pushed to charts/myapp/myapp (does not exist → 404). Production use: The pipeline outputs the digest and records it in the release ticket; production deploys by digest.
Optional: CREATE_ON_PUSH Repository creation template
aws ecr create-repository-creation-template --prefix charts \ --applied-for CREATE_ON_PUSH --image-tag-mutability IMMUTABLE \ --description "Helm charts" --region $AWS_REGION # After the first push of charts/newchart, the Repository is created automatically from the template (a push still fails if no template matches)
If the template does not specify a custom role, ECR uses a service-linked role; creating a template requires ecr:CreateRepositoryCreationTemplate, and the pusher still needs ecr:CreateRepository permissions on the target Repository. For parameter names, see the official documentation .
Lab 2: push the myapp chart to ECR and experience immutable tags (about 7 min)
myapp/values.yaml:
image: repository: 111122223333.dkr.ecr.ca-central-1.amazonaws.com/myapp # replace with $REG/myapp tag: "" # when empty, the template uses .Chart.AppVersion pullPolicy: IfNotPresent
sed -i "s#^ repository: .*# repository: $REG/myapp#" myapp/values.yaml helm lint ./myapp
helm push myapp-0.4.0.tgz oci://$REG/charts
Error: failed to perform "Push" on destination: PUT "https://111122223333.dkr.ecr.ca-central-1.amazonaws.com/v2/charts/myapp/manifests/0.4.0": response status code 400: TAG_INVALID: The image tag '0.4.0' already exists in the 'charts/myapp' repository and cannot be overwritten because the repository is immutable.
This is exactly the value of immutable tags: 0.4.0 is always the same package. The fix is to bump the version, not to turn immutability off.
sed -i 's/^version: .*/version: 0.4.1/' myapp/Chart.yaml helm package ./myapp && helm push myapp-0.4.1.tgz oci://$REG/charts 2>&1 | tee push.log DIGEST=$(grep -o 'sha256:[a-f0-9]*' push.log) helm pull oci://$REG/charts/myapp@$DIGEST -d /tmp/pulled && ls /tmp/pulled
Pushed: 111122223333.dkr.ecr.ca-central-1.amazonaws.com/charts/myapp:0.4.1 Digest: sha256:0b9d… myapp-0.4.1.tgz
helm registry logout $REG then run helm show chart oci://$REG/charts/myapp --version 0.4.1, observe the 401 error; log in again to restore access.cat > lifecycle.json <<'EOF'
{"rules":[{"rulePriority":1,"description":"keep last 30","selection":{"tagStatus":"any","countType":"imageCountMoreThan","countNumber":30},"action":{"type":"expire"}}]}
EOF
aws ecr put-lifecycle-policy --repository-name charts/myapp --lifecycle-policy-text file://lifecycle.json
Note: old versions removed by the lifecycle policy can no longer be used for re-installs other than helm rollback (rollback uses the rendered chart saved in the release Secret, so it does not need to pull again).
Case 1: overwriting the same version number broke rollback
Problem: The chart Repository was MUTABLE, and CI pushed 1.2.0. After an incident, reinstalling "1.2.0" in another cluster gave new code. Approach: Change the Repository to IMMUTABLE; CI uses major.minor.build-number to generate the chart version; the deployment record stores the digest. Limitation: Making the Repository immutable does not affect tags that already exist.
Case 2: sharing a chart across accounts
Problem: The chart lives in the ECR of a shared service account; pipelines in the dev/prod accounts need to pull it. Approach: Add charts/* a repository policy to the Repository that allows the deploy roles of each account to ecr:BatchGetImage,ecr:GetDownloadUrlForLayer; the puller in its own account calls get-login-password, but logs in to the registry hostname of the shared account (the token returned by GetAuthorizationToken works for other accounts' registries where access is granted). Limitation: each cross-account registry requires its own helm registry login.
Case 3: supply-chain control for open-source charts
Problem: Production clusters are not allowed to access public chart Repositories directly. Approach: The pipeline pulls charts such as Karpenter and LBC helm pull down, scans them, and then helm push pushes them to the charts/vendor/ prefix of the internal ECR; clusters install only from the internal ECR. ECR's pull through cache also supports upstreams such as ECR Public (follow the officially supported upstream list). Limitation: Images must be mirrored the same way, and the chart's values must be rewritten to point to the mirrored image addresses.
Common errors and fixes
Error: … name unknown: The repository with name 'charts/myapp' does not exist in the registry with id '111122223333'
Cause: The Repository was not pre-created; or the push reference included the chart name by mistake (pushed to charts/myapp/myapp); or the region is wrong.
aws ecr describe-repositories --query 'repositories[].repositoryName' --region $AWS_REGION
Fix:aws ecr create-repository --repository-name charts/myapp; push only to oci://$REG/charts; or configure a CREATE_ON_PUSH template.
Error: … 401 Unauthorized / failed to authorize: failed to fetch oauth token
Cause: Not logged in, the token is older than 12 hours, you logged in to a hostname in another region/account, or the IAM principal lacks ecr:GetAuthorizationToken. (The similar Docker-side error is no basic auth credentials.)
aws sts get-caller-identity aws ecr get-login-password --region $AWS_REGION | helm registry login --username AWS --password-stdin $REG
Error: … 403 Forbidden when pulling oci://public.ecr.aws/karpenter/karpenter
Cause: Expired public.ecr.aws credentials are saved locally, and Helm sends them with the request, which is rejected; public Repositories can be pulled anonymously.
helm registry logout public.ecr.aws
TAG_INVALID … already exists … cannot be overwritten because the repository is immutable
Cause: The same chart version already exists in the IMMUTABLE Repository.
Fix: Bump Chart.yaml of the version; in CI, first aws ecr describe-images --image-ids imageTag=$VER check whether it already exists, and skip the push if it does.
Error: invalid_reference: invalid tag / helm push reports that the version is invalid
Cause: The chart version is not SemVer (for example, v1,1.0), or wrote :tag in the reference by hand.
Fix: Use MAJOR.MINOR.PATCH[-prerelease]; the push reference does not include a tag.
1. Without installing it, view the default values of the myapp chart 0.4.1 in ECR.
helm show values oci://$REG/charts/myapp --version 0.4.1
2. List all chart versions and digests in the charts/myapp Repository.
aws ecr describe-images --repository-name charts/myapp --query 'sort_by(imageDetails,&imagePushedAt)[].[imageTags[0],imageDigest]' --output text
After merging to main, CI re-ran once (the same commit) and the push step failed with TAG_INVALID, so the deploy step did not run. How would you change the pipeline?
This is immutable tags working correctly. Make the push step idempotent: first check whether the tag exists; if it does, compare digests — skip the push and continue deploying if they match, and fail if they differ (which means someone changed the chart without bumping the version). The deploy step uses the recorded digest. Do not change the Repository back to MUTABLE.
Verified teaching videos
No verified official video specifically about "pushing Helm charts to Amazon ECR" was found via YouTube oEmbed. See the official documentation and storyboard below.
Official docs
- Pushing a Helm chart to an Amazon ECR private repository
- Installing a Helm chart hosted on Amazon ECR with Amazon EKS
- Image tag mutability
- Repository creation templates
- Helm · Use OCI-based registries
Video storyboard (about 80 seconds)
Visual: in the terminal, the output of aws ecr get-login-password is piped into helm registry login; a 12-hour hourglass appears in the corner of the screen.
Narration: first get a token that is valid for 12 hours, then hand it to Helm to log in. The login target is just the hostname.
Visual: myapp-0.4.0.tgz flies to a shelf labeled charts/ and is automatically tagged charts/myapp:0.4.0.
Narration: when pushing, you only write up to charts; the chart name and version automatically become the Repository name and tag. The Repository must already exist.
Visual: another package with the same name tries to overwrite 0.4.0 and is blocked by a lock; a sha256 fingerprint is shown alongside.
Narration: immutable tags guarantee that 0.4.0 is always the same package; pinning production deployments by digest makes it foolproof.
Module 3 · Pod Identity / IRSA and Chart Design
- Write a chart that supports both identity methods:
serviceAccount.create / name / annotationsparameterized; IRSA passes its role through an annotation,eks.amazonaws.com/role-arnwhile Pod Identity needs no annotation at all. - Use the CLI / eksctl to create a Pod Identity association (cluster + namespace + SA → IAM role), and write the trust policy (
sts:AssumeRole+sts:TagSession). - Understand that credentials are injected at Pod creation time: create the association before deploying, or do a rolling restart after the association changes.
_helpers.tpl. Importance:★★★★★What: two ways to give an IAM role to a Pod
| EKS Pod Identity (recommended) | IRSA (IAM roles for service accounts) | |
|---|---|---|
| Where the mapping is stored | The association in the EKS API (cluster, namespace, serviceAccount → roleArn); there are no objects or annotations in the cluster | SA annotation eks.amazonaws.com/role-arn |
| Trust policy | Fixed principal Service: pods.eks.amazonaws.com, actions sts:AssumeRole,sts:TagSession; the same role can be used across multiple clusters without changing the trust policy | A per-cluster OIDC provider + sub condition system:serviceaccount:NS:SA |
| Cluster dependency | on the node eks-pod-identity-agent (Standard mode installs the add-on; Auto Mode has it built in) | Cluster OIDC provider (registered in IAM) |
| Injected environment variables | AWS_CONTAINER_CREDENTIALS_FULL_URI=http://169.254.170.23/v1/credentials,AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE | AWS_ROLE_ARN,AWS_WEB_IDENTITY_TOKEN_FILE |
| STS call | EKS Auth service AssumeRoleForPodIdentity (once per node, distributed by the Agent) | Each SDK itself AssumeRoleWithWebIdentity |
| Session tags (ABAC) | Included by default eks-cluster-name,kubernetes-namespace,kubernetes-service-account and other tags, which can be used in policies via aws:PrincipalTag/… | None |
| Unsupported environments | Fargate, Windows EC2 nodes, Outposts, EKS Anywhere | Fargate supported |
Why: why a chart should not create IAM roles or associations
- Separation of duties: Helm's credentials are Kubernetes permissions; creating IAM roles and associations requires
iam:*,eks:CreatePodIdentityAssociation,iam:PassRole— giving the application chart these permissions would let anyone who can change values escalate privileges. - Different lifecycles: IAM roles are often reused across clusters and environments; uninstalling a release should not delete them.
- Portability: The same chart must be installable on kind (no AWS), EKS (Pod Identity), and older clusters (IRSA). The chart exposes only the SA name and annotations; environment differences go into values files.
How: ServiceAccount design in the chart
serviceAccount:
create: true
name: "" # when empty, use fullname; the Pod Identity association name must match the final name
annotations: {} # IRSA: eks.amazonaws.com/role-arn: arn:aws:iam::…:role/myapp
automount: true # Pod Identity / IRSA both rely on the projected token volume; do not turn automount off
aws:
region: ca-central-1
{{- define "myapp.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{- default (include "myapp.fullname" .) .Values.serviceAccount.name -}}
{{- else -}}
{{- default "default" .Values.serviceAccount.name -}}
{{- end -}}
{{- end -}}
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "myapp.serviceAccountName" . }}
labels: {{- include "myapp.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations: {{- toYaml . | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
{{- end }}
template:
metadata:
annotations:
# a change to the SA annotations (IRSA role switch) triggers a rollout so new Pods get the new environment variables
checksum/sa: {{ toJson .Values.serviceAccount.annotations | sha256sum | trunc 16 }}
spec:
serviceAccountName: {{ include "myapp.serviceAccountName" . }}
containers:
- name: myapp
env:
- name: AWS_REGION
value: {{ .Values.aws.region | quote }}
Key points: A change to a Pod Identity association does not change the Pod template, so Helm detects no diff and does not roll out — you need to kubectl rollout restart. IRSA annotations are on the SA, and an SA change likewise does not automatically recreate Pods, so the annotation above was added to checksum/sa.
When: which one to choose
- New clusters and EC2 Linux nodes: Pod Identity (LBC, Karpenter, ESO, and EBS CSI currently all document the Pod Identity approach).
- Fargate, direct cross-account trust of a cluster OIDC provider, or older SDKs that do not support the container credential provider: IRSA.
- The AWS SDK must be new enough to use Pod Identity (the container credential provider); see the minimum versions in the official table.
Flowchart: from association to credentials in Pod Identity
Comparison diagram: the same chart, three sets of values
Animation: Pod Identity vs IRSA credential chain
Choose a method and whether the association/annotation is ready before the Pod is created, then step through how the container obtains its credentials.
Core commands and parameters
| Command | Purpose | Notes |
|---|---|---|
aws iam create-role --assume-role-policy-document file://trust.json | Create a role that Pod Identity can use | trust pods.eks.amazonaws.com |
aws eks create-pod-identity-association | create the association | --cluster-name --namespace --service-account --role-arn; the creator needs iam:PassRole |
eksctl create podidentityassociation | Same as above; can create the role automatically | --permission-policy-arns,--create-service-account |
aws eks list-pod-identity-associations | view associations | --namespace,--service-account filter |
aws eks update-pod-identity-association | change the role | afterward kubectl rollout restart |
kubectl exec … -- env | grep AWS_ | verify injection | Pod Identity: AWS_CONTAINER_*; IRSA: AWS_ROLE_ARN |
cat > trust.json <<'EOF'
{"Version":"2012-10-17","Statement":[{"Effect":"Allow",
"Principal":{"Service":"pods.eks.amazonaws.com"},
"Action":["sts:AssumeRole","sts:TagSession"]}]}
EOF
cat > myapp-secrets.json <<EOF
{"Version":"2012-10-17","Statement":[{"Effect":"Allow",
"Action":["secretsmanager:GetSecretValue","secretsmanager:DescribeSecret"],
"Resource":"arn:aws:secretsmanager:$AWS_REGION:$ACCT:secret:myapp/*"}]}
EOF
aws iam create-role --role-name helm-lab-myapp --assume-role-policy-document file://trust.json
aws iam put-role-policy --role-name helm-lab-myapp --policy-name secrets --policy-document file://myapp-secrets.json
aws eks create-pod-identity-association --cluster-name $CLUSTER \
--namespace myapp --service-account myapp \
--role-arn arn:aws:iam::$ACCT:role/helm-lab-myapp
{
"association": {
"clusterName": "helm-lab",
"namespace": "myapp",
"serviceAccount": "myapp",
"roleArn": "arn:aws:iam::111122223333:role/helm-lab-myapp",
"associationId": "a-1a2b3c4d5e6f7g8h9",
...
}
}
How to verify: At this point the namespace myapp and the SA do not exist yet — this is allowed. Common mistakes: The chart's fullname is myapp-myapp (when the release name differs from the chart name), the SA name does not match the association; so explicitly set in values serviceAccount.name: myapp. Production use: Manage it with Terraform aws_eks_pod_identity_association together with the IAM role.
Lab 3: install myapp from ECR and verify Pod Identity (about 7 min)
serviceAccount:
create: true
name: myapp
annotations: {}
aws:
region: ca-central-1
redis:
enabled: true
ingress:
enabled: false # turn on again in Module 4
externalSecret:
enabled: false # turn on again in Module 5
helm upgrade --install myapp oci://$REG/charts/myapp --version 0.4.1 \ -n myapp --create-namespace -f values-eks.yaml --wait --timeout 5m kubectl -n myapp get deploy,sa
Pulled: 111122223333.dkr.ecr.ca-central-1.amazonaws.com/charts/myapp:0.4.1 Digest: sha256:0b9d… Release "myapp" does not exist. Installing it now. NAME: myapp NAMESPACE: myapp STATUS: deployed REVISION: 1 NAME READY UP-TO-DATE AVAILABLE deployment.apps/myapp 2/2 2 2 NAME SECRETS AGE serviceaccount/default 0 40s serviceaccount/myapp 0 40s
kubectl -n myapp exec deploy/myapp -- env | grep '^AWS_'
kubectl -n myapp run awscli --rm -it --restart=Never --image=public.ecr.aws/aws-cli/aws-cli:latest \
--overrides='{"spec":{"serviceAccountName":"myapp"}}' -- sts get-caller-identity
AWS_REGION=ca-central-1
AWS_STS_REGIONAL_ENDPOINTS=regional
AWS_DEFAULT_REGION=ca-central-1
AWS_CONTAINER_CREDENTIALS_FULL_URI=http://169.254.170.23/v1/credentials
AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE=/var/run/secrets/pods.eks.amazonaws.com/serviceaccount/eks-pod-identity-token
{
"UserId": "AROAEXAMPLE:eks-helm-lab-awscli-…",
"Account": "111122223333",
"Arn": "arn:aws:sts::111122223333:assumed-role/helm-lab-myapp/eks-helm-lab-awscli-…"
}AWS_CONTAINER_*; run kubectl -n myapp rollout restart deploy/myapp before it appears.
ID=$(aws eks list-pod-identity-associations --cluster-name $CLUSTER --namespace myapp --query 'associations[0].associationId' --output text) aws eks delete-pod-identity-association --cluster-name $CLUSTER --association-id $ID kubectl -n myapp rollout restart deploy/myapp && kubectl -n myapp rollout status deploy/myapp kubectl -n myapp exec deploy/myapp -- env | grep -c AWS_CONTAINER || true # 0 aws eks create-pod-identity-association --cluster-name $CLUSTER --namespace myapp --service-account myapp --role-arn arn:aws:iam::$ACCT:role/helm-lab-myapp kubectl -n myapp rollout restart deploy/myapp && kubectl -n myapp rollout status deploy/myapp kubectl -n myapp exec deploy/myapp -- env | grep -c AWS_CONTAINER # 2
Case 1: one role, three clusters
Problem: In the IRSA era, every new cluster meant changing the trust policy of every role (for the new OIDC provider), and role trust policies have a length limit. Approach: Migrate to Pod Identity; the trust policy is fixed as pods.eks.amazonaws.com, create the association in each cluster; use aws:PrincipalTag/eks-cluster-name to distinguish environments in the permission policy. Limitation: While migrating, if the SA still has an IRSA annotation, first clear the annotation in values and roll out.
Case 2: limiting Secrets Manager access with ABAC
Problem: Several teams share one "read secrets" role. Approach: Tag the secrets kubernetes-namespace=payments, with the policy condition secretsmanager:ResourceTag/kubernetes-namespace equal to ${aws:PrincipalTag/kubernetes-namespace}; Pod Identity automatically includes the session tags. Limitation: If the association enables "Disable session tags" (to use session policies), ABAC does not work.
Case 3: the chart name changed and credentials were lost
Problem: A chart refactor changed the fullname from myapp to myapp-web; the SA name changed with it, but the association still pointed to the old name, so after release all S3 access returned AccessDenied (the SDK fell back to the node role). Approach: Explicitly write the SA name into values as a stable interface; in helm test add aws sts get-caller-identity to assert the role name. Limitation: Setting the node IMDS hop limit to 1 prevents fallback to the node role (failing directly is easier to notice).
Common errors and fixes
AccessDenied: User: arn:aws:sts::…:assumed-role/eksctl-helm-lab-nodegroup-…/i-0abc is not authorized to perform: secretsmanager:GetSecretValue
Cause: The Pod did not get Pod Identity credentials, so the SDK fell back to the node role (IMDS). Common causes: the namespace/SA name in the association does not match, the Pod started before the association was created, or the cluster is missing eks-pod-identity-agent, or the SDK is too old.
kubectl -n myapp get pod -o jsonpath='{.items[0].spec.serviceAccountName}{"\n"}'
aws eks list-pod-identity-associations --cluster-name $CLUSTER --namespace myapp
kubectl -n kube-system get ds eks-pod-identity-agent
Fix: Make the SA name match the association, then rollout restart.
An error occurred (AccessDeniedException) when calling the CreatePodIdentityAssociation operation: … not authorized to perform: iam:PassRole
Cause: The principal creating the association lacks the iam:PassRole on the target role.
Fix: Add iam:PassRole to the platform role (Resource limited to that role, with the condition iam:PassedToService = pods.eks.amazonaws.com).
Error assuming role: … is not authorized to perform: sts:TagSession
Cause: The trust policy only includes sts:AssumeRole.
Fix: Add sts:TagSession to the trust policy actions.
WebIdentityErr: failed to retrieve credentials … InvalidIdentityToken: No OpenIDConnect provider found in your account
Cause: The SA still has an IRSA annotation, but the cluster OIDC provider is not registered (or has been deleted).
kubectl -n myapp get sa myapp -o jsonpath='{.metadata.annotations}'
Fix: When using Pod Identity, clear serviceAccount.annotations in values; when using IRSA, eksctl utils associate-iam-oidc-provider --approve.
1. Create a Pod Identity association for kube-system/aws-load-balancer-controller (the role already exists).
aws eks create-pod-identity-association --cluster-name $CLUSTER --namespace kube-system \ --service-account aws-load-balancer-controller --role-arn arn:aws:iam::$ACCT:role/helm-lab-lbc
2. During installation, add an IRSA annotation to the SA via --set (note escaping the dots).
helm upgrade --install myapp oci://$REG/charts/myapp --version 0.4.1 -n myapp \ --set serviceAccount.name=myapp \ --set serviceAccount.annotations.eks\.amazonaws\.com/role-arn=arn:aws:iam::$ACCT:role/helm-lab-myapp-irsa
The platform team wants to add a template to the myapp chart that uses the PodIdentityAssociation CR from AWS Controllers for Kubernetes (ACK) to create the association automatically. Would you agree?
It can be an optional feature (off by default), but be clear about the cost: the ACK controller itself needs eks:CreatePodIdentityAssociation and iam:PassRole, and anyone who can deploy myapp could pass any role to their own SA — you must restrict referenceable roles with ACK's permission boundaries or admission policies. Most organizations prefer to manage the associations in Terraform alongside the IAM roles, and keep only the SA name as the "interface" in the chart.
Verified teaching video
Official docs
- Learn how EKS Pod Identity grants pods access to AWS services
- Assign an IAM role to a Kubernetes service account
- Grant pods access to AWS resources based on tags
- IAM roles for service accounts
Video storyboard (about 70 seconds)
Visual: on the left, the SA card in the chart shows only a name; on the right, an "association" in the AWS console links to the IAM role.
Narration: Pod Identity keeps the mapping on the AWS side, so the chart only needs a stable ServiceAccount name.
Visual: the moment a Pod is created, the webhook injects two environment variables and a token file; the container asks 169.254.170.23 for credentials.
Narration: credentials are injected when the Pod is created. Create the association first, then deploy; if the association changes, remember to restart.
Visual: the IRSA version: the SA carries a role-arn annotation, and the trust policy lists the cluster OIDC endpoint.
Narration: IRSA uses annotations and OIDC, and suits Fargate; for new clusters, prefer Pod Identity.
Module 4 · AWS Load Balancer Controller chart
- Install LBC from the eks-charts Repository: IAM policy (matched to the controller version), Pod Identity association,
clusterName/region/vpcIdand other key values, plus the CRDs must be applied separately withhelm upgradebefore. - Parameterize the Ingress in the myapp chart (
className,annotations), and usealb.ingress.kubernetes.io/*annotations to generate a public ALB, IP target mode, and health checks. - Explain the full process of how one Ingress becomes an ALB: chart rendering → controller watch → subnet/security group discovery → ELBv2 API → TargetGroupBinding → registering Pod IPs → writing back Ingress status.
- Understand LBC's current Gateway API support and the differences from Auto Mode's built-in load balancing.
What: what LBC does
The AWS Load Balancer Controller (LBC, a kubernetes-sigs project maintained by AWS) watches Ingresses in the cluster,type: LoadBalancer Services, Gateway API resources, and its own CRDs (TargetGroupBinding,IngressClassParams etc.), and "translates" them into ALB / NLB, listeners, rules, target groups, and security group rules. The chart comes from the Repository maintained by AWS, eks-charts Repository https://aws.github.io/eks-charts, the latest chart as of 2026-11-15 3.6.3 corresponds to the controller v3.6.3 (since v3 the chart version matches the controller version number; in the v2.x era the chart was 1.x, e.g., chart 1.14.0 corresponds to v2.14.x).
Why: why not use the in-tree cloud provider load balancer
- The in-tree
type: LoadBalancercan only create Classic/NLB (instance targets) and does not support ALB Layer 7 routing, IP targets, IngressGroup merging, WAF, Cognito authentication, etc. - IP target mode (
target-type: ip) registers Pod IPs directly into the target group, bypassing NodePort and kube-proxy, and together with the Pod readiness gate enables zero-downtime rolling updates.
How: key points of installation (Standard mode)
| Step | Key points |
|---|---|
| IAM policy | from the tag that matches the controller version download docs/install/iam_policy.json (new versions often add permissions, e.g. elasticloadbalancing:DescribeListenerAttributes). The policy and role can be reused across multiple clusters in the same account. |
| Identity | Pod Identity association kube-system/aws-load-balancer-controller (this lesson); or IRSA (eksctl create iamserviceaccount, the default in AWS docs). In the chart, serviceAccount.create=false or true both work, as long as the names match. |
| Key values | clusterName (required, used for resource tags and subnet discovery); with restricted IMDS (hop limit 1), Fargate, or Hybrid Nodes you also need region and vpcId; replicaCount default 2; enableServiceMutatorWebhook decides whether LBC takes over all new LoadBalancer Services. |
| CRD | The chart's crds/ directory is installed only on the first install; helm upgrade does not update CRDs. Run kubectl apply -k "github.com/aws/eks-charts/stable/aws-load-balancer-controller/crds?ref=master" before upgrading (in production, pin to the corresponding tag/commit). |
| Webhook certificates | The chart uses a self-signed certificate by default; enableCertManager=true with cert-manager issuing it. The v3.0.0 release notes warn about older versions keepTLSSecret related certificate-renewal issues; read the Release Notes when upgrading. |
| Subnet tags | Public ALB: kubernetes.io/role/elb=1; internal: kubernetes.io/role/internal-elb=1; pick one per AZ, at least 2 AZs. You can also specify them explicitly with the annotation alb.ingress.kubernetes.io/subnets . |
Common Ingress annotations (put them in the myapp values)
| Annotation | Purpose | Value in this lesson |
|---|---|---|
alb.ingress.kubernetes.io/scheme | Public / internal | internet-facing |
alb.ingress.kubernetes.io/target-type | Target type | ip |
alb.ingress.kubernetes.io/healthcheck-path | Health check path | /healthz |
alb.ingress.kubernetes.io/listen-ports | Listener port | '[{"HTTP":80}]' (add 443 when a certificate is present) |
alb.ingress.kubernetes.io/certificate-arn / ssl-redirect | HTTPS and redirects | Requires an ACM certificate and domain (omitted in this lesson) |
alb.ingress.kubernetes.io/group.name / group.order | Multiple Ingresses share one ALB | Saves money, but one faulty Ingress in the group blocks the whole group |
alb.ingress.kubernetes.io/tags | Cost tags on the ALB | Project=helm-lab |
NLB: Service settings spec.loadBalancerClass: service.k8s.aws/nlb (or the annotation service.beta.kubernetes.io/aws-load-balancer-type: external) and service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip.
When: Ingress, Gateway API, or Auto Mode?
| LBC + Ingress | LBC + Gateway API | Built into Auto Mode | |
|---|---|---|---|
| Current status (2026-11) | Mature, most complete annotations | GA from v3.0.0; v3.6.x is based on Gateway API v1.6.0 and passes conformance tests; ALB routes (HTTPRoute/GRPCRoute), NLB routes (TCP/UDP/TLSRoute); the same Gateway cannot mix L4/L7 routes | IngressClass controller eks.amazonaws.com/alb + IngressClassParams; Service eks.amazonaws.com/nlb; some LBC annotations are not supported; for Gateway API support, follow the EKS documentation |
| Installation | Helm chart | Helm chart + standard Gateway API CRDs + LBC's Gateway CRDs (enabled automatically when the CRDs exist; feature gate ALBGatewayAPI/NLBGatewayAPI can be turned off) | No installation needed |
| Chart design | ingress.className + ingress.annotations | httpRoute.enabled + parentRefs | Same as Ingress, but with a different class name |
helm upgrade --wait a successful release means the ALB is ready" — Helm 4's kstatus has no special readiness rule for Ingress; ALB creation and target health checks are asynchronous and need separate waiting status.loadBalancer and probing. ② "Upgrading the chart also upgrades CRDs" — no. ③ "Deleting the cluster also deletes the ALB" — no; the ALB is created by LBC, and once the cluster is gone the controller is gone too, so the ALB, target groups, and security groups remain and keep billing (Module 8).Architecture diagram: the full path from Helm to ALB
Flowchart: Helm management boundary
Core animation: after Helm installs LBC, how one Ingress becomes an ALB
Choose whether to inject a fault, then play step by step. The highlighted box is the executor of the current step; on the right are the Ingress status and target group targets; below are real command output, controller logs, or AWS API calls (IDs and IPs are examples).
Core commands and parameters
| Command | Purpose | Key parameters / notes |
|---|---|---|
helm repo add eks https://aws.github.io/eks-charts | Add the eks-charts | HTTP Repository (not OCI) |
helm search repo eks/aws-load-balancer-controller --versions | View chart / controller versions | CHART VERSION 3.6.3 / APP VERSION v3.6.3 |
helm upgrade --install aws-load-balancer-controller eks/aws-load-balancer-controller | Install / upgrade | -n kube-system --version 3.6.3 --set clusterName=… |
kubectl apply -k "github.com/aws/eks-charts/stable/aws-load-balancer-controller/crds?ref=…" | Upgrade CRDs | Before every helm upgrade |
kubectl get ingressclass,targetgroupbindings -A | View classes and TGBs | The controller of the LBC class is ingress.k8s.aws/alb |
kubectl -n kube-system logs deploy/aws-load-balancer-controller | Controller logs | Search error,AccessDenied,FailedBuildModel |
aws elbv2 describe-target-health --target-group-arn … | Target health | healthy / unhealthy / initial / draining |
LBC_VER=v3.6.3 curl -sSLo iam_policy.json https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/$LBC_VER/docs/install/iam_policy.json aws iam create-policy --policy-name AWSLoadBalancerControllerIAMPolicy --policy-document file://iam_policy.json aws iam create-role --role-name helm-lab-lbc --assume-role-policy-document file://trust.json # Pod Identity trust policy from Module 3 aws iam attach-role-policy --role-name helm-lab-lbc --policy-arn arn:aws:iam::$ACCT:policy/AWSLoadBalancerControllerIAMPolicy aws eks create-pod-identity-association --cluster-name $CLUSTER --namespace kube-system \ --service-account aws-load-balancer-controller --role-arn arn:aws:iam::$ACCT:role/helm-lab-lbc VPC_ID=$(aws eks describe-cluster --name $CLUSTER --query cluster.resourcesVpcConfig.vpcId --output text) helm repo add eks https://aws.github.io/eks-charts && helm repo update eks helm upgrade --install aws-load-balancer-controller eks/aws-load-balancer-controller \ -n kube-system --version 3.6.3 \ --set clusterName=$CLUSTER --set region=$AWS_REGION --set vpcId=$VPC_ID \ --set serviceAccount.create=true --set serviceAccount.name=aws-load-balancer-controller \ --wait kubectl -n kube-system get deploy aws-load-balancer-controller kubectl get ingressclass
Release "aws-load-balancer-controller" does not exist. Installing it now. NAME: aws-load-balancer-controller NAMESPACE: kube-system STATUS: deployed REVISION: 1 NOTES: AWS Load Balancer controller installed! NAME READY UP-TO-DATE AVAILABLE AGE aws-load-balancer-controller 2/2 2 2 45s NAME CONTROLLER PARAMETERS AGE alb ingress.k8s.aws/alb <none> 45s
How to verify: 2/2 Ready, IngressClass alb exists. Common mistakes: The IAM policy is downloaded from main branch while the controller is an older version (or vice versa); forgetting to create the Pod Identity association causes AccessDenied for the node role in the controller logs. Production use: Write the steps above into the platform pipeline, with the IAM part in Terraform. The AWS documentation example uses IRSA (eksctl create iamserviceaccount); either method works.
Correct order for upgrading LBC
# 1. Read the target version's Release Notes (changes to CRDs, IAM policy, webhooks) # 2. Update the IAM policy (new iam_policy.json → create-policy-version --set-as-default) # 3. Upgrade the CRDs first (Helm does not do this) kubectl apply -k "github.com/aws/eks-charts/stable/aws-load-balancer-controller/crds?ref=master" # 4. Then upgrade the chart (use --reuse-values with caution; an explicit -f values file is recommended) helm upgrade aws-load-balancer-controller eks/aws-load-balancer-controller -n kube-system \ --version 3.6.3 -f lbc-values.yaml --wait
Lab 4: expose myapp with an ALB (about 8 min; the ALB starts billing)
aws ec2 describe-subnets --filters Name=vpc-id,Values=$VPC_ID \ --query "Subnets[].[SubnetId,AvailabilityZone,Tags[?Key=='kubernetes.io/role/elb'].Value|[0],Tags[?Key=='kubernetes.io/role/internal-elb'].Value|[0]]" --output table
| subnet-0a1…| ca-central-1a | 1 | None | | subnet-0b2…| ca-central-1b | 1 | None | | subnet-0c3…| ca-central-1d | 1 | None | | subnet-0d4…| ca-central-1a | None | 1 | ...
ingress:
enabled: true
className: alb
annotations:
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/healthcheck-path: /healthz
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP":80}]'
alb.ingress.kubernetes.io/tags: Project=helm-lab
hosts:
- host: ""
paths:
- path: /
pathType: Prefix
kubectl label ns myapp elbv2.k8s.aws/pod-readiness-gate-inject=enabled helm upgrade myapp oci://$REG/charts/myapp --version 0.4.1 -n myapp -f values-eks.yaml --wait kubectl -n myapp rollout restart deploy/myapp # so new Pods get the readiness gate injected kubectl -n myapp get ingress myapp -w
NAME CLASS HOSTS ADDRESS PORTS AGE myapp alb * 80 5s myapp alb * k8s-myapp-myapp-3f2a9c1b7e-1234567890.ca-central-1.elb.amazonaws.com 80 48s
ALB=$(kubectl -n myapp get ingress myapp -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')
kubectl -n myapp get targetgroupbindings
TG=$(kubectl -n myapp get targetgroupbindings -o jsonpath='{.items[0].spec.targetGroupARN}')
aws elbv2 describe-target-health --target-group-arn $TG --query 'TargetHealthDescriptions[].[Target.Id,Target.Port,TargetHealth.State]' --output table
until curl -sf http://$ALB/healthz; do sleep 10; done; curl -s http://$ALB/
NAME SERVICE-NAME SERVICE-PORT TARGET-TYPE AGE k8s-myapp-myapp-8a1b2c3d4e myapp 80 ip 2m ------------------------------------- | DescribeTargetHealth | +--------------+-------+------------+ | 192.168.141.37| 5000 | healthy | | 192.168.105.12| 5000 | healthy | +--------------+-------+------------+ ok myapp v1.0 from myapp-6c9d8f7b45-k2x8q, hits=1
The target port is the container port 5000 (IP mode registers Pod IPs directly). describe pod shows the readiness gate in target-health.elbv2.k8s.aws/k8s-myapp-myapp-….
helm get manifest myapp -n myapp | grep -c TargetGroupBinding Output 0 — the TGB is created by LBC and does not belong to the release.Case 1: after a chart upgrade, all new Ingresses stopped working
Problem: LBC was upgraded from v2.x to v3.x, but only helm upgrade was run; the new controller depends on CRD fields that did not exist, and TargetGroupBinding reconciliation failed. Approach: Following the Release Notes, first kubectl apply -k …/crds, then upgrade the chart; put the CRD step into the platform pipeline. Limitation: CRDs are cluster-scoped; rolling back the chart does not roll back the CRDs.
Case 2: 20 microservices, 20 ALBs
Problem: Each chart carries its own Ingress, so ALB costs grow linearly. Approach: Add alb.ingress.kubernetes.io/group.name: shop-prod to the Ingresses in the same environment to merge them into one ALB, and use group.order to control rule order; the chart takes the group name as a value. Limitation: A wrong annotation on any Ingress in the group makes reconciliation fail for the whole group; the number of rules is limited by ALB quotas; teams must agree on namespaces and paths.
Case 3: occasional 502s during rolling releases
Problem: In IP mode, a new Pod receives kube traffic as soon as it is Ready, but the ALB target is still initial; the old Pod is terminated first, causing 502s. Approach: Enable elbv2.k8s.aws/pod-readiness-gate-inject=enabled in the namespace; a Pod is not considered Ready until the ALB health check passes; a preStop sleep covers the target group deregistration delay. Limitation: The readiness gate is only injected into newly created Pods.
Common errors and fixes
Warning FailedBuildModel Failed build model due to couldn't auto-discover subnets: unable to resolve at least one subnet
Cause: The public subnet is missing kubernetes.io/role/elb=1 (an internal ALB is missing internal-elb), or fewer than 2 AZs have qualifying subnets.
kubectl -n myapp describe ingress myapp | tail -5 aws ec2 describe-subnets --filters Name=vpc-id,Values=$VPC_ID Name=tag:kubernetes.io/role/elb,Values=1 --query 'Subnets[].SubnetId'
Fix:aws ec2 create-tags --resources subnet-… --tags Key=kubernetes.io/role/elb,Value=1, or explicitly specify them with the annotation alb.ingress.kubernetes.io/subnets .
AccessDenied: User: arn:aws:sts::…:assumed-role/helm-lab-lbc/… is not authorized to perform: elasticloadbalancing:DescribeListenerAttributes
Cause: The IAM policy version is older than the controller.
Fix: Download the iam_policy.json for the matching controller version,aws iam create-policy-version --policy-arn … --policy-document file://iam_policy.json --set-as-default.
AccessDenied … assumed-role/eksctl-helm-lab-nodegroup-ng-base-NodeInstanceRole-…
Cause: The controller did not get Pod Identity credentials and fell back to the node role. The SA name in the association does not match serviceAccount.name in the chart, or the association was created after the Pod started.
aws eks list-pod-identity-associations --cluster-name $CLUSTER --namespace kube-system kubectl -n kube-system rollout restart deploy/aws-load-balancer-controller
Error: INSTALLATION FAILED: … failed calling webhook "mservice.elbv2.k8s.aws": … no endpoints available for service "aws-load-balancer-webhook-service"
Cause: The LBC Pod is not yet Ready (or has been uninstalled), but its MutatingWebhook still intercepts Service creation, so other chart installations fail.
kubectl -n kube-system get pod -l app.kubernetes.io/name=aws-load-balancer-controller kubectl get mutatingwebhookconfiguration | grep elbv2
Fix: Get LBC Ready first; delete leftover webhook configurations after confirming LBC has been uninstalled. The v3.6.3 chart adds matchConditions support to the Service webhook, which can match only type == 'LoadBalancer' Services to reduce this kind of circular dependency.
The Ingress has an address but access returns 502 / 504, and the target is unhealthy (Health checks failed with these codes: [404])
Cause: The health check path or port is wrong; or the node/Pod security group does not allow the ALB security group to reach the container port.
aws elbv2 describe-target-health --target-group-arn $TG --query 'TargetHealthDescriptions[].TargetHealth'
Fix: annotation healthcheck-path: /healthz; check the backend security group rules managed by LBC (they are added automatically by default).
1. Check the three most recent chart versions of LBC in eks-charts and their corresponding controller versions.
helm search repo eks/aws-load-balancer-controller --versions | head -4
2. Find all Ingresses that use the alb class but do not yet have an address.
kubectl get ingress -A -o json | jq -r '.items[] | select(.spec.ingressClassName=="alb" and (.status.loadBalancer.ingress|not)) | "\(.metadata.namespace)/\(.metadata.name)"'
In the pipeline, helm upgrade --install myapp … --wait succeeded, but the smoke test that follows curl http://$ALB/ failed (DNS does not resolve). Why? How do you fix it?
Helm's wait logic (kstatus) considers the Ingress "Current," but the ALB is created asynchronously by LBC; writing the DNS name back to status, DNS propagation, and target health checks all take time (usually 1–3 minutes). The pipeline should add a waiting step after Helm: poll status.loadBalancer.ingress[0].hostname until it is non-empty, then loop curl /healthz until it returns 200 (with a timeout), or use helm test probe Pod in it.
Verified teaching videos
Official docs
- Install AWS Load Balancer Controller with Helm
- LBC documentation (annotations, Gateway API)
- LBC Releases
- eks-charts · aws-load-balancer-controller
- Auto Mode · IngressClass (ALB)
Video storyboard (about 90 seconds)
Visual: the Helm icon throws a card labeled Ingress into the API Server.
Narration: Helm's job ends here — it has only created one Ingress object.
Visual: the LBC "eye" icon lights up, checking subnet tags, creating security groups, calling CreateLoadBalancer and CreateTargetGroup.
Narration: the load balancer controller watches for the new Ingress, uses its own IAM identity to call the ELBv2 API, and builds the ALB, listeners, and target group.
Visual: two Pod IPs fly into the target group; health checks turn from yellow to green.
Narration: IP mode registers Pod IPs directly; once health checks pass, the ALB's DNS name is written back to the Ingress status.
Visual: a red X lands on the "Delete cluster" button, and a lone ALB keeps billing beside it.
Narration: remember, uninstall myapp before deleting the cluster, so the controller deletes the ALB itself.
Module 5 · Karpenter and Other AWS-Related Charts
- Use
oci://public.ecr.aws/karpenter/karpenterto install Karpenter, understanding that the chart installs only the controller,NodePool (karpenter.sh/v1) and EC2NodeClass (karpenter.k8s.aws/v1) must be created separately; CRD upgrades can use the independentkarpenter-crdchart. - Choose between the "EKS add-on" and the "Helm chart" for EBS CSI, and provide a gp3 StorageClass for stateful charts.
- Install External Secrets Operator and use the controller's Pod Identity to sync secrets from Secrets Manager, rendered in the myapp chart as an optional template
ExternalSecret.
Karpenter chart
Karpenter detects Pods that cannot be scheduled and, according to the NodePool constraints (instance category, capacity type, architecture, availability zone, limits) and the EC2NodeClass settings (AMI, subnets, security groups, node role), calls EC2 directly to CreateFleet launch instances, and reclaims underutilized nodes through consolidation. Latest as of 2026-11-15 v1.15.2 (v1.14.3 LTS is also available).
| Part | Who creates it | Notes |
|---|---|---|
IAM: controller role, node role KarpenterNodeRole-<cluster>, SQS interruption queue + EventBridge rules | Official CloudFormation template (or Terraform) | The queue name defaults to the cluster name; in the chart settings.interruptionQueue points to it |
Pod Identity association kube-system/karpenter | AWS side (eksctl / CLI) | The official getting-started documentation uses Pod Identity |
Access entry for the node role access entry (type EC2_LINUX) | AWS side | otherwise new nodes cannot join the cluster; authenticationMode: API clusters cannot use the aws-auth mapping |
| Controller Deployment, CRDs | Helm: karpenter chart (CRDs can also be handed to the karpenter-crd chart to manage, so that helm upgrade can upgrade CRDs) | settings.clusterName,settings.interruptionQueue, controller resources |
| NodePool, EC2NodeClass | Platform chart / kubectl | They are CRs and must be created after the CRDs exist — do not first-install them in the same release as the karpenter chart |
Key constraint: The Karpenter controller cannot run on the nodes it manages (otherwise consolidation could evict itself); the official getting-started guide runs it on a managed node group (or Fargate). Auto Mode clusters already include managed Karpenter, so do not install this chart again (Module 1).
EBS CSI: add-on or chart?
EKS add-on aws-ebs-csi-driver (installed in this lesson) | Helm chart (https://kubernetes-sigs.github.io/aws-ebs-csi-driver) | |
|---|---|---|
| Version | Choose the version verified by AWS for your cluster version | chart 2.68.0 / driver v1.68.0 (2026-11) |
| IAM | Plugin Pod Identity association (eksctl useDefaultPodIdentityAssociations) | SA ebs-csi-controller-sa Self-created association, managed policy AmazonEBSCSIDriverPolicy |
| Choose | Default recommendation | Needs parameters the add-on does not expose, or a non-EKS cluster |
Either way,the StorageClass must be created yourself (EKS's default gp2 is not gp3). Auto Mode's provisioner is ebs.csi.eks.amazonaws.com, as opposed to the self-installed driver ebs.csi.aws.com cannot take over each other's volumes.
External Secrets Operator (ESO) + Secrets Manager
- chart:
helm repo add external-secrets https://charts.external-secrets.io, latest chart as of 2026-11-10 2.15.0 / application v2.15.0; installs the CRDs by default (installCRDs: true). The resource APIs areexternal-secrets.io/v1(SecretStore,ClusterSecretStore,ExternalSecret). - How to use Pod Identity (ESO official documentation): create an association for the ESO controller's SA (for example
external-secrets/external-secrets),SecretStoreof theprovider.awsin do not writeauth, so ESO uses the SDK default credential chain; optionallyroleand then AssumeRole to narrow permissions. Note:auth.jwt.serviceAccountRefcannot be used together with Pod Identity (ESO cannot impersonate an SA bound to Pod Identity and reportsan IAM role must be associated with service account). - Difference from Secrets Store CSI Driver + ASCP: ESO syncs secrets into a Kubernetes Secret (apps consume them as env/volume; the chart can use
existingSecret); ASCP mounts secrets as files via a CSI volume, so they need not be stored in etcd, and the Pod uses its own Pod Identity. K8s Lesson 7 used ASCP and this lesson uses ESO; both are valid.
no matches for kind; use two releases, or protect it in the application chart with .Capabilities.APIVersions.Has . ③ "Secrets synced by ESO never reach etcd" — they do; they are ordinary Secrets; use KMS envelope encryption with them (enabled by default on EKS 1.28+).Structure diagram: the common pattern of the three charts
Flowchart: secrets from Secrets Manager to myapp
Simulator: how Karpenter provisions nodes for Pending Pods
Choose a scenario and play it. Watch Karpenter read the NodePool and EC2NodeClass, call EC2, and the node join the cluster, along with common "no scale-out" stuck points.
Core commands and parameters
| Command | Purpose | Notes |
|---|---|---|
helm upgrade --install karpenter oci://public.ecr.aws/karpenter/karpenter --version 1.15.2 | Install Karpenter | first helm registry logout public.ecr.aws pull anonymously |
helm upgrade --install karpenter-crd oci://public.ecr.aws/karpenter/karpenter-crd | manage the CRDs independently | let the CRDs upgrade with helm upgrade |
kubectl get nodepools,ec2nodeclasses,nodeclaims | View Karpenter resources | the EC2NodeClass Ready condition |
helm upgrade --install external-secrets external-secrets/external-secrets --version 2.15.0 | Install ESO | -n external-secrets --create-namespace |
kubectl get clustersecretstore,externalsecret -A | Check sync status | STATUS SecretSynced,READY True |
aws secretsmanager create-secret | Create the secret | --name myapp/redis --secret-string '{"password":"…"}' |
A. Karpenter (optional; launches extra EC2 instances)
export KARPENTER_VERSION=1.15.2 KARPENTER_NAMESPACE=kube-system
TEMPOUT=$(mktemp)
curl -fsSL https://raw.githubusercontent.com/aws/karpenter-provider-aws/v${KARPENTER_VERSION}/website/content/en/preview/getting-started/getting-started-with-karpenter/cloudformation.yaml > $TEMPOUT
aws cloudformation deploy --stack-name Karpenter-$CLUSTER --template-file $TEMPOUT \
--capabilities CAPABILITY_NAMED_IAM --parameter-overrides ClusterName=$CLUSTER
# Controller role (Pod Identity), with the managed policy created by the template attached
eksctl create podidentityassociation --cluster $CLUSTER --namespace kube-system \
--service-account-name karpenter --role-name $CLUSTER-karpenter \
--permission-policy-arns arn:aws:iam::$ACCT:policy/KarpenterControllerNodeLifecyclePolicy-$CLUSTER,arn:aws:iam::$ACCT:policy/KarpenterControllerIAMIntegrationPolicy-$CLUSTER,arn:aws:iam::$ACCT:policy/KarpenterControllerEKSIntegrationPolicy-$CLUSTER,arn:aws:iam::$ACCT:policy/KarpenterControllerInterruptionPolicy-$CLUSTER,arn:aws:iam::$ACCT:policy/KarpenterControllerResourceDiscoveryPolicy-$CLUSTER,arn:aws:iam::$ACCT:policy/KarpenterControllerZonalShiftPolicy-$CLUSTER
# Access entry for the node role (authenticationMode=API)
aws eks create-access-entry --cluster-name $CLUSTER \
--principal-arn arn:aws:iam::$ACCT:role/KarpenterNodeRole-$CLUSTER --type EC2_LINUX
helm registry logout public.ecr.aws || true
helm upgrade --install karpenter oci://public.ecr.aws/karpenter/karpenter --version $KARPENTER_VERSION \
-n $KARPENTER_NAMESPACE \
--set settings.clusterName=$CLUSTER --set settings.interruptionQueue=$CLUSTER \
--set controller.resources.requests.cpu=1 --set controller.resources.requests.memory=1Gi \
--set controller.resources.limits.cpu=1 --set controller.resources.limits.memory=1Gi \
--wait
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: default
spec:
template:
spec:
requirements:
- key: kubernetes.io/arch
operator: In
values: ["amd64"]
- key: karpenter.sh/capacity-type
operator: In
values: ["on-demand"]
- key: karpenter.k8s.aws/instance-category
operator: In
values: ["c", "m", "r"]
nodeClassRef:
group: karpenter.k8s.aws
kind: EC2NodeClass
name: default
expireAfter: 720h
limits:
cpu: 16 # lab cap, to prevent accidentally scaling out many instances
disruption:
consolidationPolicy: WhenEmptyOrUnderutilized
consolidateAfter: 1m
---
apiVersion: karpenter.k8s.aws/v1
kind: EC2NodeClass
metadata:
name: default
spec:
role: KarpenterNodeRole-helm-lab
amiSelectorTerms:
- alias: al2023@latest # in production, pin a specific version such as al2023@v2026xxxx
subnetSelectorTerms:
- tags:
karpenter.sh/discovery: helm-lab
securityGroupSelectorTerms:
- tags:
karpenter.sh/discovery: helm-lab
NAME NODECLASS NODES READY AGE nodepool.karpenter.sh/default default 0 True 20s NAME READY AGE ec2nodeclass.karpenter.k8s.aws/default True 20s
B. ESO + Secrets Manager (main path)
aws secretsmanager create-secret --name myapp/redis \
--secret-string "{\"password\":\"$(openssl rand -hex 16)\"}" --region $AWS_REGION
cat > eso-policy.json <<EOF
{"Version":"2012-10-17","Statement":[{"Effect":"Allow",
"Action":["secretsmanager:GetSecretValue","secretsmanager:DescribeSecret","secretsmanager:ListSecretVersionIds","secretsmanager:GetResourcePolicy"],
"Resource":"arn:aws:secretsmanager:$AWS_REGION:$ACCT:secret:myapp/*"}]}
EOF
aws iam create-role --role-name helm-lab-eso --assume-role-policy-document file://trust.json
aws iam put-role-policy --role-name helm-lab-eso --policy-name sm-read --policy-document file://eso-policy.json
aws eks create-pod-identity-association --cluster-name $CLUSTER --namespace external-secrets \
--service-account external-secrets --role-arn arn:aws:iam::$ACCT:role/helm-lab-eso
helm repo add external-secrets https://charts.external-secrets.io && helm repo update external-secrets
helm upgrade --install external-secrets external-secrets/external-secrets --version 2.15.0 \
-n external-secrets --create-namespace --set serviceAccount.name=external-secrets --wait
apiVersion: external-secrets.io/v1
kind: ClusterSecretStore
metadata:
name: aws-sm
spec:
provider:
aws:
service: SecretsManager
region: ca-central-1
kubectl apply -f cluster-secret-store.yaml kubectl get clustersecretstore aws-sm
NAME AGE STATUS CAPABILITIES READY aws-sm 10s Valid ReadWrite True
Lab 5: take the Redis password for myapp from Secrets Manager (about 8 min)
{{- if .Values.externalSecret.enabled }}
{{- if not (.Capabilities.APIVersions.Has "external-secrets.io/v1/ExternalSecret") }}
{{- fail "externalSecret.enabled=true but the external-secrets.io/v1 CRD is not present in the cluster; install External Secrets Operator first" }}
{{- end }}
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: {{ include "myapp.fullname" . }}-redis
labels: {{- include "myapp.labels" . | nindent 4 }}
spec:
refreshInterval: {{ .Values.externalSecret.refreshInterval | default "1h" }}
secretStoreRef:
kind: {{ .Values.externalSecret.storeKind | default "ClusterSecretStore" }}
name: {{ required "externalSecret.storeName is required" .Values.externalSecret.storeName }}
target:
name: {{ .Values.externalSecret.targetName }}
creationPolicy: Owner
data:
- secretKey: redis-password
remoteRef:
key: {{ .Values.externalSecret.remoteKey }}
property: password
{{- end }}
externalSecret:
enabled: true
storeName: aws-sm
targetName: myapp-redis
remoteKey: myapp/redis
redis:
auth:
existingSecret: myapp-redis
existingSecretPasswordKey: redis-password
# The REDIS_PASSWORD for the myapp container is read from the same Secret (the deployment template from Lessons 1/2 already supports existingSecret)
redisAuth:
existingSecret: myapp-redis
.Capabilities.APIVersions.Has When helm template (no cluster) only recognizes built-in APIs, you can simulate with --api-versions external-secrets.io/v1/ExternalSecret . redisAuth The key names must match the actual values of your Lesson 2 chart.
sed -i 's/^version: .*/version: 0.5.0/' myapp/Chart.yaml helm package ./myapp && helm push myapp-0.5.0.tgz oci://$REG/charts helm upgrade myapp oci://$REG/charts/myapp --version 0.5.0 -n myapp -f values-eks.yaml --wait --timeout 5m kubectl -n myapp get externalsecret,secret myapp-redis
NAME STORETYPE STORE REFRESH INTERVAL STATUS READY externalsecret.external-secrets.io/myapp-redis ClusterSecretStore aws-sm 1h SecretSynced True NAME TYPE DATA AGE secret/myapp-redis Opaque 1 12s
On the first upgrade the Redis Pod may briefly stay in CreateContainerConfigError (the Secret has not synced yet); once ESO writes the Secret, it recovers automatically.
helm get values myapp -n myapp --all | grep -i password || echo "no plaintext password in the release" curl -s http://$ALB/
existingSecretPasswordKey: redis-password myapp v1.0 from myapp-7d9c…, hits=3
aws secretsmanager put-secret-value --secret-id myapp/redis --secret-string '{"password":"…"}', then kubectl -n myapp annotate externalsecret myapp-redis force-sync=$(date +%s) --overwrite sync immediately; note that the env approach requires a Pod restart to take effect (the Lesson 2 checksum trick does not work for external Secrets; consider a tool like Reloader).inflate Test:
kubectl create deployment inflate --image=public.ecr.aws/eks-distro/kubernetes/pause:3.7 --replicas=0 kubectl set resources deploy/inflate --requests=cpu=1 kubectl scale deploy/inflate --replicas=5 kubectl get nodeclaims -w kubectl delete deploy inflate # about 1 minute later consolidation reclaims the node
The image is the same as in the Karpenter official getting-started example (pause:3.7). Be sure to delete inflate when the lab ends, otherwise the extra instances keep billing.
Case 1: NodePool field errors after a Karpenter upgrade
Problem: Only the karpenter chart was upgraded; the CRDs were still the old version, so the new controller could not read the new fields. Approach: Hand the CRDs to the karpenter-crd chart to manage (upgrade it first), or apply the CRD manifests before upgrading; keep the controller and CRD versions in sync. Limitation: Major version upgrades (such as v0.x → v1) must be done in steps following the official migration guide.
Case 2: an ESO-synced Secret was overwritten by Helm
Problem: The chart also templated a Secret with the same name (with a placeholder default value); after ESO wrote it, the next helm upgrade changed it back to the placeholder value. Approach: In the chart, "self-created Secret" and "existingSecret" are mutually exclusive (if not .Values.redisAuth.existingSecret); the ExternalSecret creationPolicy: Owner makes ESO the sole owner. Limitation: Helm 4 SSA reports field conflicts as errors, which is actually a good thing.
Case 3: the EBS volume kept billing after uninstalling Redis
Problem:helm uninstall myapp After uninstall, the StatefulSet's PVC remains (PVCs created from volumeClaimTemplates do not belong to the release); after the cluster is deleted, the EBS volume becomes orphaned. Approach: Explicitly delete the PVC after uninstalling (with reclaimPolicy Delete this deletes the volume), or set persistentVolumeClaimRetentionPolicy.whenDeleted: Delete for the StatefulSet; the cleanup script checks aws ec2 describe-volumes --filters Name=status,Values=available.
Common errors and fixes
Error: INSTALLATION FAILED: unable to build kubernetes objects from release manifest: resource mapping not found for name: "myapp-redis" namespace: "" from "": no matches for kind "ExternalSecret" in version "external-secrets.io/v1" ensure CRDs are installed first
Cause: ESO is not installed, or an old version that only serves the old API (v1beta1) is installed.
kubectl api-resources --api-group=external-secrets.io helm list -n external-secrets
Fix: Install ESO 2.x first; in the application chart, use .Capabilities.APIVersions.Has to give a clear fail message.
ExternalSecret status SecretSyncedError: … AccessDeniedException … is not authorized to perform: secretsmanager:GetSecretValue
Cause: The ESO controller has no Pod Identity credentials (the associated SA name is wrong, or it was not restarted after the association), or the policy Resource does not match (the Secrets Manager ARN ends with a 6-character random suffix, so the policy should be written as myapp/*).
kubectl -n myapp describe externalsecret myapp-redis | tail -5 kubectl -n external-secrets get sa aws eks list-pod-identity-associations --cluster-name $CLUSTER --namespace external-secrets
unable to create session: an IAM role must be associated with service account …
Cause: The SecretStore specifies auth.jwt.serviceAccountRef, but that SA uses Pod Identity.
Fix: Delete the auth section (to use the ESO controller identity), or configure an IRSA annotation for that SA.
EC2NodeClass READY False: SubnetsNotFound / SecurityGroupsNotFound
Cause: The subnets or security groups are missing the karpenter.sh/discovery=helm-lab tag.
kubectl describe ec2nodeclass default | sed -n '/Conditions/,$p' aws ec2 describe-subnets --filters Name=tag:karpenter.sh/discovery,Values=$CLUSTER --query 'Subnets[].SubnetId'
PVC stuck Pending: waiting for first consumer / no persistent volumes available and no storage class is set
Cause: No StorageClass is set (and there is no default class), or the gp3 class points to a provisioner that does not exist.
kubectl get sc; kubectl -n myapp describe pvc
Fix: Create a gp3 StorageClass (ebs.csi.aws.com,type: gp3,encrypted: "true",WaitForFirstConsumer) and reference it in the chart values.
1. View the default values of the Karpenter chart 1.15.2 (pulled anonymously).
helm registry logout public.ecr.aws; helm show values oci://public.ecr.aws/karpenter/karpenter --version 1.15.2 | head -40
2. Render myapp locally and simulate that the ESO CRDs exist in the cluster.
helm template myapp ./myapp -f values-eks.yaml --api-versions external-secrets.io/v1/ExternalSecret | grep -A3 "kind: ExternalSecret"
The team wants to put the karpenter chart, NodePool/EC2NodeClass, the ESO chart, and the ClusterSecretStore all into one "platform" umbrella chart, installed in one go helm install . What problems would arise? How would you organize it?
CRs (NodePool, ClusterSecretStore) depend on the CRDs brought by subcharts; Helm installs the crds/ CRDs in the directory first, but if a subchart installs CRDs via templates (or the CRDs need a webhook to be ready), CRs will fail on the first install with no matches for kind failure; on uninstall, Helm does not delete crds/ the CRDs in the directory, and the CR deletion order is also uncontrolled, which can cause the controller to be deleted first and cloud resources to be left uncleaned. It is recommended to split into multiple releases and orchestrate them in order (Helmfile needs or Argo CD sync waves, Lesson 5): CRDs → controllers → CRs → applications.
Verified teaching videos
Official docs
- Karpenter Getting Started
- Karpenter Releases
- Amazon EBS CSI driver
- ESO · AWS Secrets Manager
- ESO · AWS Authentication (including Pod Identity)
Video storyboard (about 80 seconds)
Visual: five grey Pending Pods queue up; Karpenter opens the NodePool rule card and the EC2NodeClass card.
Narration: Karpenter acts only on the NodePool and EC2NodeClass you write; without them, the chart is installed but nothing scales out.
Visual: a new EC2 instance rises and needs an "access entry" pass to enter the cluster gate.
Narration: a new node joins the cluster with the node role, so do not forget to create an access entry for it.
Visual: the Secrets Manager vault spits out a card; ESO turns it into a Kubernetes Secret, which myapp and Redis both read.
Narration: external secrets are handed to ESO to sync; the chart only references existingSecret, so the password never goes into values again.
Module 6 · Deploying to EKS from a Pipeline
- Draw the two authentication stages from the pipeline to EKS: the AWS side (OIDC →
AssumeRoleWithWebIdentity→ temporary credentials) and the cluster side (aws eks get-token→ access entry → access policy / RBAC). - Write both the Azure Pipelines version (AWS Toolkit service connection + OIDC) and the GitHub Actions version (
aws-actions/configure-aws-credentials). - Implement automatic rollback on failure with
--rollback-on-failure(Helm 4, formerly--atomic), and be able to manuallyhelm rollback.
What: two authentication stages, three kinds of permissions
| Stage | Mechanism | Configuration needed |
|---|---|---|
| ① Pipeline → AWS | The CI platform issues an OIDC token; AWS STS AssumeRoleWithWebIdentity verifies it and issues temporary credentials | IAM OIDC identity provider + role trust policy (aud/sub condition) |
| ② AWS permissions | IAM policies of the role | eks:DescribeCluster (used by update-kubeconfig), ECR pull of the chart (ecr:GetAuthorizationToken,BatchGetImage,GetDownloadUrlForLayer), and the build role additionally needs push |
| ③ Pipeline → Kubernetes | the exec plugin in kubeconfig aws eks get-token generates a pre-signed STS token; after EKS authenticates it, it access entry maps the identity,access policy or RBAC authorization | create-access-entry + associate-access-policy (scoped to the namespace) |
the subject in the OIDC trust policy
| Platform | Issuer (IAM OIDC provider URL) | aud | sub example |
|---|---|---|---|
| Azure Pipelines (AWS Toolkit) | vstoken.dev.azure.com/{org-id} | api://AzureADTokenExchange | sc://{org}/{project}/{service-connection} |
| GitHub Actions | token.actions.githubusercontent.com | sts.amazonaws.com | repo:{org}/{repo}:environment:prod |
The Azure DevOps values come from the README of AWS Toolkit for Azure DevOps; since 1.15.0 the extension supports OIDC (check Use OIDC in the service connection, fill in only the Assume Role ARN, and leave out access keys); the current version is 1.26.0. sub Always scope it precisely to the service connection/environment; do not use wildcards that open up the whole organization.
Why: why the pipeline needs its own access entry
- The cluster creator identity (the eksctl user) automatically gets
AmazonEKSClusterAdminPolicy; letting the pipeline reuse it is the same as making the pipeline a cluster administrator. - Helm needs: read and write all resource types in the chart within the target namespace,and Secrets (release records
sh.helm.release.v1.*).AmazonEKSEditPolicy+ a namespace-scoped permission is usually enough; if the chart contains CRs (such as ExternalSecret) or cluster-scoped resources, the access policy may not cover them, and you need to use--kubernetes-groups+ a custom Role/RoleBinding instead (follow the access policy permissions table ). - Access entries live in the EKS API, are auditable (CloudTrail), can be managed as IaC, and can be repaired from outside even if the cluster is broken — safer than the aws-auth ConfigMap.
How: deployment steps
- Obtain AWS credentials (OIDC).
aws eks update-kubeconfig --name helm-lab --region ca-central-1: write the cluster endpoint, CA, and the exec plugin; do not write any static token.aws ecr get-login-password | helm registry login.helm upgrade --install myapp oci://$REG/charts/myapp --version $VER -n myapp -f values-eks.yaml --rollback-on-failure --timeout 10m(In Helm 4,--rollback-on-failureimplies waiting;--atomicstill works but prints a warning).- Smoke test:
helm testor wait for the ALB and then curl/healthz(Module 4: Helm does not wait for the ALB).
When: push-based pipeline vs GitOps
This module is "push-based": the pipeline holds cluster write permissions. GitOps (Argo CD / Flux, Lesson 5) keeps write permissions inside the cluster, and the pipeline only updates the chart version in Git — better suited to multi-cluster and compliance-heavy environments. The chart, ECR, and Pod Identity designs are exactly the same in both.
~/.kube/config as a pipeline secret is enough" — an EKS kubeconfig depends on aws eks get-token and holds no long-lived token itself; storing an environment with long-lived IAM keys in CI is the real risk. ② "Having eks:* in IAM lets you deploy" — IAM only governs AWS APIs; Kubernetes permissions come from access entries, and without one you only get Unauthorized. ③ "--rollback-on-failure rolls back the ALB/database" — it only rolls Kubernetes objects back to the previous revision.Sequence diagram: pipeline credential exchange
Structure diagram: least-privilege split
Animation: credential and permission checks for one pipeline deployment
Choose a scenario and play it, observing at each step "who is verifying whom."
Core commands and parameters
| Command | Purpose | Notes |
|---|---|---|
aws iam create-open-id-connect-provider | Register the CI platform's OIDC provider | --url https://token.actions.githubusercontent.com --client-id-list sts.amazonaws.com |
aws eks create-access-entry | Map the role into the cluster | --principal-arn … --type STANDARD |
aws eks associate-access-policy | Authorize | --policy-arn arn:aws:eks::aws:cluster-access-policy/AmazonEKSEditPolicy --access-scope type=namespace,namespaces=myapp |
aws eks update-kubeconfig | Generate kubeconfig | --name --region; can --role-arn,--alias |
helm upgrade --install … --rollback-on-failure | automatic rollback on failure | Helm 4; used together with --timeout |
helm history / helm rollback | manual rollback | helm rollback myapp 3 -n myapp --wait; without a revision number, returns to the previous version |
kubectl auth can-i --list -n myapp | Verify pipeline permissions | Run this once in the pipeline first |
# deploy role (GitHub Actions example; for ADO see the "Lab" page)
aws iam create-open-id-connect-provider --url https://token.actions.githubusercontent.com \
--client-id-list sts.amazonaws.com
cat > gha-trust.json <<EOF
{"Version":"2012-10-17","Statement":[{"Effect":"Allow",
"Principal":{"Federated":"arn:aws:iam::$ACCT:oidc-provider/token.actions.githubusercontent.com"},
"Action":"sts:AssumeRoleWithWebIdentity",
"Condition":{"StringEquals":{
"token.actions.githubusercontent.com:aud":"sts.amazonaws.com",
"token.actions.githubusercontent.com:sub":"repo:YOUR_ORG/myapp:environment:prod"}}}]}
EOF
cat > deploy-policy.json <<EOF
{"Version":"2012-10-17","Statement":[
{"Effect":"Allow","Action":"eks:DescribeCluster","Resource":"arn:aws:eks:$AWS_REGION:$ACCT:cluster/helm-lab"},
{"Effect":"Allow","Action":"ecr:GetAuthorizationToken","Resource":"*"},
{"Effect":"Allow","Action":["ecr:BatchGetImage","ecr:GetDownloadUrlForLayer","ecr:DescribeImages"],
"Resource":"arn:aws:ecr:$AWS_REGION:$ACCT:repository/charts/myapp"}]}
EOF
aws iam create-role --role-name helm-lab-ci-deploy --assume-role-policy-document file://gha-trust.json
aws iam put-role-policy --role-name helm-lab-ci-deploy --policy-name deploy --policy-document file://deploy-policy.json
# cluster side: access entry + namespace-scoped Edit
aws eks create-access-entry --cluster-name $CLUSTER \
--principal-arn arn:aws:iam::$ACCT:role/helm-lab-ci-deploy --type STANDARD
aws eks associate-access-policy --cluster-name $CLUSTER \
--principal-arn arn:aws:iam::$ACCT:role/helm-lab-ci-deploy \
--policy-arn arn:aws:eks::aws:cluster-access-policy/AmazonEKSEditPolicy \
--access-scope type=namespace,namespaces=myapp
{ "accessEntry": { "clusterName": "helm-lab", "principalArn": "arn:aws:iam::111122223333:role/helm-lab-ci-deploy", "type": "STANDARD", "username": "arn:aws:sts::111122223333:assumed-role/helm-lab-ci-deploy/{{SessionName}}", ... } }
{ "clusterName": "helm-lab", "associatedAccessPolicy": { "policyArn": "arn:aws:eks::aws:cluster-access-policy/AmazonEKSEditPolicy", "accessScope": { "type": "namespace", "namespaces": [ "myapp" ] }, ... } }
How to verify: Run kubectl auth can-i create secrets -n myapp with this role: yes for -n kube-system , no for Common mistakes: Creating the OIDC provider twice reports EntityAlreadyExists (only one is needed per account per URL); a sub written in branch format but running in an environment. Production use: Manage all of the above with Terraform, with deploy roles separated by environment.
Lab 6: upgrade the pipeline to 1.1, automatic rollback on failure, manual rollback (about 8 min)
trigger: none
parameters:
- name: chartVersion
type: string
default: "0.5.1"
variables:
AWS_REGION: ca-central-1
CLUSTER: helm-lab
stages:
- stage: deploy
jobs:
- deployment: myapp
environment: prod # environment approvals and checks (ADO Lesson 6)
pool: { vmImage: ubuntu-latest }
strategy:
runOnce:
deploy:
steps:
- checkout: self
- task: HelmInstaller@1
inputs: { helmVersionToInstall: 'v4.3.2' }
- task: AWSShellScript@1
inputs:
awsCredentials: aws-helm-lab
regionName: $(AWS_REGION)
scriptType: inline
inlineScript: |
set -euo pipefail
ACCT=$(aws sts get-caller-identity --query Account --output text)
REG=$ACCT.dkr.ecr.$AWS_REGION.amazonaws.com
aws eks update-kubeconfig --name $CLUSTER --region $AWS_REGION
aws ecr get-login-password --region $AWS_REGION | helm registry login --username AWS --password-stdin $REG
helm upgrade --install myapp oci://$REG/charts/myapp --version ${{ parameters.chartVersion }} \
-n myapp -f deploy/values-eks.yaml --rollback-on-failure --timeout 10m
helm history myapp -n myapp --max 5
ADO-side IAM trust policy: Federated arn:aws:iam::ACCT:oidc-provider/vstoken.dev.azure.com/{org-id}, condition vstoken.dev.azure.com/{org-id}:aud = api://AzureADTokenExchange,:sub = sc://{org}/{project}/aws-helm-lab (taken from the AWS Toolkit README). HelmInstaller@1 Whether Helm 4 can be installed follows the task description; otherwise switch to a script get-helm-4 install.
name: deploy-myapp
on:
workflow_dispatch:
inputs:
chartVersion: { required: true, default: "0.5.1" }
permissions:
id-token: write # request an OIDC token
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
environment: prod # matches environment:prod in the trust policy sub
env: { AWS_REGION: ca-central-1, CLUSTER: helm-lab }
steps:
- uses: actions/checkout@v7
- uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: arn:aws:iam::111122223333:role/helm-lab-ci-deploy
aws-region: ${{ env.AWS_REGION }}
- uses: azure/setup-helm@v5
with: { version: v4.3.2 }
- run: |
REG=$(aws sts get-caller-identity --query Account --output text).dkr.ecr.$AWS_REGION.amazonaws.com
aws eks update-kubeconfig --name $CLUSTER --region $AWS_REGION
aws ecr get-login-password | helm registry login --username AWS --password-stdin $REG
helm upgrade --install myapp oci://$REG/charts/myapp --version ${{ inputs.chartVersion }} \
-n myapp -f deploy/values-eks.yaml --rollback-on-failure --timeout 10msed -i 's/^version: .*/version: 0.5.1/; s/^appVersion: .*/appVersion: "1.1"/' myapp/Chart.yaml helm package ./myapp && helm push myapp-0.5.1.tgz oci://$REG/charts # trigger the pipeline (chartVersion=0.5.1); when it completes: helm history myapp -n myapp --max 4; curl -s http://$ALB/
REVISION UPDATED STATUS CHART APP VERSION DESCRIPTION 3 Sun Nov 15 11:02:10 2026 superseded myapp-0.5.0 1.0 Upgrade complete 4 Sun Nov 15 11:20:44 2026 deployed myapp-0.5.1 1.1 Upgrade complete myapp v1.1 from myapp-5f6d…, hits=7
9.9, and run the pipeline:
Error: UPGRADE FAILED: release myapp failed, and has been rolled back due to rollback-on-failure being set: context deadline exceeded REVISION STATUS CHART APP VERSION DESCRIPTION 4 superseded myapp-0.5.1 1.1 Upgrade complete 5 failed myapp-0.5.2 9.9 Upgrade "myapp" failed: context deadline exceeded 6 deployed myapp-0.5.1 1.1 Rollback to 4
The image pull failure (ErrImagePull) means kstatus never sees readiness; after the timeout, Helm automatically rolls back to revision 4. Live traffic is served by the old Pods throughout (protected by the rolling update's maxUnavailable).
helm rollback myapp 3 -n myapp --wait helm history myapp -n myapp --max 2
kubectl auth can-i create deployments -n kube-system, which should output no.Case 1: migrating from long-lived access keys to OIDC
Problem: The pipeline variables stored an access key for an IAM user that had not been rotated for two years, with AdministratorAccess permissions. Approach: Create the OIDC provider and the deploy role (read-only ECR + DescribeCluster), restrict the access entry to a namespace; switch the ADO service connection to the AWS Toolkit's OIDC method; disable and delete the old key. Limitation: Self-hosted agents can also use OIDC; but agents that use an EC2 instance role do not need OIDC, so make sure the agent role does not have excessive permissions.
Case 2: multi-environment approvals
Problem: The same pipeline deploys to dev and prod. Approach: Two deploy roles, whose trust policy subs are bound to environment:dev and environment:prod respectively (ADO uses two service connections + environment approvals); the prod cluster's access entries accept only the prod role. Limitation: GitHub environment names are case-sensitive, so the sub must match exactly.
Case 3: ESO secrets inconsistent after rollback
Problem: A new version changed the ExternalSecret's remoteKey; after rollback, the Secret that old Pods read had already been overwritten with the new key. Approach: Change the structure of secrets in three steps: "add the new key → read both → retire the old key"; when the ExternalSecret target name changes between versions, keep the old Secret for a period. Limitation:helm rollback Rollback restores only Kubernetes objects; the state of external systems requires application-level compatibility.
Common errors and fixes
Error: Could not assume role with OIDC: Not authorized to perform sts:AssumeRoleWithWebIdentity
Cause: The sub/aud in the trust policy does not match the token (the branch, environment, or service connection name changed), or the OIDC provider does not exist / its URL is inconsistent, or GitHub is missing the id-token: write.
Fix: Print the token claims (on GitHub, use actions/github-script to get the ID token and decode it; in ADO, view the service connection details) and compare them with the trust policy; match the sub exactly.
error: You must be logged in to the server (Unauthorized) / Error: Kubernetes cluster unreachable: the server has asked for the client to provide credentials
Cause: Authentication failed: the pipeline role has no access entry; or update-kubeconfig used the wrong region/cluster; or the token was issued by another identity.
aws sts get-caller-identity aws eks list-access-entries --cluster-name $CLUSTER
Fix: Create the access entry for the role ARN (not the assumed-role session ARN).
Error: UPGRADE FAILED: … secrets is forbidden: User "arn:aws:sts::…:assumed-role/helm-lab-ci-deploy/…" cannot list resource "secrets" in API group "" in the namespace "myapp"
Cause: Authentication passed but authorization is insufficient: the access policy scope does not include myapp, or AmazonEKSViewPolicy was used (which excludes Secrets). Helm needs Secret permissions to read release records.
aws eks list-associated-access-policies --cluster-name $CLUSTER --principal-arn arn:aws:iam::$ACCT:role/helm-lab-ci-deploy
An error occurred (AccessDeniedException) when calling the DescribeCluster operation
Cause: The deploy role lacks eks:DescribeCluster, so update-kubeconfig fails on its very first step.
Fix: Add eks:DescribeCluster to the IAM policy (Resource limited to the cluster ARN).
Error: UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress
Cause: The previous pipeline run was cancelled, and the release is stuck in pending-upgrade.
Fix:helm history After confirming, helm rollback myapp <previous deployed revision>; for a deeper analysis seeLesson 7. The pipeline should set a concurrency lock (ADO environment exclusive lock / GitHub concurrency).
1. List all access entries in helm-lab and their associated policies.
for p in $(aws eks list-access-entries --cluster-name $CLUSTER --query 'accessEntries[]' --output text); do echo "== $p"; aws eks list-associated-access-policies --cluster-name $CLUSTER --principal-arn $p --query 'associatedAccessPolicies[].[policyArn,accessScope.type]' --output text; done
2. In the pipeline, assert that the current identity can only write to the myapp namespace.
test "$(kubectl auth can-i create secrets -n myapp)" = yes test "$(kubectl auth can-i create secrets -n kube-system)" = no
The security team requires that "the pipeline must not have any cluster write permissions," but automatic deployment is still needed. How would you rework the solution in this module?
Switch to GitOps: the pipeline only builds images, pushes charts to ECR, and submits a change to the Git configuration Repository recording "chart version + digest" (PR + approval); Argo CD / Flux inside the cluster uses its own Pod Identity to pull the chart from ECR (read-only ECR) and reconcile. The pipeline role has only ECR push and Git write permissions, and the access entry can be deleted. See Lesson 5 for details.
Verified teaching videos
No officially verifiable video on EKS access entries was found via oEmbed.
Official docs
- Grant IAM users access to Kubernetes with EKS access entries
- Access policy permissions
- aws eks update-kubeconfig
- aws-actions/configure-aws-credentials
- AWS Toolkit for Azure DevOps (OIDC configuration)
- helm upgrade
Video storyboard (about 80 seconds)
Visual: the pipeline figure holds no key; it carries only an OIDC ticket that expires in a few minutes, walks to the STS counter, and exchanges it for a 1-hour temporary pass.
Narration: the pipeline stores no AWS keys; it exchanges an OIDC token for temporary credentials.
Visual: the pass is scanned at the EKS gate; the list (access entries) includes it, and the permission card reads "can only enter the myapp room."
Narration: IAM proves who you are, access entries let you into the cluster, and the access policy decides which namespace you can act on.
Visual: helm upgrade fails, a rewind button is pressed automatically, and the revision goes back to the previous green version.
Narration: with rollback-on-failure added, a failed release rolls back automatically.
Module 7 · Troubleshooting in the Cloud
- Classify faults with the "three-layer method": Helm layer (rendering, release status, OCI pulls) → Kubernetes layer (objects, events, controller logs) → AWS layer (IAM, subnet tags, quotas, CloudTrail).
- Troubleshoot and fix independently: ECR 401 / no basic auth credentials / name unknown; LBC does not create the ALB (subnet tags, IAM, IngressClass); Karpenter does not scale out;
Unauthorized/Forbidden. - Be fluent with the interactive troubleshooting tree, going from symptom to diagnostic commands and fixes.
What: the three-layer model of cloud Helm faults
| Layer | Typical symptoms | First command | Whose problem |
|---|---|---|---|
| Helm layer | helm upgrade Direct errors: 401/404 pull failures, template rendering failures,no matches for kind,another operation is in progress | helm upgrade … --debug,helm history | chart, ECR, release status |
| Kubernetes layer | Helm succeeds (or times out), but Pods are not Ready, the Ingress has no address, Pods are Pending | kubectl describe + kubectl get events --sort-by=.lastTimestamp | controllers, scheduling, images |
| AWS layer | Controller logs show AccessDenied,UnauthorizedOperation, subnet/quota errors | Controller logs + aws sts get-caller-identity + CloudTrail | IAM, networking, quotas |
Why: why troubleshooting in the cloud is easy to get lost in
- Asynchronous: Helm only writes objects to the API Server; ALBs, EC2 instances, and Secret syncs are handled afterward by controllers; Helm showing
deployeddoes not mean the cloud resources are ready. - Long identity chain: A single command may involve three identities: your IAM identity (ECR, EKS authentication), the controller's Pod Identity (ELBv2/EC2), and the node role (pulling images, joining the cluster). The ARN in an error message tells you who failed.
- The difference between 401 and 403: 401/Unauthorized = authentication (you were not recognized: expired token, no access entry, not logged in to ECR); 403/Forbidden/AccessDenied = authorization (recognized, but without permission).
How: quick reference for the four fault types
| Fault | Key error | Most likely root cause | Fix |
|---|---|---|---|
| Failed to pull/push chart to ECR | 401 Unauthorized,no basic auth credentials (Docker),name unknown,403 (public.ecr.aws) | Token expired (12 hours), logged in to another region, Repository not created, chart name written twice in the reference, stale public Repository credentials left over | Log in again get-login-password | helm registry login; create the Repository; helm registry logout public.ecr.aws |
| LBC does not create the ALB | FailedBuildModel … couldn't auto-discover subnets,AccessDenied elasticloadbalancing:…, no events | subnets missing tags; outdated IAM policy or credentials falling back to the node role; ingressClassName wrong; another Ingress in the IngressGroup has an error | add tags; update the policy, check associations; correct the class name |
| Karpenter does not scale out | Pod Pending; NodeClaim does not appear or never becomes Registered; logs incompatible with nodepool | No NodePool, requirements mismatch, limits exhausted, EC2NodeClass not Ready, node role missing an access entry, instance quota | Troubleshoot in this order: NodePool → EC2NodeClass → NodeClaim → node join |
| Unauthorized / Forbidden | You must be logged in to the server (Unauthorized),Kubernetes cluster unreachable,… is forbidden: User "arn:aws:sts::…" | No access entry / SSO expired / kubeconfig points to the wrong identity; access policy scope is wrong | create-access-entry,associate-access-policy, confirm get-caller-identity |
context deadline exceeded it is almost always the Kubernetes layer not being ready (images, probes, scheduling); check the Pod events. ② "Try AdministratorAccess when you see AccessDenied"—first read the ARN: which role is it? If the node role appears in the controller's error, Pod Identity is not working; adding permissions only hides the problem. ③ "Reinstall LBC when the Ingress has no address"—first kubectl describe ingress, the events usually already state the cause.Locator diagram: determine the fault layer from the identity in the error
Flowchart: check order when an Ingress has no address
Fault reproduction simulator
Select a fault, click the diagnostic commands in turn to gather evidence, then choose a fix. The simulator tells you whether your choice is correct and why.
Troubleshooting command toolbox
| Scenario | Command | What to look for |
|---|---|---|
| Helm pull | helm show chart oci://$REG/charts/myapp --version X --debug | 401 / 404 / 403 and the request URL |
| ECR credentials | cat ~/.config/helm/registry/config.json | jq '.auths | keys' | Which registry hosts you are logged in to |
| Release status | helm history myapp -n myapp,helm status myapp -n myapp | pending-* / failed |
| Events | kubectl get events -n myapp --sort-by=.lastTimestamp | tail -20 | FailedBuildModel, FailedScheduling, ErrImagePull |
| LBC | kubectl -n kube-system logs deploy/aws-load-balancer-controller --tail=100 | grep -iE "error|denied" | Failing API and ARN |
| Karpenter | kubectl -n kube-system logs deploy/karpenter --tail=100,kubectl get nodeclaims -o wide | incompatible,Launched/Registered/Initialized |
| ESO | kubectl describe externalsecret -n myapp | SecretSyncedError reason |
| Identity | aws sts get-caller-identity,kubectl auth whoami | Current IAM identity and K8s username |
| Access entries | aws eks list-access-entries,list-associated-access-policies | whether they exist, and their scope |
| CloudTrail | aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=CreateLoadBalancer --max-results 5 | errorCode / errorMessage |
# One-step collection of diagnostic information (paste into the ticket)
{
echo "== identity"; aws sts get-caller-identity; kubectl auth whoami 2>&1
echo "== helm"; helm list -A; helm history myapp -n myapp --max 5
echo "== myapp"; kubectl -n myapp get deploy,pod,ingress,externalsecret -o wide
echo "== events"; kubectl get events -A --sort-by=.lastTimestamp | tail -30
echo "== lbc"; kubectl -n kube-system logs deploy/aws-load-balancer-controller --tail=50 2>&1 | grep -iE "error|denied" | tail -10
echo "== pod identity"; aws eks list-pod-identity-associations --cluster-name $CLUSTER --output table
} > diag-$(date +%H%M).txt 2>&1; wc -l diag-*.txt
ATTRIBUTE VALUE Username arn:aws:sts::111122223333:assumed-role/AWSReservedSSO_Admin_xxxx/andy Groups [system:authenticated] Extra: accessKeyId [ASIA…] Extra: arn [arn:aws:sts::111122223333:assumed-role/AWSReservedSSO_Admin_xxxx/andy] Extra: canonicalArn [arn:aws:iam::111122223333:role/AWSReservedSSO_Admin_xxxx]
How to verify:canonicalArn This is the principal ARN that the access entry requires. Common mistakes: When creating an access entry for an SSO role, the ARN was written with aws-reserved/sso.amazonaws.com/ a path. The access entry should use the role ARN without the path (follow the EKS documentation).
Lab 7: reproduce, diagnose, and fix 4 faults (about 9 min)
helm registry logout $REG helm show chart oci://$REG/charts/myapp --version 0.5.1 2>&1 | tail -1 # reproduce: 401 aws ecr get-login-password --region $AWS_REGION | helm registry login --username AWS --password-stdin $REG helm show chart oci://$REG/charts/myapp --version 0.5.1 | grep ^version # after the fix helm push myapp-0.5.1.tgz oci://$REG/charts/myapp 2>&1 | tail -1 # reproduce: name unknown (chart name written twice)
internal-elb tag from the private subnets to reproduce:
PRIV=$(aws ec2 describe-subnets --filters Name=vpc-id,Values=$VPC_ID Name=tag:kubernetes.io/role/internal-elb,Values=1 --query 'Subnets[].SubnetId' --output text) aws ec2 delete-tags --resources $PRIV --tags Key=kubernetes.io/role/internal-elb kubectl -n myapp create ingress myapp-int --class=alb --rule="/*=myapp:80" \ --annotation alb.ingress.kubernetes.io/scheme=internal --annotation alb.ingress.kubernetes.io/target-type=ip sleep 20; kubectl -n myapp describe ingress myapp-int | tail -3 aws ec2 create-tags --resources $PRIV --tags Key=kubernetes.io/role/internal-elb,Value=1 # fix kubectl -n myapp annotate ingress myapp-int retry=$(date +%s) --overwrite; sleep 60 kubectl -n myapp get ingress myapp-int kubectl -n myapp delete ingress myapp-int # clean up (LBC deletes the internal ALB)
Warning FailedBuildModel 20s ingress Failed build model due to couldn't auto-discover subnets: unable to resolve at least one subnet (0 match VPC and tags: [kubernetes.io/role/internal-elb]) NAME CLASS HOSTS ADDRESS PORTS AGE myapp-int alb * internal-k8s-myapp-myappint-…ca-central-1.elb.amazonaws.com 80 90s
kubectl patch nodepool default --type merge -p '{"spec":{"limits":{"cpu":"1"}}}'
kubectl create deployment inflate --image=public.ecr.aws/eks-distro/kubernetes/pause:3.7 --replicas=5
kubectl set resources deploy/inflate --requests=cpu=1
sleep 30; kubectl -n kube-system logs deploy/karpenter --tail=20 | grep -i limit
kubectl patch nodepool default --type merge -p '{"spec":{"limits":{"cpu":"16"}}}' # fix
kubectl get nodeclaims -w # press Ctrl+C once the new NodeClaim appears
kubectl delete deploy inflate
The logs will show a message related to the NodePool limits (the exact wording varies by version).
aws eks delete-access-entry --cluster-name $CLUSTER --principal-arn arn:aws:iam::$ACCT:role/helm-lab-ci-deploy # run the pipeline → log: Error: Kubernetes cluster unreachable: the server has asked for the client to provide credentials aws eks create-access-entry --cluster-name $CLUSTER --principal-arn arn:aws:iam::$ACCT:role/helm-lab-ci-deploy --type STANDARD aws eks associate-access-policy --cluster-name $CLUSTER --principal-arn arn:aws:iam::$ACCT:role/helm-lab-ci-deploy \ --policy-arn arn:aws:eks::aws:cluster-access-policy/AmazonEKSEditPolicy --access-scope type=namespace,namespaces=myapp
Case 1: every pipeline returned 401 on Monday morning
Problem: Someone put helm registry login into the boot script on the self-hosted agent; the token expired after 12 hours, and everything failed after the weekend. Approach: Log in at the start of every job (get the token per job); put the registry configuration in the job's temp directory (--registry-config $(Agent.TempDirectory)/registry.json), so credentials are not shared between jobs.
Case 2: one team's mistake in an IngressGroup takes down the whole group
Problem: Team A's Ingress referenced a certificate ARN that does not exist; after Team B released into the same group (same ALB), its routes stayed ineffective for a long time. Approach: Locate the failing Ingress in the group from the LBC events; split group.name by team/namespace; in chart CI, use kubeconform + custom rules to validate annotations.
Case 3: Karpenter nodes stayed NotReady
Problem: The platform renamed the node role and also updated the EC2NodeClass role, but forgot to create an access entry for the new role. Instances launched successfully, but kubelet could not register; the NodeClaim stayed in Launched, was reclaimed by Karpenter as a registration failure a few minutes later, and was relaunched, creating a cost loop. Approach: Create the access entry and the node role in the same Terraform module; alert on NodeClaim registration-failure events.
Interactive troubleshooting tree
Choose step by step by symptom; leaf nodes give the diagnostic commands and fixes. You can go "back" or "start over" at any time.
Supplement: more real errors
Error: failed to do request: Head "https://111122223333.dkr.ecr.ca-central-1.amazonaws.com/v2/charts/myapp/manifests/0.5.1": dial tcp: lookup … no such host
Cause: The self-hosted agent in the private subnet cannot resolve or reach ECR (no NAT, and no ECR interface endpoint).
Fix: Create for the VPC com.amazonaws.ca-central-1.ecr.api,ecr.dkr interface endpoints and an S3 gateway endpoint, or provide a NAT egress.
Error: UPGRADE FAILED: rendered manifests contain a resource that already exists. Unable to continue with update: IngressClass "alb" in namespace "" exists and cannot be imported into the current release
Cause: IngressClass alb It was already created by another release (or manually / by Auto Mode configuration), and the current chart also tries to create it.
Fix: Set in the LBC chart createIngressClassResource=false, or after confirming ownership, add Helm ownership metadata to the object (meta.helm.sh/release-name etc.) before taking it over.
Failed to pull image "111122223333.dkr.ecr.ca-central-1.amazonaws.com/myapp:1.1": … 403 Forbidden
Cause: The node role lacks ECR pull permissions (when creating a custom node role, the AmazonEC2ContainerRegistryPullOnly) was missed, or the cross-account Repository policy does not grant access.
Fix: Attach the managed policy or add to the Repository policy. Note: this is node pulling images; it has nothing to do with Pod Identity.
1. View the 20 most recent Warning events related to myapp.
kubectl get events -n myapp --field-selector type=Warning --sort-by=.lastTimestamp | tail -20
2. In CloudTrail, find the recent failed ELBv2 calls made by LBC.
aws cloudtrail lookup-events --lookup-attributes AttributeKey=Username,AttributeValue=eks-helm-lab-aws-load-b… --max-results 20 \ --query 'Events[].CloudTrailEvent' --output text | jq -r 'select(.errorCode) | [.eventName,.errorCode] | @tsv'
The Pod Identity session name contains cluster and Pod information; check one event first to confirm the actual Username format.
In a pipeline, helm upgrade --rollback-on-failure the deploy times out and rolls back, and the log only shows context deadline exceeded. In what order would you troubleshoot?
① helm history Confirm the failed revision and the chart/appVersion; ② compare the manifest of the failed revision (helm get manifest myapp --revision N) against the previous version to find the changes; ③ because it has already rolled back, the Pods are gone — when a pipeline fails, first collect kubectl get events and describe pod (or temporarily remove the automatic rollback and reproduce in a staging environment); ④ common causes: the image tag does not exist (ErrImagePull; node role / ECR), a wrong probe path, an ExternalSecret that has not synced (causing CreateContainerConfigError), or resource requests that are too large (causing Pending; Karpenter limits).
Verified teaching videos
No video specifically covering "troubleshooting Helm deployments on EKS" could be verified via YouTube oEmbed. You can review the videos listed in Modules 3, 4, and 6, and refer to the official troubleshooting documentation below.
Official docs
- Troubleshooting Amazon ECR errors
- Troubleshoot problems with Amazon EKS clusters and nodes
- LBC · Subnet auto-discovery
- Karpenter Troubleshooting
Video storyboard (about 90 seconds)
Visual: a red error message is swept by a magnifying glass, and the ARN part is highlighted.
Narration: first read the identity in the error: is it you, the controller, or the node? That decides which layer to look in for the cause.
Visual: three floors: Helm, Kubernetes, AWS. An elevator stops at each floor from the top down, and each floor lights up one command.
Narration: the Helm layer uses history and debug, the Kubernetes layer uses events and controller logs, and the AWS layer uses IAM, tags, and CloudTrail.
Visual: two signs, 401 and 403, pointing to "access entry / login" and "policy / RBAC" respectively.
Narration: 401 means it does not recognize you; 403 means it recognizes you but does not let you do it.
Module 8 · Cost, Cleanup, and Self-Check
- List the cost components of this lesson's labs, and explain which resources are created indirectly by Helm and are invisible to Helm.
- Clean up in the correct order: business releases (ALBs, PVCs) → Karpenter nodes → cluster-level charts → cluster → account-level resources (ECR, Secrets Manager, IAM, OIDC providers, CloudFormation).
- Use the AWS CLI to verify "zero leftovers."
What: the resources in this lesson that incur costs
| Resource | Created by | Visible to Helm? | Deleted with the cluster? |
|---|---|---|---|
| EKS control plane, managed node group, VPC, NAT gateway | eksctl (CloudFormation) | No | Yes (eksctl delete cluster deleting its CloudFormation stack) |
| ALB, target groups, security groups created by LBC | LBC (because of myapp's Ingress) | No (only the Ingress is visible) | No— leftovers block VPC deletion and keep billing |
| EBS volumes (Redis PVC) | EBS CSI (because of the StatefulSet's PVCs) | No (PVCs also do not belong to the release) | No— become orphaned volumes in the available state |
| EC2 instances launched by Karpenter, launch templates | Karpenter | No | Not guaranteed — the official cleanup steps require deleting launch templates separately |
| ECR Repositories, Secrets Manager secrets, IAM roles/policies, OIDC providers, Karpenter CloudFormation stack | You (CLI) | No | No (account-level resources) |
| Pod Identity associations, access entries | You (EKS API) | No | Yes (deleted with the cluster) |
Why: why the order matters
LBC adds a finalizer to the Ingress (ingress.k8s.aws/resources), and when the Ingress is deleted it first deletes the ALB and then removes the finalizer. If you first helm uninstall aws-load-balancer-controller or delete the cluster directly, no controller is left to do this: the Ingress gets stuck in Terminating (nobody processes the finalizer), and the ALB stays in the account forever. EBS volumes and Karpenter nodes work the same way.
How: the correct cleanup order
helm uninstall myapp -n myapp --wait: deleting the Ingress → LBC deletes the ALB/target group/security groups; deleting the ExternalSecret → the synced Secret is deleted (creationPolicy Owner).kubectl delete pvc --all -n myapp: the StatefulSet's PVCs do not belong to the release and must be deleted manually (reclaimPolicy Delete → deletes the EBS volume).- Verify that the ALB and volumes are gone (
aws elbv2 describe-load-balancers,aws ec2 describe-volumes). - (if Karpenter is installed)
kubectl delete nodepool --allHave Karpenter terminate its nodes, thenhelm uninstall karpenter -n kube-system. helm uninstall external-secrets -n external-secrets,helm uninstall aws-load-balancer-controller -n kube-system.eksctl delete cluster -f helm-lab.yaml --wait(also deletes the add-ons, associations, access entries, node groups, and VPC).- Account-level: the Karpenter CloudFormation stack and launch templates, the ECR Repository (
--force), Secrets Manager (--force-delete-without-recovery), IAM roles/policies, the OIDC provider used by CI, and CloudWatch log groups (if control plane logging is enabled).
When: when not to delete
If the next lesson still uses EKS, you can do only steps 1–5 and scale the node group to 0 (eksctl scale nodegroup --nodes 0 --nodes-min 0), but the control plane is still billed at 0.10 USD/hour and the NAT gateway is still billed. Helm Lessons 5–7 use a local kind cluster,so it is recommended to delete everything today.
eksctl delete cluster will clean up everything for me"—it deletes only resources in the CloudFormation stack it created; the ALBs and EBS volumes that controllers create at runtime are not in it. ② "helm uninstall will delete the PVCs"—PVCs from a StatefulSet's volumeClaimTemplates do not belong to the release. ③ "Deleting a Secrets Manager secret takes effect immediately"—by default there is a 7–30 day recovery window (during which a secret with the same name cannot be recreated); lab environments use --force-delete-without-recovery.Dependency diagram: cleanup order
Cost breakdown (per hour, order of magnitude)
Interactive: cost calculator + cleanup order sorting
② Cleanup order: click the steps below in the order you think is correct, then click "Check."
Cleanup and verification commands
| Command | Purpose | Notes |
|---|---|---|
helm uninstall myapp -n myapp --wait | Uninstall the applications and wait for resources to be deleted | returns only after the Ingress finalizer completes |
aws elbv2 describe-load-balancers --query "LoadBalancers[?starts_with(LoadBalancerName,'k8s-')]" | Check the ALBs created by LBC | should be empty |
aws ec2 describe-volumes --filters Name=status,Values=available | Orphaned EBS volumes | Look at kubernetes.io/created-for/pvc/name tags |
eksctl delete cluster -f helm-lab.yaml --wait | Delete the cluster and VPC | about 10–15 min |
aws ecr delete-repository --force | Delete the Repository and all images/charts in it | Not recoverable |
aws secretsmanager delete-secret --force-delete-without-recovery | Delete the secret immediately | Skip the recovery window |
aws resourcegroupstaggingapi get-resources --tag-filters Key=elbv2.k8s.aws/cluster,Values=helm-lab | Find leftovers by cluster tag | Tags that LBC applies to resources |
# ===== 1. Application releases (let the controllers delete cloud resources) ===== helm uninstall myapp -n myapp --wait --timeout 10m kubectl -n myapp get ingress,pvc kubectl delete pvc --all -n myapp --wait aws elbv2 describe-load-balancers --query "LoadBalancers[?starts_with(LoadBalancerName,'k8s-')].LoadBalancerName" # ===== 2. Karpenter nodes (if installed) ===== kubectl delete nodepool --all 2>/dev/null; kubectl get nodeclaims helm uninstall karpenter -n kube-system 2>/dev/null # ===== 3. Cluster-level charts ===== helm uninstall external-secrets -n external-secrets helm uninstall aws-load-balancer-controller -n kube-system helm list -A # should be empty # ===== 4. Cluster ===== eksctl delete cluster -f helm-lab.yaml --wait
release "myapp" uninstalled No resources found in myapp namespace. [] release "external-secrets" uninstalled release "aws-load-balancer-controller" uninstalled NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION 2026-11-15 12:40:01 [ℹ] deleting EKS cluster "helm-lab" ... 2026-11-15 12:52:37 [✔] all cluster resources were deleted
# ===== 5. Account-level resources ===== aws cloudformation delete-stack --stack-name Karpenter-$CLUSTER 2>/dev/null aws ec2 describe-launch-templates --filters Name=tag:karpenter.k8s.aws/cluster,Values=$CLUSTER \ --query 'LaunchTemplates[].LaunchTemplateName' --output text | xargs -r -n1 aws ec2 delete-launch-template --launch-template-name aws ecr delete-repository --repository-name charts/myapp --force aws ecr delete-repository --repository-name myapp --force aws secretsmanager delete-secret --secret-id myapp/redis --force-delete-without-recovery for r in helm-lab-myapp helm-lab-eso helm-lab-ci-deploy; do for p in $(aws iam list-role-policies --role-name $r --query 'PolicyNames[]' --output text); do aws iam delete-role-policy --role-name $r --policy-name $p; done aws iam delete-role --role-name $r done aws iam detach-role-policy --role-name helm-lab-lbc --policy-arn arn:aws:iam::$ACCT:policy/AWSLoadBalancerControllerIAMPolicy aws iam delete-role --role-name helm-lab-lbc aws iam delete-policy --policy-arn arn:aws:iam::$ACCT:policy/AWSLoadBalancerControllerIAMPolicy # only if no other projects use them: # aws iam delete-open-id-connect-provider --open-id-connect-provider-arn arn:aws:iam::$ACCT:oidc-provider/token.actions.githubusercontent.com # ===== 6. Verify zero leftovers ===== aws eks list-clusters --query clusters aws ec2 describe-volumes --filters Name=status,Values=available --query 'Volumes[].VolumeId' aws elbv2 describe-target-groups --query "TargetGroups[?starts_with(TargetGroupName,'k8s-')].TargetGroupName" aws ec2 describe-instances --filters Name=tag:karpenter.sh/nodepool,Values=* Name=instance-state-name,Values=running --query 'Reservations[].Instances[].InstanceId'
How to verify: All output from the last four commands []. Common mistakes:eksctl delete cluster Stuck deleting the VPC stack — almost always caused by security groups or ENIs left behind by LBC; delete the ALB and k8s- security groups with the prefix first. eksctl create podidentityassociation --role-name $CLUSTER-karpenter The roles created by eksctl are managed by its CloudFormation stack and are usually deleted with the cluster; after deleting, use aws iam get-role --role-name $CLUSTER-karpenter to confirm (should return NoSuchEntity).
Lab 8: full cleanup and verification (about 6 min of commands + 15 min of waiting)
aws resourcegroupstaggingapi get-resources --tag-filters Key=elbv2.k8s.aws/cluster,Values=$CLUSTER \ --query 'ResourceTagMappingList[].ResourceARN' --output text | tr '\t' '\n'
arn:aws:elasticloadbalancing:ca-central-1:111122223333:loadbalancer/app/k8s-myapp-myapp-3f2a9c1b7e/… arn:aws:elasticloadbalancing:ca-central-1:111122223333:targetgroup/k8s-myapp-myapp-8a1b2c3d4e/… arn:aws:ec2:ca-central-1:111122223333:security-group/sg-0…
[].Self-check list (answer without looking at materials)
Case 1: the test cluster was deleted, but the bill kept coming
Problem: A developer directly eksctl delete cluster, the VPC stack deletion failed; six ALBs and 20 EBS volumes in the available state were left in the console, and this was not discovered until a month later. Approach: The cluster deletion pipeline is fixed to: "uninstall applications → verify → uninstall controllers → delete cluster → scan for leftovers"; AWS Budgets alerts; in the LBC values, set defaultTags (for example, Owner,Cluster) so that resources can be scanned by tag.
Case 2: Ingress stuck in Terminating
Problem: LBC was uninstalled first, so when the Ingress was deleted, nobody processed the finalizer. Approach: Reinstall LBC (same version) so it can complete the cleanup; only as a last resort, remove the finalizer manually (kubectl patch ingress … -p '{"metadata":{"finalizers":null}}' --type merge), but then the ALB must be deleted manually.
Case 3: shutting down environments overnight
Problem: The development cluster is unused overnight. Approach: Scale the managed node group to 0 overnight (or use Karpenter's NodePool budget/disable); merge application Ingresses into one IngressGroup so that only one ALB remains; the control plane cost cannot be paused, so evaluate whether to use a temporary cluster rebuilt daily (IaC + one-step Helm rebuild).
Common errors and fixes
eksctl delete cluster: DELETE_FAILED … The vpc 'vpc-0abc' has dependencies and cannot be deleted / resource sg-0… has a dependent object
Cause: ALBs or security groups created by LBC are still in the VPC.
aws elbv2 describe-load-balancers --query "LoadBalancers[?VpcId=='$VPC_ID'].LoadBalancerArn" aws ec2 describe-security-groups --filters Name=vpc-id,Values=$VPC_ID --query "SecurityGroups[?starts_with(GroupName,'k8s-')].[GroupId,GroupName]" aws ec2 describe-network-interfaces --filters Name=vpc-id,Values=$VPC_ID --query 'NetworkInterfaces[].[NetworkInterfaceId,Description]'
Fix: Delete in order: ALB → target groups → k8s- security groups → leftover ENIs, then retry the deletion.
helm uninstall myapp --wait never returns, and the Ingress is Terminating
Cause: LBC is no longer running (or lacks permission to delete the ALB).
kubectl -n myapp get ingress myapp -o jsonpath='{.metadata.finalizers}'
kubectl -n kube-system get deploy aws-load-balancer-controllerAn error occurred (InvalidRequestException) when calling the CreateSecret operation: You can't create this secret because a secret with this name is already scheduled for deletion.
Cause: The recovery window was used when the secret was deleted earlier.
aws secretsmanager restore-secret --secret-id myapp/redis aws secretsmanager delete-secret --secret-id myapp/redis --force-delete-without-recovery
DeleteConflict: Cannot delete entity, must detach all policies first.
Cause: The IAM role still has managed or inline policies attached.
Fix: First, detach-role-policy / delete-role-policy, then delete-role.
1. List all volumes in the account that are in the available state and were created for PVCs by EBS CSI.
aws ec2 describe-volumes --filters Name=status,Values=available Name=tag-key,Values=kubernetes.io/created-for/pvc/name \ --query 'Volumes[].[VolumeId,Size,Tags[?Key==`kubernetes.io/created-for/pvc/name`].Value|[0]]' --output table
2. Wait for LBC to delete the ALB before continuing (for use in a cleanup script).
until [ "$(aws elbv2 describe-load-balancers --query "length(LoadBalancers[?starts_with(LoadBalancerName,'k8s-myapp-')])")" = "0" ]; do sleep 10; done
A colleague says, "I'll just directly kubectl delete ns myapp and then eksctl delete cluster, which is faster than helm uninstall." What are the risks of doing this?
Deleting the namespace removes the Ingress and PVCs; LBC and EBS CSI are still running, so in theory the ALB and volumes will be cleaned up. But namespace deletion is asynchronous: if you delete the cluster right away, the controllers may be deleted before they finish, leaving leftovers; the Helm release Secret is also deleted with the namespace, losing the audit record. The correct approach is to helm uninstall --wait, confirm the cloud resources are gone, and only then delete the cluster.
Verified teaching videos
No official video on "cleaning up the EKS lab environment" could be verified via oEmbed.
Official docs
Video storyboard (about 60 seconds)
Visual: a block tower: the cluster at the bottom, LBC above it, myapp above that, and an ALB balloon floating at the very top.
Narration: take the tower apart from the top down. First uninstall myapp, so the controller pulls the ALB balloon back in.
Visual: the wrong way: the bottom layer is pulled out directly, the ALB balloon drifts away, and a meter next to it starts ticking.
Narration: delete the cluster directly, and the cloud resources created by controllers are left unmanaged; they will also block VPC deletion.
Visual: in the terminal, all four verification commands output empty arrays, with green check marks.
Narration: finally, verify zero leftovers with the CLI, and check the bill again the next day.
Command cheat sheet
Environment variables
export AWS_REGION=ca-central-1 CLUSTER=helm-lab export ACCT=$(aws sts get-caller-identity --query Account --output text) export REG=$ACCT.dkr.ecr.$AWS_REGION.amazonaws.com
ECR as a chart repository
aws ecr create-repository --repository-name charts/myapp --image-tag-mutability IMMUTABLE aws ecr get-login-password | helm registry login --username AWS --password-stdin $REG helm package ./myapp && helm push myapp-0.5.1.tgz oci://$REG/charts helm show values oci://$REG/charts/myapp --version 0.5.1 helm upgrade --install myapp oci://$REG/charts/myapp@sha256:DIGEST -n myapp
Pod Identity
# trust: Service pods.eks.amazonaws.com, actions sts:AssumeRole + sts:TagSession aws eks create-pod-identity-association --cluster-name $CLUSTER \ --namespace myapp --service-account myapp --role-arn arn:aws:iam::$ACCT:role/R aws eks list-pod-identity-associations --cluster-name $CLUSTER kubectl -n myapp rollout restart deploy/myapp # after the association changes kubectl -n myapp exec deploy/myapp -- env | grep AWS_CONTAINER
SA in the chart (cloud-neutral)
serviceAccount:
create: true
name: myapp # matches the association
annotations: {} # IRSA: eks.amazonaws.com/role-arn: …
# Pod template: checksum/sa annotation triggers a rolloutAWS Load Balancer Controller
helm repo add eks https://aws.github.io/eks-charts kubectl apply -k "github.com/aws/eks-charts/stable/aws-load-balancer-controller/crds?ref=master" # before upgrading helm upgrade --install aws-load-balancer-controller eks/aws-load-balancer-controller \ -n kube-system --version 3.6.3 --set clusterName=$CLUSTER \ --set region=$AWS_REGION --set vpcId=$VPC_ID kubectl -n kube-system logs deploy/aws-load-balancer-controller | grep -iE "error|denied"
Ingress annotations (values)
ingress:
enabled: true
className: alb
annotations:
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/healthcheck-path: /healthz
alb.ingress.kubernetes.io/group.name: shop-prod # optional: share an ALBKarpenter
helm registry logout public.ecr.aws helm upgrade --install karpenter oci://public.ecr.aws/karpenter/karpenter --version 1.15.2 \ -n kube-system --set settings.clusterName=$CLUSTER --set settings.interruptionQueue=$CLUSTER aws eks create-access-entry --cluster-name $CLUSTER \ --principal-arn arn:aws:iam::$ACCT:role/KarpenterNodeRole-$CLUSTER --type EC2_LINUX kubectl get nodepools,ec2nodeclasses,nodeclaims
External Secrets + Secrets Manager
helm upgrade --install external-secrets external-secrets/external-secrets --version 2.15.0 \ -n external-secrets --create-namespace # association external-secrets/external-secrets → role; SecretStore does not specify auth kubectl get clustersecretstore,externalsecret -A kubectl annotate externalsecret myapp-redis -n myapp force-sync=$(date +%s) --overwrite
Pipeline (OIDC → EKS)
aws eks create-access-entry --cluster-name $CLUSTER --principal-arn $ROLE --type STANDARD aws eks associate-access-policy --cluster-name $CLUSTER --principal-arn $ROLE \ --policy-arn arn:aws:eks::aws:cluster-access-policy/AmazonEKSEditPolicy \ --access-scope type=namespace,namespaces=myapp aws eks update-kubeconfig --name $CLUSTER --region $AWS_REGION helm upgrade --install myapp oci://$REG/charts/myapp --version $VER -n myapp \ -f values-eks.yaml --rollback-on-failure --timeout 10m
Troubleshooting
aws sts get-caller-identity; kubectl auth whoami helm history myapp -n myapp; helm status myapp -n myapp kubectl get events -n myapp --sort-by=.lastTimestamp | tail kubectl describe ingress myapp -n myapp | tail aws elbv2 describe-target-health --target-group-arn $TG
Cleanup (order matters!)
helm uninstall myapp -n myapp --wait # the ALB is deleted by LBC kubectl delete pvc --all -n myapp # EBS volumes kubectl delete nodepool --all; helm uninstall karpenter -n kube-system helm uninstall external-secrets -n external-secrets helm uninstall aws-load-balancer-controller -n kube-system eksctl delete cluster -f helm-lab.yaml --wait aws ecr delete-repository --repository-name charts/myapp --force aws secretsmanager delete-secret --secret-id myapp/redis --force-delete-without-recovery
Error → cause
| Error | Cause |
|---|---|
| 401 / no basic auth credentials | Not logged in to ECR or token expired (12h) |
| name unknown … does not exist | Repository not created / chart name written twice in push |
| TAG_INVALID … immutable | chart version not bumped |
| FailedBuildModel … subnets | subnet missing the role/elb tag |
| AccessDenied … NodeInstanceRole | Pod Identity not working |
| no matches for kind ExternalSecret | ESO/CRD not installed |
| Unauthorized / cluster unreachable | missing access entry / wrong identity |
| secrets is forbidden | access policy scope or type is wrong |
Capstone lab + final quiz
You are a platform engineer who needs to move your team's myapp (Flask + Redis) from kind to EKS (ca-central-1). Requirements: the chart and the image are both stored in a private ECR with immutable versions; the app is reached through a public ALB; the Redis password exists only in Secrets Manager and must not appear in Git, values, or release records; deployment is done by a pipeline via OIDC, and the pipeline can write only to the myapp namespace; failed releases roll back automatically; and no leftover resources remain in the account after the lab.
helm-lab.yaml to create the cluster (access entry mode, Pod Identity Agent, EBS CSI add-on); create IAM roles and Pod Identity associations for LBC and ESO; install LBC 3.6.3 and ESO 2.15.0 with Helm; create a ClusterSecretStore aws-sm.Acceptance:
helm list -A shows two releases; kubectl get clustersecretstore aws-sm READY True.myapp (images) and charts/myapp (charts); push images 1.0 and 1.1; push chart 0.5.0 (appVersion 1.0) to oci://$REG/charts, and record the digest.Acceptance:
describe-images in the output, the chart's artifactMediaType mediaType is helm.config; a repeated push of 0.5.0 is rejected.myapp/redis; for myapp/myapp the SA, create a Pod Identity association (allowing only read myapp/*), and in values-eks.yaml, enable externalSecret; both the Redis subchart and myapp reference existingSecret: myapp-redis.Acceptance:
helm get values myapp --all contains no plaintext password; the myapp Pod has AWS_CONTAINER_CREDENTIALS_FULL_URI.className: alb, internet-facing, ip,/healthz), enable the readiness gate in the namespace; install chart 0.5.0 by digest.Acceptance:
curl http://$ALB/ returns myapp v1.0 … hits=N; the target group has two healthy targets.AmazonEKSEditPolicy (namespace=myapp); deploy chart 0.5.1 (appVersion 1.1) using Azure Pipelines (AWS Toolkit OIDC) or GitHub Actions.Acceptance:
curl returns v1.1; in the pipeline kubectl auth can-i create secrets -n kube-system is no.--rollback-on-failure; then manually helm rollback roll back to the 0.5.0 revision.Acceptance:
helm history shows failed → Rollback to N, and the service stays accessible throughout (observe with a curl loop in a second terminal).Acceptance:
kubectl get nodeclaims a NodeClaim appears and disappears after scale-in.Acceptance: all four verification commands output
[],aws eks list-clusters with no helm-lab resources.Open-ended self-test (6 questions)
1. You need to deliver the same myapp chart to kind, EKS (Pod Identity), and Auto Mode clusters at the same time. How should the chart and values be organized?
The chart exposes only the interface: serviceAccount.name/annotations,ingress.className/annotations,externalSecret.*,persistence.storageClass,image.repository. Three sets of values: kind (no Ingress or nginx-class, local Secret, standard StorageClass); EKS Standard mode (className: alb + LBC annotations, ESO, gp3); Auto Mode (the Auto Mode IngressClass name, only the annotations it supports, provisioner set to ebs.csi.eks.amazonaws.com for the StorageClass). The chart contains no ARNs or account numbers.
2. After setting the ECR Repository to IMMUTABLE, the dev branch must publish a chart for every commit. How do you design the version numbers?
Publish official versions from the main branch MAJOR.MINOR.PATCH; publish pre-release versions from the dev branch 0.6.0-dev.<build number> (to avoid +, Helm replaces it with _); or use a separate Repository or prefix for dev and configure IMMUTABLE_WITH_EXCLUSION an exclusion *-dev*, combined with a lifecycle policy to clean up old dev versions.
3. Write your upgrade runbook for upgrading LBC from v2.x to v3.6.3.
Read all Release Notes from v3.0.0 onward (Gateway API GA, webhook certificates, CRDs); update the IAM policy to the v3.6.3 iam_policy.json; rehearse in a test cluster; in production, apply the CRDs provided by AWS (and the Gateway CRDs if you use Gateway API) → helm upgrade --version 3.6.3 -f lbc-values.yaml → check the controller logs and the status of all Ingress/TGB objects → spot-check the ALB rules; rollback plan: helm rollback (CRDs are not rolled back, so confirm backward compatibility).
4. Why does this lesson have ESO use the controller's own Pod Identity rather than a role for each application? What are the alternatives?
The ESO documentation states that in Pod Identity mode the SecretStore does not specify auth and uses the controller identity; serviceAccountRef cannot be shared with Pod Identity. The drawback is that ESO's role permissions are concentrated. Alternatives: set role in the SecretStore so that ESO first assumes a per-team role; or use Secrets Store CSI + ASCP so that each Pod reads with its own Pod Identity.
5. The pipeline deployment succeeds, but 30 minutes later users report 502 errors. How do you tell whether the problem is Helm, LBC, or the application?
Helm layer: helm history check whether there was a later release; Kubernetes layer: whether Pods are restarting (OOM, probes) and whether the EndpointSlice has Ready endpoints; LBC/AWS layer: describe-target-health the reason codes (Target.ResponseCodeMismatch / Target.Timeout), LBC logs, and target_status_code in the ALB access logs. A 502 usually means the target closed the connection or returned an invalid response, most often an application or probe/termination timing issue.
6. The company requires that all cluster-level charts be installed only from the internal ECR. Describe a complete plan.
Mirroring pipeline: helm pull upstream charts (LBC, Karpenter, ESO) → scan → helm push to oci://$REG/charts/vendor; at the same time, copy the images referenced by the chart to the internal ECR (or configure ECR pull through cache), and rewrite the image addresses in values image.repository; cluster nodes may reach only the internal ECR (VPC endpoints, no public egress); use admission policies (Kyverno/Gatekeeper) to reject images from non-internal registries.
Sources and version notes
Source table
| Topic | Verified conclusion | Source (verification date) |
|---|---|---|
| Helm | v4.3.2 (2026-11-13) is the latest, and v3.22.1 is the latest Helm 3 patch; Helm 4: --atomic → --rollback-on-failure,--wait uses kstatus; new installs default to SSA | Helm Releases; course conventions (2026-11-15) |
| Helm OCI | push references exclude the chart name and tag; the chart name becomes the last segment of the Repository and the tag comes from the version; pull/show/template/install/upgrade use full references; supports @sha256: digest; the registry login target must be a hostname (a port is allowed); some registries require pre-created Repositories; .prov are uploaded as an extra layer; when pushing, + is replaced with _ (source pkg/registry/reference.go) | helm.sh · Registries · helm source code(2026-11-15) |
| ECR + Helm | first create-repository, and the Repository name must match the chart name; get-login-password | helm registry login --username AWS --password-stdin; the token lasts 12 hours; artifactMediaType: application/vnd.cncf.helm.config.v1+json; the documentation recommends Helm 3.9+ | Pushing a Helm chart to ECR(2026-11-15) |
| ECR tag mutability | MUTABLE / IMMUTABLE / IMMUTABLE_WITH_EXCLUSION / MUTABLE_WITH_EXCLUSION (wildcard filters); a repeated push returns ImageTagAlreadyExistsException | Image tag mutability(2026-11-15) |
| ECR create on push | Supported since 2025-12; the Repository is created automatically only when a repository creation template with a matching prefix and CREATE_ON_PUSH in appliedFor exists; otherwise it is not created | What's New 2025-12 · Repository creation templates(2026-11-15) |
| EKS Pod Identity | Trust principal pods.eks.amazonaws.com, actions sts:AssumeRole + sts:TagSession; the SA has no annotations; associations can be created for namespaces and SAs that do not exist yet; the creator needs iam:PassRole; up to 5,000 associations per cluster; the Agent uses ports 80/2703 on 169.254.170.23; Auto Mode does not require installing the Agent; Fargate, Windows, Outposts, and EKS Anywhere are not supported; associations are eventually consistent | Pod Identity · Assign an IAM role(2026-11-15) |
| AWS Load Balancer Controller | v3.6.3 (2026-11-13, no CRD changes); chart 3.6.3 / appVersion v3.6.3 in eks-charts; v3.0.0 (2026-01) Gateway API GA; v3.6.x is based on Gateway API v1.6.0; CRD upgrade kubectl apply -k "github.com/aws/eks-charts/stable/aws-load-balancer-controller/crds?ref=master"; AWS documentation: helm install installs CRDs, helm upgrade does not; with restricted IMDS or Fargate, region and vpcId are required; the v3.6.3 chart adds matchConditions to the Service webhook | LBC Releases · eks-charts index · Install LBC with Helm(2026-11-15) |
| Karpenter | v1.15.2 (2026-11-12), v1.14.3 LTS; chart oci://public.ecr.aws/karpenter/karpenter; getting-started script: first helm registry logout public.ecr.aws,settings.clusterName/settings.interruptionQueue, controllers at 1 CPU/1Gi; CloudFormation creates KarpenterNodeRole-<cluster>, six controller managed policies, and an SQS queue with the same name; eksctl uses podIdentityAssociations; the NodePool example uses consolidateAfter 1m and expireAfter 720h; cleanup requires deleting the launch templates | Karpenter Releases · Getting started script (v1.15.2 tag)(2026-11-15) |
| EBS CSI | driver v1.68.0 (2026-11-10), chart aws-ebs-csi-driver 2.68.0; eksctl add-on useDefaultPodIdentityAssociations | EBS CSI Releases · eksctl · Pod Identity(2026-11-15) |
| External Secrets Operator | v2.15.0 / chart 2.15.0 (2026-11-10); API external-secrets.io/v1; Pod Identity: create associations for the controller SA; SecretStore does not write auth; serviceAccountRef cannot be shared with Pod Identity | ESO Releases · ESO · AWS Authentication(2026-11-15) |
| CI | aws-actions/configure-aws-credentials v6.3.0; azure/setup-helm v5.1.0; actions/checkout v7.0.1; AWS Toolkit for Azure DevOps v1.26.0, with OIDC supported since 1.15.0; trust policy issuer vstoken.dev.azure.com/{org-id}, aud api://AzureADTokenExchange, sub sc://{org}/{project}/{service-connection} | each project's GitHub Releases · AWS Toolkit README(2026-11-15) |
| EKS versions and pricing, Auto Mode, access entries | consistent with K8s Lesson 7: EKS 1.37 (2026-10-01); control plane 0.10 USD/hour (standard support); Auto Mode IngressClass eks.amazonaws.com/alb, storage ebs.csi.eks.amazonaws.com; access policy ARN format; eksctl 0.231.0 | K8s Lesson 7 source table · EKS pricing(2026-11-15) |
| Redis subchart | CloudPirates redis chart 0.39.1 (Redis 8.10.2): auth.existingSecret,auth.existingSecretPasswordKey (default redis-password) | CloudPirates helm-charts(2026-11-15) |
Video verification notes
The following videos had their titles and channels checked via YouTube oEmbed (https://www.youtube.com/oembed?url=…&format=json, 2026-11-15): AWS Events, "AWS re:Invent 2024 - Automate your entire Kubernetes cluster with Amazon EKS Auto Mode (KUB204-NEW)" (a_aDPo9oTMo); AWS Developers, "Amazon EKS Auto Mode | Fully Automated Kubernetes Clusters" (s9d61eYkGzs); TechWorld with Nana, "What is Helm in Kubernetes? Helm and Helm Charts explained | Kubernetes Tutorial 23" (-ykwb1d0DXU); Containers from the Couch, "EKS Pod Identity vs IRSA | Securely Connect Kubernetes Pods to AWS Services" (aUjJSorBE70); Anton Putra, "Native EKS Ingress: AWS Load Balancer Controller & 5 Examples (Terraform, TLS, IngressGroup, IP)" (ZfjpWOC5eoE) and "AWS Load Balancer Controller Tutorial (TLS): AWS EKS Kubernetes Tutorial - Part 6" (5XpPiORNy1o); Containers from the Couch, "Karpenter for Kubernetes | Karpenter vs Cluster Autoscaler" (FIBc8GkjFU0), "How Karpenter node consolidation works in Kubernetes" (xX3aBgpY3B4), "Karpenter consolidation in Kubernetes" (RNpmHJ05zvA); DevOps & AI Toolkit, "Manage Kubernetes Secrets With External Secrets Operator (ESO)" (SyRZe5YVCVk); GitHub, "Securely deploy to AWS with GitHub Actions and OIDC" (Io5UFJlEJKc). Durations and upload dates have not been verified; all are in English, and some were recorded before the current versions, so follow this lesson and the official documentation for details. No verifiable videos were found for the topics "Helm chart push to ECR", "Helm troubleshooting on EKS", "access entries", and "cleanup of the lab environment", so only storyboards are provided.
Narration notes
The "Voice" tab reads the script aloud using the browser's built-in Web Speech API (en-US); English terms are pronounced with en-US, and the result depends on the speech packs installed on the operating system. This courseware does not embed MP3 files; the script can be handed directly to a TTS tool such as Amazon Polly to generate audio.
Known limitations
- The account IDs, ARNs, digests, IPs, DNS names, resource IDs, and timings in the "expected output" are examples; the wording of errors from the AWS CLI, Helm, and controllers may change between versions (for example, the exact text of ECR immutable-tag conflicts and Helm 4 rollback messages).
- Costs are order-of-magnitude estimates for ca-central-1 (except the EKS control plane at 0.10 USD/hour); follow the AWS pricing page and Pricing Calculator.
- The following was written from the official documentation but could not be tested in this environment, so it has been handled conservatively: Auto Mode support for Gateway API; the coverage of AmazonEKSEditPolicy for CRs (such as ExternalSecret);
HelmInstaller@1whether installing Helm 4 is supported; in Helm 4,--wait(kstatus) specific handling of Ingress; the list of upstreams supported by ECR pull through cache; CLI parameter details for CREATE_ON_PUSH templates; the format of Pod Identity session names in CloudTrail; how SSO role ARNs are written in access entries. - The values key names of the myapp chart (such as
redisAuth.existingSecret) follow the chart you completed in Lessons 1 and 2; this lesson only addsserviceAccount,ingress,externalSecret,awsfour sets of keys. - The step order, timings, and IDs in the animations are illustrative and are used to explain the mechanism.