Skip to main content

EKS


Installation

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
eksctl version

Create

aws ec2 create-key-pair \
--key-name <key-name> \
--query 'KeyMaterial' \
--output text > cluster.pem

Config file Schema

cluster.yaml
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
name: <cluster-name>
region: <region>
version: <kubernetes-version>

iam:
withOIDC: true

vpc:
cidr: <cidr>
# vpc:
# id: <vpc-id>
# subnets:
# private:
# private1:
# id: <subnet-id>
# private2:
# id: <subnet-id>
# public:
# public1:
# id: <subnet-id>
# public2:
# id: <subnet-id>

managedNodeGroups:
- name: worker-m5-large-ng
instanceType: m5.large
minSize: 1
maxSize: 10
desiredCapacity: 1
volumeSize: 50
labels:
role: worker
tags:
nodegroup-role: worker
ssh:
publicKeyName: <key-name>
# subnets:
# - <subnet-id>
eksctl create cluster -f cluster.yaml
aws eks update-kubeconfig --name <cluster-name>

Delete

eksctl delete cluster -f cluster.yaml

Reference