DEV Community

PanupongDeve
PanupongDeve

Posted on • Edited on

2

[AWS EKS] Setup Worker Nodes with EC2

install eksctl

https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html

install kubectl

https://kubernetes.io/docs/tasks/tools/install-kubectl/

eksctl-cluster-ec2.yaml

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: my-cluster-ec2
region: ap-southeast-1
nodeGroups:
- name: ng-1
instanceType: t3.small
desiredCapacity: 3
ssh:
publickeyName: the1-cpp

time eksctl create cluster -f eksctl-cluster-ec2.yaml

basic eksctl

eksctl get cluster

eksctl get nodegroup --cluster my-cluster-ec2

eksctl scale nodegroup --cluster=my-cluster-ec2 --nodes=5 --name=ng-1

Alt Text

update nodegroups

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: my-cluster-ec2
region: ap-southeast-1
nodeGroups:
- name: ng-1
instanceType: t3.small
desiredCapacity: 3
ssh:
publickeyName: the1-cpp
- name: ng-mixed
minSize: 3
maxSize: 5
instancesDistribution:
maxPrice: 0.2
instanceTypes: ["t3.small"]
onDemandBaseCapacity: 0
onDemandPercentageAboveBaseCapacity: 50
ssh:
publickeyName: the1-cpp

eksctl create nodegroup --config-file=cluster-ec2.yaml --include='ng-mixed'

delete nodegroups

eksctl delete nodegroup --config-file=cluster-ec2.yaml --include='ng-mixed' --approve

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay