Skip to content

eksctl

Documentation Here

Install

Bash
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

Create Cluster

Eksctl-create-cluster

Bash
eksctl create cluster --name cluster-name --version 1.21 --region eu-west-1 --without-nodegroup --vpc-cidr 172.25.0.0/16 --ssh-access --ssh-public-key ssh-key-name
Bash Session
eksctl create cluster --name testing --version 1.23 --region eu-west-1 --without-nodegroup --vpc-cidr 100.25.0.0/16 --ssh-access --ssh-public-key ~/.ssh/wolkabout-aws.pub
Bash
2022-11-29 15:45:52 []  eksctl version 0.121.0
2022-11-29 15:45:52 []  using region eu-west-1
2022-11-29 15:45:53 []  setting availability zones to [eu-west-1b eu-west-1c eu-west-1a]
2022-11-29 15:45:53 []  subnets for eu-west-1b - public:100.25.0.0/19 private:100.25.96.0/19
2022-11-29 15:45:53 []  subnets for eu-west-1c - public:100.25.32.0/19 private:100.25.128.0/19
2022-11-29 15:45:53 []  subnets for eu-west-1a - public:100.25.64.0/19 private:100.25.160.0/19
2022-11-29 15:45:53 []  using Kubernetes version 1.23
2022-11-29 15:45:53 []  creating EKS cluster "testing" in "eu-west-1" region with 
2022-11-29 15:45:53 []  if you encounter any issues, check CloudFormation console or try 'eksctl utils describe-stacks --region=eu-west-1 --cluster=testing'
2022-11-29 15:45:53 []  Kubernetes API endpoint access will use default of {publicAccess=true, privateAccess=false} for cluster "testing" in "eu-west-1"
2022-11-29 15:45:53 []  CloudWatch logging will not be enabled for cluster "testing" in "eu-west-1"
2022-11-29 15:45:53 []  you can enable it with 'eksctl utils update-cluster-logging --enable-types={SPECIFY-YOUR-LOG-TYPES-HERE (e.g. all)} --region=eu-west-1 --cluster=testing'
2022-11-29 15:45:53 []  
2 sequential tasks: { create cluster control plane "testing", wait for control plane to become ready 
}
2022-11-29 15:45:53 []  building cluster stack "eksctl-testing-cluster"
2022-11-29 15:45:54 []  deploying stack "eksctl-testing-cluster"
2022-11-29 15:46:24 []  waiting for CloudFormation stack "eksctl-testing-cluster"
2022-11-29 15:46:54 []  waiting for CloudFormation stack "eksctl-testing-cluster"
2022-11-29 15:47:54 []  waiting for CloudFormation stack "eksctl-testing-cluster"
2022-11-29 15:48:54 []  waiting for CloudFormation stack "eksctl-testing-cluster"
2022-11-29 15:49:55 []  waiting for CloudFormation stack "eksctl-testing-cluster"
2022-11-29 15:50:55 []  waiting for CloudFormation stack "eksctl-testing-cluster"
2022-11-29 15:51:55 []  waiting for CloudFormation stack "eksctl-testing-cluster"
2022-11-29 15:52:55 []  waiting for CloudFormation stack "eksctl-testing-cluster"
2022-11-29 15:53:56 []  waiting for CloudFormation stack "eksctl-testing-cluster"
2022-11-29 15:54:56 []  waiting for CloudFormation stack "eksctl-testing-cluster"
2022-11-29 15:55:56 []  waiting for CloudFormation stack "eksctl-testing-cluster"
2022-11-29 15:56:57 []  waiting for CloudFormation stack "eksctl-testing-cluster"
2022-11-29 15:57:57 []  waiting for CloudFormation stack "eksctl-testing-cluster"
2022-11-29 15:59:59 []  waiting for the control plane to become ready
2022-11-29 15:59:59 []  saved kubeconfig as "/home/ndjukic/.kube/config"
2022-11-29 15:59:59 []  no tasks
2022-11-29 15:59:59 []  all EKS cluster resources for "testing" have been created
2022-11-29 16:00:01 []  kubectl command should work with "/home/ndjukic/.kube/config", try 'kubectl get nodes'
2022-11-29 16:00:01 []  EKS cluster "testing" in "eu-west-1" region is ready

Create Nodes (workers)

Bash
eksctl create nodegroup --cluster=cluster-name --name=workers --ssh-public-key=ssh-key-name --instance-types=t3.medium

Scale Nodes

Bash
eksctl scale nodegroup --cluster=cluster-name --nodes=3 --name=workers --nodes-max=4

Create Kubernetes Cluster (Old Examples)

Bash
eksctl create cluster --name clustername-here --version 1.21 --region eu-west-1 --nodegroup-name workers --node-type t3.small --node-volume-size 20 --node-ami-family Ubuntu1804 --vpc-cidr 172.25.0.0/16 --nodes 1 --nodes-min 1 --nodes-max 1 --ssh-access --ssh-public-key sshkeyname-here
Bash
eksctl create cluster --name clustername-here --version 1.21 --region eu-west-1 --without-nodegroup --vpc-cidr 172.25.0.0/16 --ssh-access --ssh-public-key clustername-here
  • Check existing cluster

List-clusters

Bash
eksctl get cluster
Bash Session
2022-11-17 10:46:11 [ℹ]  eksctl version 0.64.0
2022-11-17 10:46:11 [ℹ]  using region eu-west-1
NAME            REGION          EKSCTL CREATED
cluster-name      eu-west-1       True
  • Check existing nodes

List-nodes

Bash
eksctl get nodegroup --cluster cluster-name
Bash Session
2022-11-17 10:49:56 [ℹ]  eksctl version 0.64.0
2022-11-17 10:49:56 [ℹ]  using region eu-west-1
CLUSTER         NODEGROUP       STATUS  CREATED                 MIN SIZE        MAX SIZE        DESIRED CAPACITY        INSTANCE TYPE   IMAGE ID        ASG NAME
cluster-name    worker-name     ACTIVE  2022-09-27T07:59:30Z    3               4               3                       t3.large        AL2_x86_64      eks-worker-name-xxx1befx-a12x-87dx-baxx-6xxxc16xx48c

Create Cluster using existing VPC

YAML
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
  name: my-test
  region: eu-west-1

vpc:
  id: "vpc-07d3xxxxxxxx00026"
  subnets:
    private:
      eu-west-1a:
          id: "subnet-0e25xxxxx8f2234ae"
      eu-west-1c:
          id: "subnet-0af3xxxx52a70153d"
    public:
      eu-west-1a:
          id: "subnet-05441bxxxxbbf667c"
      eu-west-1c:
          id: "subnet-0e314xxxxx976c2c2"

nodeGroups:
  - name: ng-test
Back to top