Spin Up an Amazon EKS Cluster in Minutes with Eksctl

Listen to this Post

Amazon Elastic Kubernetes Service (EKS) is a managed Kubernetes service that simplifies running Kubernetes on AWS. One of the quickest ways to deploy an EKS cluster is using Eksctl, a command-line tool developed by Weaveworks.

Prerequisites

  • AWS CLI installed and configured
    – `kubectl` installed
  • IAM permissions to create EKS clusters

Install Eksctl

On Linux (Debian/Ubuntu)

curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp 
sudo mv /tmp/eksctl /usr/local/bin 

On macOS (Homebrew)

brew tap weaveworks/tap 
brew install weaveworks/tap/eksctl 

Create an EKS Cluster

Run the following command to create a basic cluster:

eksctl create cluster --name my-eks-cluster --region us-west-2 --nodegroup-name my-nodes --node-type t3.medium --nodes 3 

Verify Cluster Creation

kubectl get nodes 

Expected Output:

NAME STATUS ROLES AGE VERSION 
ip-192-168-1-10.us-west-2.compute.internal Ready <none> 2m v1.27.x 

Advanced Configuration with YAML

Create a `cluster.yaml` file:

apiVersion: eksctl.io/v1alpha5 
kind: ClusterConfig 
metadata: 
name: advanced-eks-cluster 
region: us-west-2 
nodeGroups: 
- name: ng-1 
instanceType: t3.large 
desiredCapacity: 2 
ssh: 
publicKeyName: my-aws-keypair 

Deploy using:

eksctl create cluster -f cluster.yaml 

You Should Know:

  • Scaling Nodes:
    eksctl scale nodegroup --cluster=my-eks-cluster --nodes=5 --name=my-nodes 
    
  • Deleting a Cluster:
    eksctl delete cluster --name my-eks-cluster --region us-west-2 
    
  • Upgrading Kubernetes Version:
    eksctl upgrade cluster --name my-eks-cluster --version 1.28 
    
  • IAM Integration:
    eksctl create iamidentitymapping --cluster my-eks-cluster --arn arn:aws:iam::123456789012:role/MyEksRole --group system:masters --username admin 
    

What Undercode Say

Eksctl simplifies EKS cluster management, but for production environments, consider Terraform or AWS CDK for better infrastructure control. Below are additional Linux/AWS commands for Kubernetes management:

  • Check Pods:
    kubectl get pods -A 
    
  • View Cluster Info:
    kubectl cluster-info 
    
  • AWS EKS Describe Cluster:
    aws eks describe-cluster --name my-eks-cluster --region us-west-2 
    
  • Troubleshoot Node Issues:
    kubectl describe node <node-name> 
    
  • Deploy a Sample App:
    kubectl create deployment nginx --image=nginx 
    kubectl expose deployment nginx --port=80 --type=LoadBalancer 
    

Expected Output:

A fully functional EKS cluster running in AWS, accessible via kubectl, with scalable worker nodes and optional advanced configurations.

Reference: Spin Up an Amazon EKS Cluster in Minutes!

References:

Reported By: Darryl Ruggles – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅

Join Our Cyber World:

💬 Whatsapp | 💬 TelegramFeatured Image