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?
Create an eksctl deployment file (eksworkshop.yaml) to create an EKS cluster:
cat << EOF > eksworkshop.yaml
---
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: eksworkshop-eksctl
region: ${AWS_REGION}
version: "1.21"
iam:
withOIDC: true
managedNodeGroups:
- amiFamily: AmazonLinux2
instanceType: m5.large
name: mng-od-m5large
desiredCapacity: 2
maxSize: 3
minSize: 0
labels:
alpha.eksctl.io/cluster-name: eksworkshop-eksctl
alpha.eksctl.io/nodegroup-name: mng-od-m5large
intent: control-apps
tags:
alpha.eksctl.io/nodegroup-name: mng-od-m5large
alpha.eksctl.io/nodegroup-type: managed
k8s.io/cluster-autoscaler/node-template/label/intent: control-apps
iam:
withAddonPolicies:
autoScaler: true
cloudWatch: true
albIngress: true
privateNetworking: true
EOF
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.
Notice that the we add 3 node labels:
Amazon EKS adds an additional Kubernetes label eks.amazonaws.com/capacityType: 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.