Get started with Amazon EKS – eksctl
This guide helps you to create all of the required resources to get started with Amazon Elastic Kubernetes Service (Amazon EKS) using eksctl
, a simple command line utility for creating and managing Kubernetes clusters on Amazon EKS. At the end of this tutorial, you will have a running Amazon EKS cluster that you can deploy applications to.
The procedures in this guide create several resources for you automatically that you have to create manually when you create your cluster using the AWS Management Console. If you’d rather manually create most of the resources to better understand how they interact with each other, then use the AWS Management Console to create your cluster and compute. For more information, see Get started with Amazon EKS – AWS Management Console and AWS CLI.
Prerequisites
Before starting this tutorial, you must install and configure the AWS CLI, kubectl, and eksctl tools as described in Set up to use Amazon EKS.
Step 1: Create your Amazon EKS cluster and nodes
Important
To get started as simply and quickly as possible, this topic includes steps to create a cluster and nodes with default settings. Before creating a cluster and nodes for production use, we recommend that you familiarize yourself with all settings and deploy a cluster and nodes with the settings that meet your requirements. For more information, see Create an Amazon EKS cluster and Manage compute resources by using nodes. Some settings can only be enabled when creating your cluster and nodes.
You can create a cluster with one of the following node types. To learn more about each type, see Manage compute resources by using nodes. After your cluster is deployed, you can add other node types.
-
Fargate – Linux – Select this type of node if you want to run Linux applications on Simplify compute management with AWS Fargate. Fargate is a serverless compute engine that lets you deploy Kubernetes Pods without managing Amazon EC2 instances.
-
Managed nodes – Linux – Select this type of node if you want to run Amazon Linux applications on Amazon EC2 instances. Though not covered in this guide, you can also add Windows self-managed and Bottlerocket nodes to your cluster.
Create your Amazon EKS cluster with the following command. You can replace my-cluster
with your own value. The name can contain only alphanumeric characters (case-sensitive) and hyphens. It must start with an alphanumeric character and can’t be longer than 100 characters. The name must be unique within the AWS Region and AWS account that you’re creating the cluster in. Replace region-code
with any AWS Region that is supported by Amazon EKS. For a list of AWS Regions, see Amazon EKS endpoints and quotas in the AWS General Reference guide.
Cluster creation takes several minutes. During creation you’ll see several lines of output. The last line of output is similar to the following example line.
[...] [✓] EKS cluster "my-cluster" in "`region-code`" region is ready
eksctl
created a kubectl
config file in ~/.kube/config
or added the new cluster’s configuration within an existing config file in ~/.kube/config
on your computer.
After cluster creation is complete, view the AWS CloudFormation stack named eksctl-
in the AWS CloudFormation consolemy-cluster
-cluster
Step 2: View Kubernetes resources
-
View your cluster nodes.
kubectl get nodes -o wide
An example output is as follows.
For more information about what you see in the output, see View Kubernetes resources in the AWS Management Console.
-
View the workloads running on your cluster.
kubectl get pods -A -o wide
An example output is as follows.
For more information about what you see in the output, see View Kubernetes resources in the AWS Management Console.
Step 3: Delete your cluster and nodes
After you’ve finished with the cluster and nodes that you created for this tutorial, you should clean up by deleting the cluster and nodes with the following command. If you want to do more with this cluster before you clean up, see Next steps.
eksctl delete cluster --name my-cluster --region region-code
Next steps
The following documentation topics help you to extend the functionality of your cluster.
-
Deploy a sample application to your cluster.
-
The IAM principal that created the cluster is the only principal that can make calls to the Kubernetes API server with
kubectl
or the AWS Management Console. If you want other IAM principals to have access to your cluster, then you need to add them. For more information, see Grant IAM users and roles access to Kubernetes APIs and Required permissions. -
Before deploying a cluster for production use, we recommend familiarizing yourself with all of the settings for clusters and nodes. Some settings (such as enabling SSH access to Amazon EC2 nodes) must be made when the cluster is created.
-
To increase security for your cluster, configure the Amazon VPC Container Networking Interface plugin to use IAM roles for service accounts.