Amazon Elastic Kubernetes Service (EKS) is a managed Kubernetes service that simplifies the deployment, management, and scaling of containerized applications using Kubernetes. In this tutorial, we’ll cover 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
- Creating a Node Group
- Updating a Node Group
- Deleting a Node Group
- Listing Node Groups
- Describing a Node Group
Prerequisites
Table of Contents
Before proceeding, ensure that you have the following installed:
- AWS CLI: Install and configure the AWS CLI by following the official documentation.
kubectl
: Installkubectl
to interact with the Kubernetes cluster.eksctl
: Installeksctl
, 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 desired cluster name and your chosen AWS region:
eksctl create cluster --name --region
For example:
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 with your cluster name, your AWS region, and the desired Kubernetes version:
eksctl update cluster --name --region --version
For example:
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 desired cluster name and your chosen AWS region:
eksctl delete cluster --name --region
For example:
eksctl delete cluster --name my-eks-cluster --region us-west-2
4. Listing EKS Clusters
To list all EKS clusters in a specific region, use the eksctl get cluster
command. Include your AWS region:
eksctl get cluster --region
For example:
eksctl get cluster --region us-west-2
5. Describing an EKS Cluster
To get detailed information about an EKS cluster, use the aws eks describe-cluster
command. Include your desired cluster name:
aws eks describe-cluster --name
For example:
aws eks describe-cluster --name my-eks-cluster
6. Creating a Node Group
To create a node group for your EKS cluster, use the eksctl create nodegroup
command. Include with your cluster name, AWS region, and your desired node group name:
eksctl create nodegroup --cluster --region --name
For example:
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 desired Kubernetes version:
eksctl update nodegroup --cluster --region --name --kubernetes-version
For example:
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 example:
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 specific EKS cluster, use the eksctl get nodegroup
command. Include your cluster name and your AWS region:
eksctl get nodegroup --cluster --region
For example:
eksctl get nodegroup --cluster my-eks-cluster --region us-west-2
10. Describing a Node Group
To get detailed information about a specific 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 example:
aws eks describe-nodegroup --cluster-name my-eks-cluster --name my-node-group
This tutorial has provided a reference for the most useful AWS EKS commands, covering the creation, management, and deletion of EKS clusters and node groups. With these commands, you can efficiently manage your Kubernetes infrastructure on AWS.