Skip to content
VirtualLP Virtual Learning Platform

Kubernetes on Amazon EKS

13 min read Topic 17 of 30 1 hands-on lab

Kubernetes is the open-source standard for running containers at scale. Amazon Elastic Kubernetes Service (EKS) runs the Kubernetes control plane for you – highly available across AZs – while your workloads run on worker nodes.

flowchart TB
    subgraph CP["EKS control plane (managed by AWS)"]
        API[API server] --- ETCD[(etcd)] --- SCH[Scheduler & controllers]
    end
    K[kubectl / CI pipeline] -->|kubeconfig| API
    API --> N1["Managed node group (EC2) – AZ a"] & N2["Managed node group – AZ b"] & F[Fargate profile]
    N1 --> P1((Pod)) & P2((Pod))
    N2 --> P3((Pod))
    ALB[ALB via Ingress] --> SVC[Service] --> P1 & P3

Getting started

eksctl create cluster --name shop --region ap-south-1 --nodes 2 --node-type t3.medium
aws eks update-kubeconfig --name shop --region ap-south-1
kubectl get nodes

Core Kubernetes objects

Object Purpose
Pod Smallest unit – one or more containers sharing network/storage
Deployment Desired number of Pod replicas, rolling updates and rollbacks
Service Stable virtual IP/DNS for a set of Pods (ClusterIP, NodePort, LoadBalancer)
Ingress HTTP routing into Services – on EKS creates an ALB via the AWS Load Balancer Controller
ConfigMap / Secret Configuration and sensitive values
Namespace Logical isolation (dev, team-a)
HPA Horizontal Pod Autoscaler – scale Pods on CPU/memory/custom metrics
apiVersion: apps/v1
kind: Deployment
metadata: { name: web }
spec:
  replicas: 3
  selector: { matchLabels: { app: web } }
  template:
    metadata: { labels: { app: web } }
    spec:
      containers:
        - name: web
          image: 123456789012.dkr.ecr.ap-south-1.amazonaws.com/web:1.0
          ports: [{ containerPort: 3000 }]
          resources: { requests: { cpu: 250m, memory: 256Mi } }
---
apiVersion: v1
kind: Service
metadata: { name: web }
spec:
  type: LoadBalancer
  selector: { app: web }
  ports: [{ port: 80, targetPort: 3000 }]
kubectl apply -f web.yaml
kubectl get pods -o wide
kubectl scale deployment web --replicas=5
kubectl rollout status deployment/web
kubectl logs deploy/web

Compute options

Option Notes
Managed node groups EC2 instances managed by EKS (updates, draining)
Karpenter / Cluster Autoscaler Add and remove nodes based on pending Pods
Fargate profiles Serverless Pods – no nodes

Security

  • IAM for pods: EKS Pod Identity or IRSA gives each service account its own IAM role – never node-wide credentials.
  • Access entries / RBAC control who can use kubectl.
  • Network policies, private endpoint, image scanning in ECR.

ECS or EKS?

Choose ECS Choose EKS
Simplest AWS-native containers You need Kubernetes APIs, portability, its ecosystem (Helm, operators)
Small team, fewer concepts Platform team, multi-cloud/hybrid, existing K8s skills
Key point

EKS manages the control plane; you manage workloads (and nodes, unless you use Fargate). Use Deployments for Pods, Services for stable access, Ingress for HTTP routing.

Practise it

Virtual lab · Amazon Web Services · 50 min

Run Kubernetes on Amazon EKS: node group, kubectl, Deployments and a LoadBalancer Service

Create an EKS cluster and managed node group, connect kubectl from CloudShell, deploy nginx with a Deployment manifest, expose it with a LoadBalancer Service, then scale, self-heal and roll out a new version.

Open lab

Quick revision

  1. EKS = managed Kubernetes control plane across AZs.
  2. aws eks update-kubeconfig then kubectl.
  3. Pod → Deployment → Service → Ingress (ALB).
  4. Nodes: managed node groups, Karpenter, or Fargate.
  5. IAM roles per service account for AWS access.

Practise this topic

Hands-on virtual lab

Apply what you just read in a realistic, guided simulation. Free with a verified account.

Create a free account to track your progress and unlock virtual labs.