Skip to main content

Using eksctl

This section outlines how to build a cluster for the lab exercises using the eksctl tool. This is the easiest way to get started, and is recommended for most learners.

The eksctl utility has been pre-installed in your Amazon Cloud9 Environment, so we can immediately create the cluster. This is the configuration that will be used to build the cluster:

kind: ClusterConfig


region: ${AWS_REGION}
version: '1.27'
created-by: eks-workshop-v2

withOIDC: true

privateAccess: true
publicAccess: true

- name: vpc-cni
version: 1.14.1
configurationValues: "{\"env\":{\"ENABLE_PREFIX_DELEGATION\":\"true\", \"ENABLE_POD_ENI\":\"true\", \"POD_SECURITY_GROUP_ENFORCING_MODE\":\"standard\"},\"enableNetworkPolicy\": \"true\"}"
resolveConflicts: overwrite

- name: default
desiredCapacity: 3
minSize: 3
maxSize: 6
instanceType: m5.large
privateNetworking: true
releaseVersion: 1.27.3-20230816
maxUnavailablePercentage: 50
workshop-default: 'yes'

Based on this configuration eksctl will:

  • Create a VPC across three availability zones
  • Create an EKS cluster
  • Create an IAM OIDC provider
  • Add a managed node group named default
  • Configure the VPC CNI to use prefix delegation

Apply the configuration file like so:

~$export EKS_CLUSTER_NAME=eks-workshop
~$curl -fsSL | \
envsubst | eksctl create cluster -f -

This generally takes 20 minutes. Once the cluster is created run this command to use the cluster for the lab exercises:

~$use-cluster $EKS_CLUSTER_NAME

Next Steps

Now that the cluster is ready, head to the Getting Started module or skip ahead to any module in the workshop with the top navigation bar. Once you're completed with the workshop, follow the steps below to clean-up your environment.

Cleaning Up (steps once you are done with the Workshop)


The following demonstrates how you will later clean up resources once you are done using the EKS Cluster you created in previous steps to complete the modules.

Before deleting the Cloud9 environment we need to clean up the cluster that we set up in previous steps.

First use delete-environment to ensure that the sample application and any left-over lab infrastructure is removed:


Next delete the cluster with eksctl:

~$eksctl delete cluster $EKS_CLUSTER_NAME --wait