</>
Skip to content
AWS lessons (14/47)

AWS — EKS

What is EKS?

Managed Kubernetes service for running containerized applications.

Create cluster

aws eks create-cluster \
  --name my-cluster \
  --role-arn arn:aws:iam::123456789:role/eks-role \
  --resources-vpc-config subnetIds=subnet-xxx,xxx

Configure kubectl

aws eks update-kubeconfig --name my-cluster

Deploy application

apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app
spec:
  replicas: 3
  selector:
    matchLabels:
      app: my-app
  template:
    metadata:
      labels:
        app: my-app
    spec:
      containers:
      - name: my-app
        image: nginx:latest
        ports:
        - containerPort: 80
kubectl apply -f deployment.yaml

Create service

apiVersion: v1
kind: Service
metadata:
  name: my-service
spec:
  type: LoadBalancer
  selector:
    app: my-app
  ports:
  - port: 80
    targetPort: 80

Node groups

aws eks create-nodegroup \
  --cluster-name my-cluster \
  --nodegroup-name my-nodes \
  --node-role arn:aws:iam::123456789:role/eks-node-role \
  --instance-types t3.medium \
  --scaling-config minSize=2,maxSize=5,desiredSize=3

Best practices

  1. Use managed node groups
  2. Enable cluster logging
  3. Use IRSA for permissions
  4. Set up cluster autoscaler

Mini Practice

  1. Create an EKS cluster
  2. Deploy a sample application
  3. Expose with LoadBalancer
  4. Scale the deployment

Up Next

Continue with DynamoDB - NoSQL Database.

Related Topics

Frequently Asked Questions about EKS

What is EKS in AWS?

EKS is a fundamental concept in AWS. This lesson explains it step by step with clear examples, making it easy for beginners to understand.

How do I learn EKS?

Start by reading the explanation above, then try the code examples. Practice by modifying the examples and experimenting with different values. Hands-on practice is the best way to learn EKS.

Why is EKS important in AWS?

EKS is essential for AWS development. Understanding this concept will help you write better code and solve real-world problems more effectively.