Provision EKS Cluster

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.

Challenge:

How do I check the IAM role on the workspace?

Expand here to see the solution

Create an EKS cluster

eksctl must be at version 0.58.0 or above to deploy EKS 1.22. Click here for the installation instructions.

Create an eksctl deployment file (kubecost-workshop.yaml) for use in creating your cluster by using the following command:

cat << EOF > kubecost-workshop.yaml
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
  name: kubecost-workshop-eksctl
  region: ${AWS_REGION}
  version: "1.23"
availabilityZones: ["${AZS[0]}", "${AZS[1]}", "${AZS[2]}"]
managedNodeGroups:
- name: nodegroup
  desiredCapacity: 3
  instanceType: t3.large
  volumeSize: 80
  ssh:
    enableSsm: true
EOF

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

We are deliberately launching at least one Kubernetes version behind the latest available. Please review Amazon EKS Kubernetes versions to determine what supported versions are currently available.

eksctl create cluster -f kubecost-workshop.yaml

Launching EKS and all the dependencies will take approximately 15 minutes.

Test cluster after completion:

Confirm your nodes:

kubectl get nodes # if we see our 3 nodes, we know we have authenticated correctly

Update the kubeconfig file to interact with you cluster:

aws eks update-kubeconfig --name kubecost-workshop-eksctl --region ${AWS_REGION}

Congratulations!

You now have a fully working Amazon EKS Cluster that is ready to use! Before you move on to any other labs, make sure to complete the steps on the next page to update the EKS Console Credentials.