Creating an EKS cluster in AWS is a great way to run Kubernetes workloads on AWS without the hassle of managing the Kubernetes control plane. EKS means Elastic Kubernetes Service. The Kubernetes control plane plays a crucial role in a Kubernetes deployment as it is responsible for how Kubernetes communicates with your cluster — starting and stopping new containers, scheduling containers, performing health checks, and many more management tasks. This step-by-step guide will help you set up an EKS cluster:
![](https://rushiinfotech.in/wp-content/uploads/2023/09/Untitled-design-3-1.png)
Prerequisites:
- AWS account.
- Install and configure the AWS CLI.
- Install kubectl for Kubernetes command-line access.
- Install eksctl, a simple CLI tool for creating clusters on EKS.
- Ensure you have an IAM role for EKS service.
Creating EKS Cluster in AWS:
Open AWS Management Console, navigate to EKS and select “Create EKS Cluster”.
![](https://rushiinfotech.in/wp-content/uploads/2023/09/Screenshot-2023-09-14-203910-1024x574.png)
You have to go through 6 Steps to create EKS Cluster
Step 1: Configure Cluster:
- We have to enter a unique name for this cluster.
- We have to select the Kubernetes version for this cluster.
- We have to Select the IAM role to allow the Kubernetes control plane to manage AWS resources on your behalf.
![](https://rushiinfotech.in/wp-content/uploads/2023/09/Screenshot-2023-09-15-152400-1-1024x570.png)
- We can define a set of tags for our Amazon EKS clusters to help us track each cluster’s owner and stack level. We gave Name as EKS Cluster1.
- Then click Next to proceed.
![](https://rushiinfotech.in/wp-content/uploads/2023/09/Screenshot-2023-09-15-161408-1024x565.png)
Step 2: Specify networking
- We have to select a VPC to use for your EKS cluster resources. We have selected Default VPC here.
- We have to choose the subnets in your VPC where the control plane may place elastic network interfaces (ENIs) to facilitate communication with your cluster. We have selected 2 subnets from 3 available subnets.
- We have to choose the security groups to apply to the EKS-managed Elastic Network Interfaces that are created in your worker node subnets. We have selected existing Security Groups here.
![](https://rushiinfotech.in/wp-content/uploads/2023/09/Screenshot-2023-09-15-161831-1024x567.png)
- We have to configure access to the Kubernetes API server endpoint. We have selected Public in this case.
- We can Add/edit sources to public access endpoint.
- Then click Next to proceed.
![](https://rushiinfotech.in/wp-content/uploads/2023/09/Screenshot-2023-09-17-120250-1024x634.png)
Step 3: Configure logging
- We can send audit and diagnostic logs from the Amazon EKS control plane to CloudWatch Logs.
- We have options like API server, Audit, Authenticator, Controller manager & Scheduler.
- Based on our requirements, we can on/off these options.
- Then click Next to proceed.
![](https://rushiinfotech.in/wp-content/uploads/2023/09/Screenshot-2023-09-17-121126-1024x570.png)
Step 4: Select add-ons
- We can review the add-ons from multiple categories, then select add-ons to enhance your cluster.
- Then click Next to proceed.
![](https://rushiinfotech.in/wp-content/uploads/2023/09/Screenshot-2023-09-17-121629-1024x630.png)
Step 5: Configure selected add-ons settings
- We can configure the add-ons for our cluster by selecting settings like CoreDNS, kube-proxy & Amazon VPC CNI. We are going with default options.
- Then click Next to proceed.
![](https://rushiinfotech.in/wp-content/uploads/2023/09/Screenshot-2023-09-17-122233-1024x610.png)
Step 6: Review and create
- We can review all the options we have selected if needed we can make changes.
- Then click Create to proceed.
![](https://rushiinfotech.in/wp-content/uploads/2023/09/image-43-1024x610.png)
![](https://rushiinfotech.in/wp-content/uploads/2023/09/Screenshot-2023-09-17-123334-1024x609.png)
- It takes approximately 10 minutes to create cluster.
![](https://rushiinfotech.in/wp-content/uploads/2023/09/image-45-1024x518.png)
![](https://rushiinfotech.in/wp-content/uploads/2023/09/image-46-1024x525.png)
- We can browse options like Overview, Resources, Compute, Networking, Add-ons, Authentication, Logging, Update history & Tags after Cluster creation.
Creating EC2 instance & Connecting EKS cluster:
- We have to create an Amazon Linux EC2 instance to connect with EKS cluster.
![](https://rushiinfotech.in/wp-content/uploads/2023/09/image-52-1024x541.png)
- Create an Amazon Linux EC2 instance with default options and Select existing security group in Network Settings which we have selected while EKS cluster creation, then click Launch instance.
![](https://rushiinfotech.in/wp-content/uploads/2023/09/Screenshot-2023-09-19-175913-1024x533.png)
- We will launch EC2 instance using MobaXterm.
- We have to install & update Kubectl by using the below commands:
[ec2-user@Rushi-InfoTech ~]$ curl -O https://s3.us-west-2.amazonaws.com/amazon-eks/1.27.4/2023-08-16/bin/linux/amd64/kubectl
[ec2-user@Rushi-InfoTech ~]$ curl -O https://s3.us-west-2.amazonaws.com/amazon-eks/1.27.5/2023-09-14/bin/linux/amd64/kubectl.sha256
[ec2-user@Rushi-InfoTech ~]$ sha256sum -c kubectl.sha256
[ec2-user@Rushi-InfoTech ~]$ openssl sha1 -sha256 kubectl
[ec2-user@Rushi-InfoTech ~]$ chmod +x ./kubectl
[ec2-user@Rushi-InfoTech ~]$ mkdir -p $HOME/bin && cp ./kubectl $HOME/bin/kubectl && export PATH=$HOME/bin:$PATH
[ec2-user@Rushi-InfoTech ~]$ echo 'export PATH=$HOME/bin:$PATH' >> ~/.bashrc
![](https://rushiinfotech.in/wp-content/uploads/2023/09/image-53-1024x258.png)
- We have to Create or update a Kubeconfig file for an Amazon EKS cluster by using below command:
[ec2-user@Rushi-InfoTech ~]$ aws eks update-kubeconfig --region eu-north-1 --name Rushi-InfoTech
![](https://rushiinfotech.in/wp-content/uploads/2023/09/image-54-1024x163.png)
Adding Worker Nodes:
- Select the EKS Cluster, go to Compute and under Node groups click Add node group.
![](https://rushiinfotech.in/wp-content/uploads/2023/09/Screenshot-2023-09-19-183735-1024x476.png)
- Give the name for the Node group.
![](https://rushiinfotech.in/wp-content/uploads/2023/09/Screenshot-2023-09-19-190131-1.png)
- Create Node IAM role with these permissions and select that Node IAM role.
1. AmazonEKSWorkerNodePolicy
2.AmazonEC2ContainerRegistryReadOnly
3.AmazonEKS_CNI_Policy
![](https://rushiinfotech.in/wp-content/uploads/2023/09/image-55-1024x497.png)
![](https://rushiinfotech.in/wp-content/uploads/2023/09/image-56-1024x457.png)
![](https://rushiinfotech.in/wp-content/uploads/2023/09/Screenshot-2023-09-19-185900-1024x509.png)
- We are proceeding with default options in Set compute and scaling configuration.
![](https://rushiinfotech.in/wp-content/uploads/2023/09/Screenshot-2023-09-19-190743.png)
- Select the subnets which we selected while EKS cluster creation.
![](https://rushiinfotech.in/wp-content/uploads/2023/09/Screenshot-2023-09-19-191056-1024x409.png)
- We can Review and then click Create.
![](https://rushiinfotech.in/wp-content/uploads/2023/09/Screenshot-2023-09-19-191309.png)
- We can see the Node group is created after 5 minutes approximately.
![](https://rushiinfotech.in/wp-content/uploads/2023/09/image-58-1024x447.png)
- Finally, the EKS cluster is created and we can check in EC2 instance with the below command.
[ec2-user@Rushi-InfoTech ~]$ kubectl get nodes
![](https://rushiinfotech.in/wp-content/uploads/2023/09/image-59-1024x186.png)
Conclusion:
Hence by using above steps we can create EKS cluster in AWS. The big benefit of EKS cluster, is taking away the operational burden involved in running the Kubernetes control plane. EKS cluster will provision, scale and manage the Kubernetes control plane for you to ensure high availability, security and scalability.
For More Information about EKScluster, please visit official website.
Any queries pls contact us
https://rushiinfotech.in/contact/