Skip to main content

AWS EKS (Elastic Kubernetes Service)

There are multiple guides offered by AWS for creating a new Kubernetes cluster using Elastic Kubernetes Service (EKS). You can reference the links below if you'd like the full guides and documentation. For the sake of this installation guide we'll be providing a high level summary of the steps you'll need to take for the eksctl guide.


Getting started with eksctl#

This method will create several resources for you automatically with default settings and is described by AWS as the fastest and simplest way to get started with EKS.

important

The following steps will give you a cluster with default settings so we strongly recommend that you do not use this cluster for production use. For production environments you should familiarize yourself with the options available to you in the EKS documentation and create a cluster that meets your requirements.

Prerequisites#

You will need to have the following prerequisites set up or installed before moving forward with EKS.

  • An AWS account
  • Required IAM permissions - The IAM security principal that you're using must have permissions to work with Amazon EKS IAM roles and service linked roles, AWS CloudFormation, and a VPC and related resources. For more information, see Actions, resources, and condition keys for Amazon Elastic Container Service for Kubernetes and Using service-linked roles in the IAM User Guide. You must complete all steps in this guide as the same user. - aws doc
  • kubectl: The Kubernetes command line tool for interacting with your clusters
  • eksctl: A simple command line utility for creating and managing Kubernetes clusters on Amazon EKS

Configuring eksctl#

Once you have eksctl installed we need to make sure you can connect to your AWS account.

[In order for eksctl to connect to your AWS account] you will need to have AWS API credentials configured. What works for AWS CLI or any other tools (kops, Terraform etc), should be sufficient. You can use ~/.aws/credentials file or environment variables. - aws doc

If you have the AWS CLI installed and need to update your AWS API configuration files you can simply run aws configure. This will prompt you for the required values and update the config files automatically for you.

If you do not have the AWS CLI, Terraform, or any similar tool installed, no worries, you can create the credential/config files manually. Create 2 files, config and credentials in a folder named .aws in your home directory

note

Where you find your home directory location varies based on the operating system, but is referred to using the environment variables %UserProfile% in Windows and $HOME or ~ (tilde) in Unix-based systems. - aws doc

Example contents of each file are shown below and you should replace the {example-values} (including {}) with your actual values.

.aws/credentials

[default]
aws_access_key_id={AKIAIOSFODNN7-EXAMPLE}
aws_secret_access_key={wJalrXUtnFEMI/K7MDENG/bPxRfiCY-EXAMPLEKEY}

.aws/config

[default]
region={us-west-2|us-east-1|ETC}
output={json|yaml}

Creating a new cluster#

You can create a new EKS cluster using the following eksctl command. Replace {example-values} (including {}) with your own.

eksctl create cluster \
--name {my-cluster} \
--region {us-west-2} \
--fargate

This command can take quite some time but this is expected. You'll be able to see information logs in your terminal as well as AWS resources being created in the UI. In the AWS Console simply navigate to the EKS service page and select 'Clusters' and you should be able to see your new cluster being created.

note

Keep in mind the region in the AWS console needs to match the region you provided when creating the cluster

important

If for any reason you encounter a problem during cluster creation you can troubleshoot by:

  • Checking the CloudFormation dashboard in the AWS console and search for failed 'Stacks'
  • Trying eksctl utils describe-stacks --region={your-region} --cluster={your-cluster-name}

Once the cluster creation is finalized, in the same terminal you ran the eksctl command, you should see the following logs or something similar:

  • [โœ”] saved kubeconfig as "/Users/{example-user}/.kube/config"
  • [โ„น] kubectl command should work with "/Users/{example-user}/.kube/config", try 'kubectl get nodes'

This means that your kubectl should already be updated and configured to execute against your new cluster. You should be able to run the kubectl get nodes command and see the same nodes in the AWS console in the EKS cluster dashboard. If you see the same results in the command line as the console then congratulations, you have a EKS cluster that is ready to connect to our Jetic Platform.

Whenever you're ready to delete your EKS cluster and clean up your AWS resources simply run the following command. Replace {example-values} (including {}) with the same you used to create the cluster

eksctl delete cluster --region={your-region} --name={your-cluster-name}
note

Deleting the EKS cluster will take quite some time. This is expected.

You can now proceed to our documentation on connecting to a cluster