The AWS environment will be built in the us-east-2 region of AWS
-
Set up your AWS credentials from Udacity AWS Gateway locally
https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html
-
From the AWS console manually create an S3 bucket in
us-east-2calledudacity-tf-<your_name>e.gudacity-tf-emmanuel- The click
create bucket - Update
_config.tfwith your S3 bucket name
- The click
-
Deploy Terraform infrastructure
cd starter/infraterraform initterraform apply
-
Setup Kubernetes config so you can ping the EKS cluster
aws eks --region us-east-2 update-kubeconfig --name udacity-cluster- Change Kubernetes context to the new AWS cluster
kubectl config use-context <cluster_name>- e.g
arn:aws:eks:us-east-2:139802095464:cluster/udacity-cluster
- e.g
- Confirm with:
kubectl get pods --all-namespaces - Change context to
udacitynamespacekubectl config set-context --current --namespace=udacity
-
Run K8s initialization script
./initialize_k8s.sh
-
Done
NOTE All AWS infrastructure changes outside of the EKS cluster can be made in the project terraform code
-
[Deployment Troubleshooting]
A previously deployed microservice
hello-worlddoesn't seem to be reachable at its public endpoint. The product teams need you to fix this asap!- The
apps/hello-worlddeployment is facing deployment issues.- Assess, identify and resolve the problem with the deployment
- Document your findings via screenshots or text files.
- The
-
[Canary deployments]
- Create a shell script
canary.shthat will be executed by GitHub actions. - Canary deploy
/apps/canary-v2so they take up 50% of the client requests - Curl the service 10 times and save the results to
canary.txt- Ensure that it is able to return results for both services
- Provide the output of
kubectl get pods --all-namespacesto show deployed services
- Create a shell script
-
[Blue-green deployments]
The product teams want a blue-green deployment for the
greenversion of the/apps/blue-greenmicroservice because they heard it's even safer than canary deployments- Create a shell script
blue-green.shthat executes agreendeployment for the serviceapps/blue-green - mimic the blue deployment configuration and replace the
index.htmlwith the values ingreen-configconfig-map - The bash script will wait for the new deployment to successfully roll out and the service to be reachable.
- Create a new weighted CNAME record
blue-green.udacityprojectin Route53 for the green environment - Use the
curlec2 instance to curl theblue-green.udacityprojecturl and take a screenshot to document that green & blue services are reachable- The screenshot should be named
green-blue.png
- The screenshot should be named
- Simulate a failover event to the
greenenvironment by destroying the blue environment - Ensure the
blue-green.udacityprojectrecord now only returns the green environment- curl
blue-green.udacityprojectand take a screenshot of the results namedgreen-only.pngfrom thecurlec2 instance
- curl
- Create a shell script
-
[Node elasticity]
A microservice
bloaty-mcfacemust be deployed for compliance reasons before the company can continue business. Ensure it is deployed successfully- Deploy
apps/bloatwaremicroservice - Identify if the application deployment was successful and if not resolve any issues found
- Take a screenshot of the reason why the deployment was not successful
- Provide code or Take a screenshot of the resolution step
- Provide the output of
kubectl get pods --all-namespacesto show deployed services
- Deploy
-
[Observability with metrics]
You have realized there is no observability in the Kubernetes environment. You suspect there is a service unnecessarily consuming too much memory and needs to be removed
- Install a metrics server on the kubernetes cluster and identify the service using up the most memory
- Take a screenshot of the output of the metrics command used to a file called
before.png - Document the name of the application using the most memory in a text file called
high_memory.txt
- Take a screenshot of the output of the metrics command used to a file called
- Delete the service with the most memory usage from the cluster
- Take a screenshot of the output of the same metrics command to a file called
after.png
- Take a screenshot of the output of the same metrics command to a file called
- Install a metrics server on the kubernetes cluster and identify the service using up the most memory
-
[Diagramming the cloud landscape with Bob Ross]
In order to improve the onboarding of future developers. You decide to create an architecture diagram so that they don't have to learn the lessons you have learnt the hard way.- Create an architectural diagram that accurately describes the current status of your AWS environment.
- Make sure to include your AWS resources like the EKS cluster, load balancers
- Visualize one or two deployments and their microservices
- Create an architectural diagram that accurately describes the current status of your AWS environment.
In an effort to reduce your cost footprint in the AWS environment. Feel free to tear down your aws environment when not
in use. Clean up the environment with the nuke_everything.sh script or run the steps individually
cd starter/infra
terraform state rm kubernetes_namespace.udacity && terraform state rm kubernetes_service.blue
eksctl delete iamserviceaccount --name cluster-autoscaler --namespace kube-system --cluster udacity-cluster --region us-east-2
kubectl delete all --all -n udacity
terraform destroy