Launch EKS

DO NOT PROCEED with this step unless you have validated the IAM role in use by the Cloud9 IDE. You will not be able to run the necessary kubectl commands in the later modules unless the EKS cluster is built using the IAM role.


How do I check the IAM role on the workspace?

Expand here to see the solution

Create an EKS cluster

Create an eksctl deployment file (eksworkshop.yaml) to create an EKS cluster:

cat << EOF > eksworkshop.yaml
kind: ClusterConfig

  name: eksworkshop-eksctl
  region: ${AWS_REGION}
  version: "1.21"

- amiFamily: AmazonLinux2
  instanceType: m5.large
  name: mng-od-m5large
  desiredCapacity: 2
  maxSize: 3
  minSize: 0
  labels: eksworkshop-eksctl mng-od-m5large
    intent: control-apps
  tags: mng-od-m5large managed control-apps
      autoScaler: true
      cloudWatch: true
      albIngress: true
  privateNetworking: true

# To enable all of the control plane logs, uncomment below:
# cloudWatch:
#  clusterLogging:
#    enableTypes: ["*"]


Next, use the file you created as the input for the eksctl cluster creation.

eksctl create cluster -f eksworkshop.yaml

Launching EKS and all the dependencies will take approximately 15 minutes

eksctl create cluster command allows you to create the cluster and managed nodegroups in sequence. There are a few things to note in the configuration that we just used to create the cluster and a managed nodegroup.

  • Nodegroup configurations are set under the managedNodeGroups section, this indicates that the node group is managed by EKS.

  • Nodegroup instance type is m5.large with minSize to 0, maxSize to 3 and desiredCapacity to 2. This nodegroup has capacity type set to On-Demand Instances by default.

  • Notice that the we add 3 node labels:

  •, to indicate the nodes belong to eksworkshop-eksctl cluster.

  •, to indicate the nodes belong to mng-od-m5large nodegroup.

  • intent, to allow you to deploy control applications on nodes that have been labeled with value control-apps

  • Amazon EKS adds an additional Kubernetes label ON_DEMAND, to all On-Demand Instances in your managed node group. You can use this label to schedule stateful applications on On-Demand nodes.