This repository documents the mock test.
By end of this mock test, the participants should be able to invoke an API, hosted in Kubernetes cluster, that queries a MySQL database on Amazon RDS successfully.
The participants are expected to implement the following architecture successfully.
The mock test requires implementation of the architecture diagrams shown above. The requirements can be organised into four sections viz. Cloud, Cluster, Container and Code as seen in the figure below.
- The Code layer is already implemented in the
app
folder. Rest of the layers are to be developed. - At least, one aspect of Security and monitoring must be implemented.
- Implementation of automation is optional.
The Cloud layer is to be implemented is described in the subsequent sections.
- Launch an Amazon RDS database in the default VPC of your AWS account.
- Allow traffic into Amazon RDS database from the NAT gateway of the Amazon EKS VPC.
- Enable authentication with IAM.
- Implement at least one detective control on the Amazon EKS control plane logs.
- Enable Amazon CloudWatch Container Insights to monitor the performance of the Amazon EKS cluster.
- Launch an Amazon ECR registry with at least one of the features enabled.
- Immutable tags.
- Scan on push.
- Encrypted images.
The Cluster layer is to be implemented is described in the subsequent sections.
- Launch an Amazon EKS cluster that satisfies the following conditions
- 1 instance of type
t3.small
with label asworkload: web
. - 1 instance of type
t3.small
with label asworkload: db
.
- 1 instance of type
ns/mock
mock/deployment/demo
mock/svc/demo
mock/ing/demo
mock/sa/demo
- Create
Dockerfile
to build container image for the application in theapp
folder. - Build and push the container image to Amazon ECR.
Populate the following results table.
Item | ARN |
---|---|
Amazon RDS | |
AWS IAM | |
Amazon EKS | |
Amazon ECR |
- Paste the result of the command
kubectl -n mock get all
.
# Run kubectl -n mock get all and paste here.
- Get the DNS of ALB provisioned.
ALB_DNS=`kubectl -n demo get ing/demo -o jsonpath='{.status.loadBalancer.ingress[0].hostname}'`
echo ${ALB_DNS}
- Paste the result of API invocation -
curl -X GET http://${ALB_DNS}/demo/ts
and past here.