title | weight |
---|---|
Creating the EKS Cluster |
31 |
In the following module, you will complete the outcomes listed below:
- Access and Configure an AWS Cloud9 IDE
- AWS Cloud9 is cloud-based integrated development environment (IDE) that lets you write, run, and debug code, all within the browser.
- Create a 3 node Amazon EKS Cluster with a provided cluster config.
Let's start by accessing the Cloud9 IDE.
If you are at an event using Workshp Studio, navigate to the AWS Console by clicking Open AWS console on the left nav bar of the workshop page.
Access the Cloud9 service by searching for it in the menu bar at the top of the screen:
When the main Cloud9 screen opens, click on Open under Cloud9 IDE
Once the IDE has loaded, we recommend you use the + button and select New Terminal to open a new full screen terminal window.
You can close the smaller terminal window at the bottom if you'd like. Welcome to Cloud9!
Using AWS Workshop Studio
::::expand{header="Using AWS Workshop Studio"}
The setup script will install (or update) a few tools and set environment variables in the Cloud9 IDE.
- Run curl command in the Cloud9 terminal:
cd
curl ':assetUrl{path="env-setup.sh" source=s3}' --output /tmp/setup.sh
- Run env-setup.sh:
cd
. /tmp/setup.sh
The cluster config file defines the EKS cluster settings and permissions for the cluster.
- Run the curl command in the Cloud9 terminal):
curl ':assetUrl{path="eksctl-cluster.yml" source=s3}' --output ~/eksctl-cluster.yml
Using Personal AWS Account
::::expand{header="Using Personal AWS Account"}
Upload the env-setup.sh and eks-cluster.yml files that were downloaded in the Workshop Environment section of the instructions to the Cloud9 environment
The setup script will install (or update) a few tools and set environment variables in the Cloud9 IDE.
- Upload the required files
You can upload files directly to your Cloud9 environment using drag and drop
- Click File in the top left of the Cloud9 environment
- Click Upload Local Files...
- Drag and drop the eks-cluster.yml and env-setup.sh files into the Upload Files pop-up window
- Verify File upload
Though files upload to the environment directory, it's somewhat more straightforward to work in the home directory.
- Run copy command in the Cloud9 terminal:
cd
cp environment/env-setup.sh /tmp/
cp environment/eksctl-cluster.yml .
- Run env-setup.sh:
cd
. /tmp/env-setup.sh
In order to give our Cloud9 IDE instance permission to create an EKS cluster we must change the IAM role the instance is using to one with the correct permissions.
- Click the cog wheel in the upper right of the Cloud9 IDE
- Click the AWS Settings section on the left of the settings window
- Switch AWS Managed Temporary Credentials to the off position
- Close the settings window
- Click the profile circle (for Workshop Stuio, it will be W) in the upper right of the Cloud9 IDE
- Click Manage EC2 Instance
- Select instance (only 1 showing)
- Open Submenus for Modify IAM role under Actions
- Choose eksctl-creator from drop-down
- Click Update IAM Role
envsubst < ~/eksctl-cluster.yml > ~/eksctl-cluster-actual.yml
eksctl create cluster -f eksctl-cluster-actual.yml ; eksctl create iamidentitymapping --cluster $EKS_CLUSTER_NAME --region=$AWS_REGION --arn $rancherUser --group system:masters --username rancher
Note: Cluster creation can take up to 25 minutes
We're done! We created an AWS EKS Cluster using eksctl
and the AWS Cloud9 IDE. Let's move onto creating the RKE2 Cluster.