In this article we are going to learn the steps of “How to terminate EKS Cluster Using eksctl?”

Introduction:

Amazon EKS clusters are wonderful for orchestrating containerized applications. However, there are times when we may not need to have the cluster running, especially to avoid unnecessary charges. Using eksctl, the de-provisioning process becomes much simpler. In this guide, we’ll detail how you can efficiently tear down an EKS cluster in the Ubuntu 20.04. Let’s see the steps of “How to terminate EKS Cluster Using eksctl?”

Steps of “How to terminate EKS Cluster Using eksctl?”:

Step #1:Verify eksctl Installation:

Ensure that eksctl is installed on your machine. If not, install it 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 #2:List EKS Clusters:

Before deletion, list all EKS clusters in the ap-south-1 region to confirm the cluster’s existence:

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

This command lists all clusters in the specified region. Identify the one you wish to delete.

Step #3:Terminate the EKS Cluster :

To delete an EKS cluster named Rushi-InfoTech-ekscluster in the ap-south-1 region, use the following command:

ubuntu@Rushi-InfoTech:~$ eksctl delete cluster --name Rushi-InfoTech-ekscluster --region ap-south-1

( or ) we can also delete the cluster if the names are not same, by the following command:

ubuntu@Rushi-InfoTech:~$ eksctl delete cluster Rushi-InfoTech-ekscluster

You will see the result that all the cluster resources were deleted.

This process can take several minutes. eksctl handles the deletion of all resources associated with the cluster, including the worker nodes, control plane, and associated AWS resources.

Step #5:Confirm Termination of Cluster:

Once the deletion process finishes, you can attempt to list clusters again to ensure it has been removed:

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

Your deleted cluster ( Rushi-InfoTech-ekscluster ) should no longer appear in the list.

Conclusion:

Shutting down resources when they aren’t in use is crucial for effective cost management in the cloud. With eksctl, the process of tearing down an EKS cluster, even in specific regions like ap-south-1, is streamlined and hassle-free. Always remember to monitor your AWS account for any lingering resources and ensure they are deleted if not needed. From this article we have learnt “How to terminate EKS Cluster Using eksctl?”

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 *