AWS Logo
Menu
Creating a EKS cluster 1.24 version from scratch using eksctl.

Creating a EKS cluster 1.24 version from scratch using eksctl.

Create an Amazon EKS cluster 1.24 version from scratch. When your cluster is ready, you can configure your favorite Kubernetes tools, such as kubectl, to communicate with your cluster.

Published Dec 28, 2023

Introduction :

Amazon Elastic Kubernetes Service (Amazon EKS) is a managed service that you can use to run Kubernetes on AWS without needing to install, operate, and maintain your own Kubernetes control plane or nodes. Kubernetes is an open-source system for automating the deployment, scaling, and management of containerized applications.

Step 1: Login AWS console

  • Open IAM Dashboard
  • **** Create a user. username : ashish
  • Attach AdministratorAccess policy.
  • Create access and secret key.

Step 2: Create a Ec2 machine

  1. Open a EC2 Dashboard.
  2. Launch instance
  3. Name and Tags : MyTest
  4. Application and OS Image ( AMI ) : Amazon Linux 2023 AMI
  5. Instance Type: t2.micro
  6. Keypair : ashish.pem
  7. Network Settings : VPC, subnet
    • Security Group : 22 - SSH (inbound)
  8. Storage : Min 8 GiB , GP3
  9. Click Launch instance

Step 3: Login EC2 instance and configure Access/Secret key.

Login to EC2 instance.
Configure Access key and Secret key using AWS CLI.

Step 4: Install eksctl and kubectl using AWS CLI.

Setup eksctl
  • Download and extract the latest release
  • Move the extracted binary to /usr/local/bin
  • Test that your eksclt installation was successful
Setup kubectl
  • Download kubectl version
  • Grant execution permissions to kubectl executable
  • Move kubectl onto /usr/local/bin
  • Test that your kubectl installation was successful

Step 5: Create a cluster using eksctl command.

eksctl command Overview :
  • eksctl create cluster : Creating a cluster​​ eksctl
  • --name ashish :**** Name of Cluster
  • --version 1.24 : EKS cluster version
  • --region us-east-1 : AWS Region Name
  • --nodegroup-name ashish-workers : Autoscaling Group Name
  • --node-type t3.medium : instance type
  • --nodes 2 : Desire Node capacity is 2.
  • --nodes-min 1 : Minimum Node capacity is 1.
  • --nodes-max 4 --managed : Maximum capacity is 4.
After executing eksctl command output is as below:
EKS cluster successfully launch verification steps:
  1. AWS CLI
    • Check how many pods are running
  1. AWS Console
  • Verify EKS Cluster and version.
EKS-1.24
  • Verify ASG Group
ASG
Step 6: Delete the EKS Cluster
When you’re done using an Amazon EKS cluster, you should delete the resources associated with it so that you don’t incur any unnecessary costs.
Delete the cluster and its associated nodes with the following command,
Output:
Conclusion :
In this blogs, we learned how to setup a Kubernetes cluster on EC2 machine using AWS CLI.

Comments