Skip to content

Repository files navigation

EKS Cluster with Karpenter - Multi-Architecture Support

This Terraform configuration deploys an Amazon EKS cluster with Karpenter autoscaling, supporting both x86 and ARM64 (Graviton) instances with Spot and On-Demand pricing.

Prerequisites

  • AWS CLI configured with appropriate permissions
  • Terraform >= 1.13
  • kubectl installed
  • Helm installed

Quick Start

1. Initialize and Deploy

# Initialize Terraform
terraform init

# Review the deployment plan
terraform plan

# Deploy the infrastructure
terraform apply

2. Configure kubectl

# Update kubeconfig (replace with your region and cluster name)
aws eks update-kubeconfig --region us-west-2 --name opsfleet-eks

# Verify cluster access
kubectl get nodes

Running Pods on x86 Instances

To deploy a workload specifically to x86 (AMD64) nodes:

kubectl apply -f examples/x86-deployment.yaml

This deployment uses nodeSelector to target x86 nodes:

  • kubernetes.io/arch: amd64
  • karpenter.sh/nodepool: x86-nodepool

Running Pods on ARM64 (Graviton) Instances

To deploy a workload specifically to ARM64 (Graviton) nodes:

kubectl apply -f examples/arm64-deployment.yaml

This deployment uses nodeSelector to target ARM64 nodes:

  • kubernetes.io/arch: arm64
  • karpenter.sh/nodepool: arm64-nodepool

Architecture

  • EKS Cluster: Latest version (1.28+) in a dedicated VPC
  • Karpenter: Node autoscaler with two NodePools (x86 and ARM64)
  • Spot & On-Demand: Both instance types supported for cost optimization
  • Multi-AZ: High availability across multiple availability zones

Configuration

Key variables can be customized in terraform.tfvars:

  • cluster_name: Name of the EKS cluster
  • kubernetes_version: Kubernetes version
  • aws_region: AWS region for deployment
  • vpc_cidr: CIDR block for VPC

Cleanup

# Remove workloads first
kubectl delete -f examples/

# Destroy infrastructure
terraform destroy

Example Deployments

The examples/ directory contains:

  • x86-deployment.yaml: Deploy to x86 nodes
  • arm64-deployment.yaml: Deploy to ARM64/Graviton nodes
  • mixed-architecture-deployment.yaml: Allow any architecture

Key Features

  • Latest EKS version
  • Karpenter with x86 and ARM64 node pools
  • Spot instance support with interruption handling
  • Dedicated VPC with proper networking
  • Production-ready security configuration

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages