- Lab 1 - Building a Docker Image
- Lab 2 - Introduction to Pods
- Lab 3 - Playing around with our Pod
- Lab 4 - Labeling our Pods
- Lab 5 - Deployments
- Lab 6 - Services
- Lab 7 - Namespaces
- Lab 8 - Ingress
- Lab 9 - HPA
Follow the steps below to get setup with a Cloud9 environment and create your EKS Cluster.
This will be where you'll be performing the labs throughout the sessions.
Click the button to begin creating a CloudFormation stack for the region you are assigned.
Preferably right click and open it in a new tab.
Region | CloudFormation |
---|---|
eu-central-1 (Frankfurt) |
Tick the I acknowledge that AWS CloudFormation might create IAM resources.
checkbox then click on the Create stack
button
If you get stuck, the CloudFormation template is available here and also in this repo.
The IAM role will grant your Cloud9 environment access to perform the actions needed for the sessions.
This can be done in the EC2 console by navigating to your EC2 instances, or clicking the link below (Preferably right click and open it in a new tab):
Region | EC2 |
---|---|
eu-central-1 (Frankfurt) | Console link |
- Select the Cloud9 instance
- Click
Actions
>Security
>Modify IAM Role
- Filter the roles, searching for
cloud9
- Click
Save
once the role is selected
This can be done in the Cloud9 console, navigate to Cloud9 or click the link below (Preferably right click and open it in a new tab):
Region | EC2 |
---|---|
eu-central-1 (Frankfurt) | Console link |
- Click
Open IDE
The environment will be our workstation for the sessions, there are a few steps needed to get it setup
-
From within the Cloud9 environment perform the steps below:
- Click on the
AWS Cloud9 icon
(top left) >Preferences
- Click on
AWS Settings
>Credentials
- Turn off
AWS managed temporary credentials
- Click on the
-
Change to a dark theme if you prefer:
View
>Themes
>UI Themes
>Classic Dark
git clone https://github.com/aws-els-cpt/eks.git
The script installs and configures the necessary pre-requisites
eks/scripts/bootstrap.sh
Confirm the IAM role is as expected
Launch your cluster from the Cloud9 environment by running the following eksctl
command:
eksctl create cluster --version 1.19 --node-type t3.medium --managed --name eks
If you scaled down your cluster on Day 2 you can scale up using eksctl
as follows:
eksctl get clusters
eksctl get nodegroup --cluster eks
eksctl scale nodegroup --cluster=eks --nodes=2 ng-xxxxxxx
Navigate to https://deploymentvls-cpt.eks.aws.dev/ and click the Submit Challenge
button.
- Please Make sure that the image which you build can be accessed publicly (DockerHub public repo under your account)
- If you successfully built the application, add the LoadBalancer URL in a file called url.txt , with the http url ONLY
- Fill out the assessment in assessment/ together with all the yaml files used to solve the problem, zip it and upload it to: https://deploymentvls-cpt.eks.aws.dev/#uploadChallange.
- Make sure to zip all the files in the directory e.g.:
zip -r 01JohnSnow.zip *
Note:
- The zip file must be named as:
Name
+Surname
.zip, e.g.:01JohnSnow.zip
- ONLY .zip files are allowed
Your voucher should cover the costs for the full period of the learning series but if, between sessions, you want to
prevent extra costs you can scale down your clusters using eksctl
as follows:
eksctl get clusters
eksctl get nodegroup --cluster eks
eksctl scale nodegroup --cluster=eks --nodes=0 --nodes-min=0 --name ng-xxxxxxx
After the end of all three sessions, follow the steps below to delete the EKS cluster and Cloud9 environment
Delete all the services of type LoadBalancer
which have provisioned ELBs in your account:
# List all services with type LoadBalancer
$ kubectl get svc --all-namespaces -o json \
| jq -r '.items[] | select(.spec.type == "LoadBalancer") | .metadata.name'
# For each of the outputted services do
$ kubectl delete svc <service name>
service "<service name>" deleted
Then you can delete the node group, cluster and CloudFormation stack.
This can be done in the Cloud9 console, navigate to Cloud9, or click the link below:
Region | EC2 |
---|---|
eu-central-1 (Frankfurt) | Console link |
- Delete the EKS cluster from the Cloud9 terminal with the below command:
eksctl delete cluster eks
This can be done in the CloudFormation console, navigate to CloudFormation, or click the link below:
Region | EC2 |
---|---|
eu-central-1 (Frankfurt) | Console link |
There may be a number of stacks, select the stack named "cloud9", and click the "Delete" button