eksctl
eksctl
on LocalStack to create EKS clusters2 minute read
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.
Note
The support foreksctl
is currently experimental and may not work in all cases.
We are working on improving the support for eksctl
in LocalStack.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
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:4566
export AWS_EC2_ENDPOINT=http://localhost.localstack.cloud:4566
export AWS_EKS_ENDPOINT=http://localhost.localstack.cloud:4566
export AWS_ELB_ENDPOINT=http://localhost.localstack.cloud:4566
export AWS_ELBV2_ENDPOINT=http://localhost.localstack.cloud:4566
export AWS_IAM_ENDPOINT=http://localhost.localstack.cloud:4566
export AWS_STS_ENDPOINT=http://localhost.localstack.cloud:4566
eksctl create cluster --nodes 1
Get the nodes
You can use the kubectl
command to get the nodes in the cluster:
$ kubectl get nodes