In this Article we are going to cover How to create Amazon EKS cluster using eksctl
Table of Contents
What is Amazon EKS ?
Amazon Elastic Kubernetes Service (Amazon EKS) is a managed service provided by Amazon Web Services (AWS) that makes it easier to run Kubernetes clusters in the cloud. Kubernetes is an open-source container orchestration platform that helps manage and scale containerized applications.
With Amazon EKS, you can deploy, manage, and scale your applications using Kubernetes without having to worry about the underlying infrastructure. Amazon EKS takes care of the control plane, which includes the management of the Kubernetes master nodes, and you can focus on deploying and managing your containerized applications.
Features and Benefits of Amazon EKS
- Managed Kubernetes Control Plane: Amazon EKS manages the Kubernetes control plane, including the etcd cluster, ensuring high availability and scalability. You don’t need to worry about managing the control plane infrastructure.
- Integration with AWS Services: Amazon EKS integrates seamlessly with other AWS services, such as Elastic Load Balancing, Amazon RDS, AWS Identity and Access Management (IAM), Amazon VPC, and more, making it easier to build and run containerized applications.
- Security and Compliance: Amazon EKS provides security features, such as VPC networking isolation, IAM integration, encryption at rest and in transit, and support for security groups and network policies. This helps you meet security and compliance requirements.
- Automatic Scaling: You can scale your Kubernetes applications on Amazon EKS by adding or removing worker nodes based on demand. This allows your applications to handle increased traffic and workload without manual intervention.
- Application Observability: Amazon EKS integrates with AWS monitoring and logging services, such as Amazon CloudWatch, AWS X-Ray, and AWS CloudTrail, allowing you to gain insights into the performance and behavior of your applications.
- High Availability: Amazon EKS provides multi-AZ deployment options, allowing you to distribute your worker nodes across multiple availability zones for enhanced availability and fault tolerance.
To use Amazon EKS, you need to create an Amazon EKS cluster, which consists of a control plane and worker nodes. The control plane runs in an Amazon EKS-managed Kubernetes control plane, while the worker nodes are EC2 instances that run your containerized applications.
Overall, Amazon EKS simplifies the process of running Kubernetes on AWS, provides scalability, security, and integrates well with other AWS services, making it a popular choice for managing containerized applications in the cloud.
#1:Install eksctl CLI tool for creating EKS Clusters on AWS
Use below command to download eksctl CLI tool for creating EKS Clusters on AWS, To download latest eksctl tool visit eksctl official github page
curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp
move eksctl setup to /usr/local/bin directory
sudo mv /tmp/eksctl /usr/local/bin
To check eksctl version
eksctl version
Below are eksctl help commands
eksctl --help
eksctl create cluster --help
eksctl create cluster [command] --help
#2:Install Kubectl on Ubuntu
Add the kubectl GPG key
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
Create apt repo for kubectl
sudo touch /etc/apt/sources.list.d/kubernetes.list
Add Kubernetes official apt repo
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
Update the system packages
sudo apt-get update
Install kubectl on Ubuntu using below command
sudo apt-get install -y kubectl
#3:Install AWS CLI on Ubuntu
Download the aws cli bundle using below command
sudo curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
Install the unzip and python on Ubuntu if not installed
sudo apt install unzip python
Extract the aws cli bundle setup
sudo unzip unzip awscliv2.zip
Configure the AWS CLI on Ubuntu
sudo ./aws/install
Verify the AWS CLI version
aws --version
Output:
aws-cli/1.18.97 Python/2.7.18rc1 Linux/5.4.0-1015-aws botocore/1.17.20
#4:Create AWS Access Key ID and Secret Access Key
Now create AWS Access Key ID and Secret Access Key ID
- Go to the security credentials
- Then click on create access key
#5:Configure AWS CLI
To connect AWS using CLI we have configure AWS user using below command
aws configure
it will ask AWS Access Key ID, AWS Secret Access Key, Default region name, Default output format
AWS Access Key ID [None]: *********7G AWS Secret Access Key [None]: ***********************px Default region name [None]: ap-south-1 Default output format [None]: json
Now you have connected your aws account using AWS CLI.
#6:Create Amazon EKS cluster using eksctl
Create Create EKS Cluster in AWS using eksctl
eksctl create cluster --name demo-ekscluster --region ap-south-1 --version 1.21 --nodegroup-name linux-nodes --node-type t2.micro --nodes 2
#7:Check nodes in EKS cluster
To check the details about your node run the below command
kubectl get nodes kubectl get namespace kubectl describe nodes ip-192-168-14-229.ap-south-1.compute.internal
Conclusion:
In this article we have covered How to Create EKS Cluster in AWS/Amazon EKS cluster using eksctl/AWS EKS Cluster Setup using eksctl/create eks cluster using eksctl.
Related Articles: