cd ..
🏷️ AWS🏷️ EKS🏷️ Kubernetes🏷️ Cloud🏷️ Tutorial

Deploying Enterprise Applications on Amazon EKS: Step-by-Step

Deploying Enterprise Applications on Amazon EKS: Step-by-Step

Deploying Enterprise Applications on Amazon EKS

Amazon Elastic Kubernetes Service (EKS) is a managed service that makes it easy to run Kubernetes on AWS without needing to stand up or maintain your own Kubernetes control plane.

In this guide, we will rapidly provision a new EKS cluster and deploy an application resiliently.

Step 1: Provision the Cluster with eksctl

While Terraform is the industry standard for production,

eksctl
is the fastest way to bootstrap an initial cluster.

Create a

cluster.yaml
file:

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
  name: prod-cluster
  region: us-east-1
  version: "1.30"

managedNodeGroups:
  - name: standard-nodes
    instanceType: t3.medium
    minSize: 2
    maxSize: 5
    iam:
      withAddonPolicies:
        autoScaler: true

Run the deployment command:

eksctl create cluster -f cluster.yaml

This process takes roughly 15-20 minutes as AWS provisions VPCs, NAT Gateways, the Control Plane, and EC2 Compute instances.

Step 2: Establish IAM OIDC Identity

To allow Pods inside your cluster to access AWS resources (like S3 buckets or DynamoDB tables) without passing hardcoded AWS access keys, you must associate an OIDC provider with your cluster.

eksctl utils associate-iam-oidc-provider \
    --region us-east-1 \
    --cluster prod-cluster \
    --approve

Step 3: Deploy Your Application

We will use a standard backend application. Here is a baseline

Deployment
and
Service
:

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: backend-api
spec:
  replicas: 3
  selector:
    matchLabels:
      app: backend-api
  template:
    metadata:
      labels:
        app: backend-api
    spec:
      containers:
      - name: api
        image: nginx:latest # Placeholder for your actual application
        ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: backend-service
spec:
  type: ClusterIP
  selector:
    app: backend-api
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80

Apply the configuration:

kubectl apply -f app.yaml

Step 4: The AWS Load Balancer Controller

Unlike native K8s, exposing services to the internet in AWS requires mapping a Kubernetes Service to an AWS Application Load Balancer (ALB).

This requires installing the AWS Load Balancer Controller. Once installed, you can simply deploy an Ingress document:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: backend-ingress
  annotations:
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/target-type: ip
spec:
  ingressClassName: alb
  rules:
    - http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: backend-service
                port:
                  number: 80

Within minutes, AWS will provision a public-facing ALB, attach your pod IPs to the target group, and start routing internet traffic directly to your application containers!

T

TerminalDev

Admin

Full-stack developer building cool things on the web. Passionate about Next.js, TypeScript, and creating terminal-inspired user interfaces.

0