In this article we are going to cover How to Install and configure AWS CLI on Ubuntu 20.04 LTS, Install and configure kubectl on Ubuntu 20.04 LTS, Install eksctl plugin using curl and setup EKS Cluster using eksctl | amazon eks cluster using eksctl.

Introduction:

Amazon Elastic Kubernetes Service (EKS) is a popular managed Kubernetes service. Using eksctl, a simplified command-line tool for EKS, you can quickly provision an EKS cluster. In this article, we will walk you through the process of setting up an EKS cluster, all from an Ubuntu 20.04 machine.Now, Let’s see the steps of “How to Create an Amazon EKS Cluster on Ubuntu 20.04 Using eksctl?”

What is eksctl ?

eksctl is a simple CLI tool for creating clusters on EKS – Amazon’s new managed Kubernetes service for EC2. It is written in Go, and uses CloudFormation.

Prerequisites:

  • AWS Account with admin previlleges

Install unzip on Ubuntu 20.04 LTS using apt

ubuntu@Rushi-InfoTech:~$ sudo apt install unzip

Update the server:

First we need to update the server. To update the server we need enter the following command:

ubuntu@Rushi-InfoTech:~$ sudo apt-get update

Step #1:Install AWS CLI on Ubuntu 20.04 LTS

Download the installation file in one of the following way:

ubuntu@Rushi-InfoTech:~$ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"

Unzip the installer: If your Linux distribution doesn’t have a built-in unzip command, use an equivalent to unzip it. The following example command unzips the package and creates a directory named aws under the current directory.

ubuntu@Rushi-InfoTech:~$ unzip awscliv2.zip

Run the install program: The installation command uses a file named install in the newly unzipped aws directory. By default, the files are all installed to /usr/local/aws-cli, and a symbolic link is created in /usr/local/bin. The command includes sudo to grant write permissions to those directories.

ubuntu@Rushi-InfoTech:~$ sudo ./aws/install

Confirm the installation with the following command

ubuntu@Rushi-InfoTech:~$ aws --version

Step #2:Configure AWS CLI in Ubuntu 20.04 LTS

Run the AWS configure command to set up your AWS credentials, default region, and desired output format:

ubuntu@Rushi-InfoTech:~$ aws configure

You’ll be prompted to enter the following:

  • AWS Access Key ID: Your access key
  • AWS Secret Access Key: Your secret key
  • Default region name: Your preferred AWS region (e.g., ap-south-1)
  • Default output format: How you want data displayed, usually json

Your credentials will be stored in ~/.aws/credentials and your configuration settings in ~/.aws/config.

Setup EKS Cluster using eksctl

Step #3:Install eksctl on Ubuntu 20.04 LTS using curl

Firstly, fetch and install eksctl with the following commands:

ubuntu@Rushi-InfoTech:~$ curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp
ubuntu@Rushi-InfoTech:~$ sudo mv /tmp/eksctl /usr/local/bin

Check the installation:

ubuntu@Rushi-InfoTech:~$ eksctl version

Step #4:Install kubectl on Ubuntu 20.04 LTS

Grab kubectl using:

ubuntu@Rushi-InfoTech:~$ curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
ubuntu@Rushi-InfoTech:~$ chmod +x kubectl
ubuntu@Rushi-InfoTech:~$ sudo mv kubectl /usr/local/bin/

Step #5:Setup EKS Cluster on AWS using eksctl

Using eksctl, initiate the creation of the EKS cluster:

ubuntu@Rushi-InfoTech:~$ eksctl create cluster --name Rushi-InfoTech-ekscluster --version 1.27 --nodegroup-name Rushi-InfoTech-Node --node-type t2.micro --nodes 2 --nodes-min 1 --nodes-max 2 --region ap-south-1

You will see the result that you have successfully created the cluster and nodes.

This command specifics:

  • eks create cluster: Rushi-InfoTech-ekscluster.
  • –name:
  • –version:
  • –nodegroup-name: Rushi-InfoTech-Node using t2.micro instances.
  • –node-type: , but can scale between 1 and 2 nodes based on demand.
  • –nodes-min: the ap-south-1 region (Mumbai).
  • –nodes-max 2:

Cluster provisioning typically takes about 15 minutes. Once completed, eksctl configures kubectl to use the new cluster.

We have covered setup eks cluster using eksctl.

Step #6:To list nodes on Kubernetes using kubectl

After successful creation, using below kubectl command to list nodes on kubernetes cluster.

ubuntu@Rushi-InfoTech:~$ kubectl get nodes

After successful creation, you can check the clusters:

ubuntu@Rushi-InfoTech:~$ eksctl get cluster --region ap-south-1

The standard-workers node group nodes should now be listed.

Conclusion:

In this article we have covered How to Install and configure AWS CLI on Ubuntu 20.04 LTS, Install and configure kubectl on Ubuntu 20.04 LTS, Install eksctl plugin using curl and setup EKS Cluster using eksctl.

Related Articles:

Setup Kubernetes cluster on Ubuntu 20.04 LTS using kubeadm

Reference:

eksctl – The official CLI for Amazon EKS

Any queries pls contact us
https://rushiinfotech.in/contact/

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *