Amazon Elastic Kubernetes Service (EKS) is a managed Kubernetes service that simplifies the deployment, management, and scaling of containerized applications using Kubernetes. On this tutorial, we’ll cover essentially the most useful AWS EKS commands.
These are the commands we’ll cover:
- Creating an EKS Cluster
- Updating an EKS Cluster
- Deleting an EKS Cluster
- Listing EKS Clusters
- Describing an EKS Cluster
- Making a Node Group
- Updating a Node Group
- Deleting a Node Group
- Listing Node Groups
- Describing a Node Group
Prerequisites
Before proceeding, be certain that you’ve got the next installed:
- AWS CLI: Install and configure the AWS CLI by following the official documentation.
- kubectl: Install kubectl to interact with the Kubernetes cluster.
- eksctl: Install eksctl, a command-line tool for creating and managing EKS clusters.
1. Creating an EKS Cluster
To create an EKS cluster, use the eksctl create cluster command. Include your required cluster name and your chosen AWS region:
eksctl create cluster –name –region
For instance:
eksctl create cluster –name my-eks-cluster –region us-west-2
2. Updating an EKS Cluster
To update the Kubernetes version of your EKS cluster, use the eksctl update cluster command together with your cluster name, your AWS region, and the specified Kubernetes version:
eksctl update cluster –name –region –version
For instance:
eksctl update cluster –name my-eks-cluster –region us-west-2 –version 1.21
3. Deleting an EKS Cluster
To delete an EKS cluster, use the eksctl delete cluster command. Include your required cluster name and your chosen AWS region:
eksctl delete cluster –name –region
For instance:
eksctl delete cluster –name my-eks-cluster –region us-west-2
4. Listing EKS Clusters
To list all EKS clusters in a particular region, use the eksctl get cluster command. Include your AWS region:
eksctl get cluster –region
For instance:
eksctl get cluster –region us-west-2
5. Describing an EKS Cluster
To get detailed details about an EKS cluster, use the aws eks describe-cluster command. Include your required cluster name:
aws eks describe-cluster –name
For instance:
aws eks describe-cluster –name my-eks-cluster
6. Making a Node Group
To create a node group on your EKS cluster, use the eksctl create nodegroup command. Include together with your cluster name, AWS region, and your required node group name:
eksctl create nodegroup –cluster –region –name
For instance:
eksctl create nodegroup –cluster my-eks-cluster –region us-west-2 –name my-node-group
7. Updating a Node Group
To update a node group, use the eksctl update nodegroup command. Include your cluster name, your AWS region, your node group name, and the specified Kubernetes version:
eksctl update nodegroup –cluster –region –name –kubernetes-version
For instance:
eksctl update nodegroup –cluster my-eks-cluster –region us-west-2 –name my-node-group –kubernetes-version 1.21
8. Deleting a Node Group
To delete a node group, use the eksctl delete nodegroup command. Include your cluster name, your AWS region, and your node group name:
eksctl delete nodegroup –cluster –region –name
For instance:
eksctl delete nodegroup –cluster my-eks-cluster –region us-west-2 –name my-node-group
9. Listing Node Groups
To list all node groups in a particular EKS cluster, use the eksctl get nodegroup command. Include your cluster name and your AWS region:
eksctl get nodegroup –cluster –region
For instance:
eksctl get nodegroup –cluster my-eks-cluster –region us-west-2
10. Describing a Node Group
To get detailed details about a particular node group, use the aws eks describe-nodegroup command. Include your cluster name and your node group name:
aws eks describe-nodegroup –cluster-name –name
For instance:
aws eks describe-nodegroup –cluster-name my-eks-cluster –name my-node-group
This tutorial has provided a reference for essentially the most useful AWS EKS commands, covering the creation, management, and deletion of EKS clusters and node groups. With these commands, you’ll be able to efficiently manage your Kubernetes infrastructure on AWS.