Skip to content

Create EKS cluster with Auto Mode and two-tier application#6

Merged
isaac-pulumi merged 1 commit into
mainfrom
neo-changes-1762832851887
Nov 11, 2025
Merged

Create EKS cluster with Auto Mode and two-tier application#6
isaac-pulumi merged 1 commit into
mainfrom
neo-changes-1762832851887

Conversation

@pulumi

@pulumi pulumi Bot commented Nov 11, 2025

Copy link
Copy Markdown
Contributor

Summary

This PR creates a complete EKS infrastructure with Auto Mode and deploys a two-tier containerized application.

Infrastructure Changes

VPC & Networking

  • Fresh VPC: 10.0.0.0/16 CIDR block
  • Multi-AZ: 3 availability zones with public and private subnets
  • NAT Gateway: Single NAT gateway for cost optimization

EKS Cluster

  • EKS Auto Mode: Enabled for automatic node management
  • Version: Kubernetes 1.31
  • Authentication: API mode for Auto Mode compatibility
  • OIDC Provider: Enabled for IAM roles for service accounts
  • Logging: All control plane logs enabled

Kubernetes Gateway API

  • Gateway API CRDs: v1.2.1 installed
  • AWS Load Balancer Controller: v1.11.0 with proper IAM roles
  • Gateway: HTTP gateway for application routing
  • HTTPRoute: Routes /api to backend and / to frontend

Application Components

Backend (Express.js)

  • Image: Node.js 20 Alpine
  • Endpoint: /api/env - Returns environment details (hostname, platform, CPU, memory, etc.)
  • Health Check: /health endpoint
  • Resources: 100m CPU request, 500m CPU limit, 128Mi-512Mi memory
  • Replicas: 2 initial replicas
  • HPA: Scales 2-10 replicas based on 70% CPU utilization

Frontend (Tailwind CSS)

  • Image: Nginx Alpine
  • UI: Tailwind CSS dashboard displaying backend environment details
  • Features: Auto-refresh every 10 seconds, responsive design
  • Resources: 50m CPU request, 200m CPU limit, 64Mi-256Mi memory
  • Replicas: 2 replicas

Deployment

The GitHub Actions workflow is configured to:

  1. On PR: Run pulumi preview to show planned changes
  2. On merge to main: Run pulumi up to deploy the infrastructure

Preview Results

✅ Preview succeeded - 61 resources to create:

  • VPC with subnets, route tables, NAT gateway, internet gateway
  • EKS cluster with Auto Mode, IAM roles, OIDC provider
  • Kubernetes resources: namespace, deployments, services, HPA, Gateway, HTTPRoute
  • AWS Load Balancer Controller with IAM policy

Testing

After deployment:

  1. Get the Gateway address: kubectl get gateway -n two-tier-app
  2. Access the frontend at the Gateway's load balancer URL
  3. The dashboard will display real-time environment details from the backend
  4. Test autoscaling by generating CPU load on the backend pods

Configuration

  • ESC Environment: aws-login_v2/pulumi-dev-sandbox-env
  • AWS Region: us-west-2
  • Stack: dev

@isaac-pulumi isaac-pulumi merged commit 3a81d7f into main Nov 11, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants