Creating an Amazon EKS cluster

Amazon Elastic Kubernetes Service (Amazon EKS) is a fully managed Kubernetes service, trusted to run the most sensitive and mission critical applications because of its security, reliability, and scalability.

If you are running this workshop at an AWS hosted event, a 3 node cluster with the name “eksworkshop-eksctl” will be pre-created for you. Please skip cluster creation step listed below.

EKS Cluster creation

CLUSTER="aqua-<name>"
eksctl create cluster --name ${CLUSTER} --region ${AWS_REGION} --zones ${AWS_REGION}a,${AWS_REGION}b

Launching EKS and all the dependencies will take approximately 15 minutes

Verify the cluster

Test the cluster:

Get cluster Name and Region:

eksctl get clusters

Set CLUSTER: (use the name of the Cluster from earlier step)

CLUSTER=<YOUR_CLUSTER_NAME>

Update kubeconfig:

aws eks update-kubeconfig --name $CLUSTER --region $AWS_REGION

Confirm your nodes:

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

Export the Worker Role Name for use throughout the workshop:

STACK_NAME=$(eksctl get nodegroup --cluster $CLUSTER -o json | jq -r '.[].StackName')
ROLE_NAME=$(aws cloudformation describe-stack-resources --stack-name $STACK_NAME | jq -r '.StackResources[] | select(.ResourceType=="AWS::IAM::Role") | .PhysicalResourceId')
echo "export ROLE_NAME=${ROLE_NAME}" | tee -a ~/.bash_profile

Congratulations!

You now have a fully working Amazon EKS Cluster that is ready to use!