eksctl
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
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
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
- Check existing nodes
List-nodes
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