Setup Kubernetes on Amazon EKS

Created by Shiva G, Modified on Thu, 27 Apr 2023 at 03:32 PM by Shyam Mohan K


Pre-requisites:

  • an EC2 Instance

AWS EKS Setup

  1. Setup kubectl
     a. Download kubectl version 1.20
    b. Grant execution permissions to kubectl executable
    c. Move kubectl onto /usr/local/bin
     d. Test that your kubectl installation was successful


a. Download kubectl version 1.20

curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.19.6/2021-01-05/bin/linux/amd64/kubectl


b. Grant execution permissions to kubectl executable


chmod +x ./kubectl


c. Move kubectl onto /usr/local/bin

mv ./kubectl /usr/local/bin 


d. Test that your kubectl installation was successful


kubectl version --short --client
  1. Setup eksctl
     a. Download and extract the latest release
    b. Move the extracted binary to /usr/local/bin
     c. Test that your eksclt installation was successful



 a. Download and extract the latest release

 curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp


 b. Move the extracted binary to /usr/local/bin

sudo mv /tmp/eksctl /usr/local/bin


c. Test that your eksclt installation was successfull

eksctl version
  1. Create an IAM Role and attach it to EC2 instance

 Note: create IAM user with programmatic access if your bootstrap system is outside of AWS
i.
 IAM user should have access to
ii. IAM
iii. EC2
iv. VPC
V. CloudFormation

  1. Create your cluster and nodes


 

eksctl create cluster --name cluster-name  \

--region region-name \

--node-type instance-type \

--nodes-min 2 \

--nodes-max 2 \ 

--zones <AZ-1>,<AZ-2>


example:

eksctl create cluster --name Razorops \

--region ap-south-1 \

--node-type t2.small \

--nodes-min 2 \

--nodes-max 2 \

--zones ap-south-1a, ap-south-1b




  1. To delete the EKS clsuter

eksctl delete cluster razorops --region ap-south-1
  1. Validate your cluster using by creating by checking nodes and by creating a pod


 kubectl get nodes

kubectl run pod tomcat --image=tomcat





Visit and Signup - https://razorops.com/


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article