Lesson 3 of 3 Containers on Amazon ECS and Amazon EKS

Deploying and Scaling Applications on Amazon EKS

Amazon Elastic Kubernetes Service (Amazon EKS) runs the Kubernetes control plane as a managed service, while applications run on worker compute that can be managed by the team, by AWS or serverless. This lesson explains the EKS compute options, pod and node autoscaling, IAM access for pods and users, add-ons and observability, and how applications are delivered to clusters.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe the EKS control plane and compare managed node groups, self-managed nodes, Fargate and EKS Auto Mode.
  • Explain how the Horizontal Pod Autoscaler, Cluster Autoscaler and Karpenter scale pods and nodes.
  • Distinguish between EKS Pod Identity and IAM roles for service accounts, and describe access entries for users.
  • Describe EKS add-ons, observability options and application delivery with pipelines and GitOps.

The Control Plane and Compute Options

EKS runs the Kubernetes API servers and etcd across multiple AZs, patches and scales them, and exposes a cluster endpoint that can be public, private or both. Applications run as pods on compute that the team chooses.

  • Managed node groups: EKS creates and manages Auto Scaling groups of EC2 nodes with EKS-optimised AMIs, handling node updates with graceful draining. The team still chooses instance types and versions.
  • Self-managed nodes: the team builds and manages node groups itself, for maximum customisation.
  • AWS Fargate: pods matching a Fargate profile (by namespace and labels) run in isolated serverless environments, one pod each, with no nodes to manage. DaemonSets are not supported on Fargate, so logging and monitoring use sidecars or Fluent Bit built into Fargate.
  • EKS Auto Mode: AWS manages node provisioning, scaling (using Karpenter internally), patching and core add-ons such as networking and storage drivers, reducing cluster operations to deploying workloads.

Kubernetes version upgrades are a recurring operational task: the control plane is upgraded one minor version at a time, then nodes and add-ons. Versions reach end of standard support after about 14 months, after which extended support incurs additional charges. EKS upgrade insights flag deprecated APIs before an upgrade.

Scaling Pods and Nodes

Kubernetes scales in two layers, as ECS does. Each mechanism is described below.

Horizontal Pod Autoscaler (HPA)

Adjusts the number of replicas of a Deployment based on CPU or memory utilisation, reported by the Kubernetes Metrics Server, or custom and external metrics, such as requests per second or queue length exposed through an adapter or KEDA (Kubernetes Event-Driven Autoscaling).

Vertical Pod Autoscaler (VPA)

Adjusts pods' CPU and memory requests based on observed usage, which right-sizes workloads but restarts pods to apply changes.

Cluster Autoscaler

Watches for pods that cannot be scheduled because of insufficient resources and increases the size of node group Auto Scaling groups, and removes underused nodes. It works with predefined node groups, so instance choice is limited to the groups' configurations.

Karpenter

An open-source node provisioner that launches EC2 instances directly, choosing instance types that fit the pending pods from a flexible set defined in NodePools, typically within seconds to a minute. It supports Spot and On-Demand, consolidates workloads onto fewer or cheaper nodes, and replaces nodes for drift or expiry. Karpenter is generally faster and more cost-efficient than Cluster Autoscaler and is what EKS Auto Mode uses.

Cluster Autoscaler
How it scalesChanges the size of existing node groups
Instance flexibilityLimited to node group definitions
ConsolidationRemoves underused nodes
Choose when Existing node-group-based clusters.
Karpenter
How it scalesLaunches right-sized instances directly
Instance flexibilityAny type allowed by the NodePool
ConsolidationActively consolidates and replaces nodes for cost
Choose when Fast, flexible and cost-optimised node scaling.

Pod resource requests are essential for all of these: autoscalers reason from requests, so pods without requests lead to poor packing and unexpected evictions. Pod disruption budgets limit how many replicas can be evicted at once during node consolidation or upgrades.

Sort into groups

Scale pods or nodes?

Exam skills 3.2.3 · 4.3.1

Choose the EKS scaling mechanism for each requirement.

Log in to try this activity Interactive activities are free with an account.

IAM for Pods and People

Pods that call AWS APIs need credentials. IAM roles for service accounts (IRSA) associates an IAM role with a Kubernetes service account using the cluster's OIDC provider; pods using that service account receive temporary credentials. EKS Pod Identity is the newer approach: an agent add-on provides credentials, and associations between a service account and a role are managed through the EKS API without an OIDC provider per cluster, which simplifies multi-cluster use and allows role session tags for ABAC. Both avoid giving pods the node's instance role, which would grant every pod on the node the same permissions.

For people and pipelines, access entries grant IAM principals access to the Kubernetes API through the EKS API, with access policies such as cluster admin or namespace-scoped view and edit, replacing the older aws-auth ConfigMap. The CodePipeline EKS deploy action and CodeBuild projects use access entries for their roles.

Scenario questions

Access in EKS

Exam skills 6.1.1 · 3.2.3

Practise IAM for pods and people in EKS.

Log in to try this activity Interactive activities are free with an account.

Add-ons, Observability and Delivery

EKS add-ons install and update operational software such as the Amazon VPC CNI, CoreDNS, kube-proxy, the EBS CSI driver, the EKS Pod Identity agent, the AWS Distro for OpenTelemetry (ADOT) collector and the Amazon CloudWatch Observability agent. The VPC CNI gives pods VPC IP addresses; prefix delegation assigns /28 prefixes to nodes to increase pod density and reduce IP exhaustion. The AWS Load Balancer Controller creates ALBs for Ingress resources and NLBs for Service resources.

CloudWatch Container Insights, installed through the observability add-on, collects cluster, node, pod and container metrics and logs, and its enhanced observability adds detailed dashboards. Applications are traced with ADOT and AWS X-Ray, covered in the tracing lesson. Control plane logs (API server, audit, authenticator, controller manager, scheduler) can be sent to CloudWatch Logs.

Applications are delivered with Kubernetes manifests or Helm charts. Pipelines apply them with the CodePipeline EKS deploy action or kubectl and Helm in CodeBuild. GitOps tools such as Argo CD (which EKS also offers as a managed capability) and Flux continuously reconcile the cluster with manifests in a Git repository, so the repository is the source of truth and drift is corrected automatically. Progressive delivery on Kubernetes uses tools such as Argo Rollouts for canary and blue/green releases.

Related Kubernetes and Containerisation Options

Three further services appear in DevOps scenarios about containers. Each solves a different problem from EKS itself, as described below.

Amazon EKS Distro EKS-D
The Kubernetes distribution that EKS uses, with the same versions and security patches, published for customers to run on their own infrastructure, for example in an on-premises data centre. The customer operates the control plane. It suits organisations that want consistent Kubernetes builds across environments; for a managed option on premises, EKS Anywhere and EKS hybrid nodes are alternatives.
Red Hat OpenShift Service on AWS ROSA
A managed OpenShift service operated jointly by Red Hat and AWS. It suits organisations that already standardise on OpenShift tooling, such as its developer console, operators and build pipelines, and want to keep them on AWS without operating OpenShift themselves.
AWS App2Container A2C
A command-line tool that analyses existing Java and .NET applications running on virtual machines or servers, creates container images and generates ECS task definitions or Kubernetes manifests, and can create a CodePipeline pipeline for them. It accelerates the containerisation of existing applications rather than running containers.

In a scenario, the decisive requirement distinguishes them: the same Kubernetes build on premises points to EKS Distro, an existing OpenShift estate points to ROSA, and containerising existing applications without rewriting them points to App2Container.

Worked example

Making an EKS Cluster Scale Efficiently

An EKS cluster uses three managed node groups of fixed instance types with Cluster Autoscaler. During traffic spikes, pods remain pending for several minutes, costs are high at night, and every pod uses the node role, which can read all S3 buckets.

  1. Pods

    Add HPA to each Deployment based on CPU and requests per second through KEDA, with correct resource requests.

  2. Nodes

    Replace Cluster Autoscaler with Karpenter and a NodePool allowing many instance types, Spot and On-Demand, with consolidation enabled, or move to EKS Auto Mode.

  3. Permissions

    Create Pod Identity associations for each service account with least-privilege roles, and reduce the node role to the minimum.

  4. Disruption

    Add pod disruption budgets so consolidation never removes too many replicas at once.

Check yourself

Pods are Pending with the reason that no nodes have enough CPU. Which component should respond, and what must pods specify for it to work well?

Show answer

The node autoscaler (Karpenter or Cluster Autoscaler) should add nodes. Pods must specify CPU and memory requests, because autoscalers calculate capacity from requests.

Exam Tips

Remember for the exam

  • EKS Distro is the EKS Kubernetes build for self-managed clusters; ROSA is managed OpenShift; App2Container containerises existing Java and .NET applications.
  • EKS compute: managed node groups, self-managed nodes, Fargate profiles (no DaemonSets) and EKS Auto Mode (AWS-managed nodes using Karpenter).
  • HPA scales pods; Cluster Autoscaler resizes node groups; Karpenter launches right-sized instances directly and consolidates for cost.
  • Use EKS Pod Identity or IRSA for pod permissions instead of the node role; access entries grant IAM principals Kubernetes access.
  • Container Insights and ADOT provide observability; GitOps (Argo CD, Flux) reconciles clusters from Git.
  • VPC CNI prefix delegation increases pod density and reduces IP exhaustion.