eksctl
Introduction
Section titled “Introduction”eksctl is a CLI tool for creating and managing EKS clusters, Amazon’s managed Kubernetes service.
LocalStack supports running eksctl
on LocalStack to create EKS clusters locally.
LocalStack’s EKS spin up embedded Kubernetes clusters using K3s to allow you to use the EKS APIs in your local environment.
Getting started
Section titled “Getting started”This guide is designed for users new to eksctl
and running EKS clusters with LocalStack.
Start LocalStack using your preferred method.
We will demonstrate how you can create a local EKS cluster using eksctl
and fetch the nodes in the cluster.
Pre-requisites
Section titled “Pre-requisites”Create a cluster
Section titled “Create a cluster”To create a cluster, you can use the eksctl create cluster
command.
You can use the --profile
flag to specify the LocalStack profile to use for the cluster.
Run the following command to create a cluster:
eksctl create cluster --nodes 1 --profile localstack
export AWS_CLOUDFORMATION_ENDPOINT=http://localhost.localstack.cloud:4566export AWS_EC2_ENDPOINT=http://localhost.localstack.cloud:4566export AWS_EKS_ENDPOINT=http://localhost.localstack.cloud:4566export AWS_ELB_ENDPOINT=http://localhost.localstack.cloud:4566export AWS_ELBV2_ENDPOINT=http://localhost.localstack.cloud:4566export AWS_IAM_ENDPOINT=http://localhost.localstack.cloud:4566export AWS_STS_ENDPOINT=http://localhost.localstack.cloud:4566
eksctl create cluster --nodes 1
Get the nodes
Section titled “Get the nodes”You can use the kubectl
command to get the nodes in the cluster:
kubectl get nodes