CloudComputing Day2 Actual en
CloudComputing Day2 Actual en
Cloud Computing
Day two
WSC2022SE_TP53_Day2_acutal_en
Contents
Description of project and tasks ..................................................................................................................... 3
Service Details .................................................................................................................................................. 7
Reference ........................................................................................................................................................ 10
Background
Unicorn Service core functions can only run in EKS but in order to make the transition journey smoother, you can
build and test it on EC2 or any Linux systems. However, if you run Unicorn Service on EC2 instance and provide
its address to customer, it will cause you losing points at some point during the game. Unicorn Service provides
root path (/) for health check and won’t be affected by the environment where it is running, once you get HTTP
200 response from root path, it attests that your application is running normally.
Unicorn company has strict security policy that doesn’t allow SSH access from internet, please use suitable AWS
service to access EC2 instances.
The company security team has created several policies allow you to create necessary IAM roles to deploy
Unicorn Service but they don’t leave any document on this process, you need to figure out how to do it. You can
find what role you can create through the policy of Team Role. Security team also requires that all database
credential should be automatically rotated every 30 days. The following table describe the IAM policies provided
by Security team:
AutoScalerPolicy Allow EKS automatically adjusts the number of nodes in your cluster
Initial state
Upon starting the competition, there is a running Amazon EC2 instance in the account. The unicorn service is
not functional at this stage but there is also no traffic being generated. Requests will begin 2 hours after the
start of the competition.
Caution
Please bear in mind that do not terminate the running instance provided by default. Otherwise, you wouldn’t be
able to create EC2 instance due to unicorn company’s security protocol if you deleted it. The default instance act
as a bastion server, you should use this instance to accomplish your tasks and make sure that judges can login
into this instance and check your system, if you installed any application or tools on this machine, make sure its
installation path is added to PATH variables. (There is an EC2 instance profile ready for you to use if you need,
the profile would be named like *TeamRoleInstanceProfile*)
Tasks
1. Log into Gameday with your assigned hash (Provided on the day)
2. Set your team/competitor name on the Dashboard
3. Read the documentation thoroughly (Outlined below)
4. Log into the Amazon Web Services console (link provided from the Dashboard)
5. Check your own permission before choosing tools to accomplish your tasks
6. Examine existing configurations in EC2 (Elastic Cloud Computer server)
7. Examine existing configurations in VPC (Virtual Private Cloud, Network Segment)
8. Create a EKS Cluster through AWS Console, two IAM roles named EKSClusterRole and EKSNodeRole have
been created for you to run a functional EKS Cluster, please check the permissions of those roles to decide
how to use it.
9. Deploy application into EKS to handle increasing load
10. Configure any server dependencies as outlined in the technical details
11. Monitor performance of the application servers in the “Score Events and Scoreboard” and through the AWS
Console with CloudWatch
12. Serve client requests to gain points, reference the “Score Events and Scoreboard” to ensure you are scoring
positively by serving the requests
13. Process exceptions when they are received, reference the “Request Exception Handling” below
14. This section of the Test Project will continue for 7.5 hours.
Technical Details
1. The server application is deployed as a Go binary compiled from source. Do not alter the binary in any way as
that will be grounds for disqualification.
2. For this day of competition focus on EKS as your compute resource. Do not use ECS or Fargate.
3. The server application can handle about 5 connections before starting to get really slow. Be careful about
overloading and watch for HTTP 503 responses from the server when the queue fills.
4. The server application is x86 statically linked, unstripped ELF executable binary, both root and stub
application binaries can be found in Readme file of this game event.
5. The server in this version has many more requirements in order to run. In addition to the baseline
requirements listed below there are additional service requirements outlined below.
(a) It must have permissions to listen on the TCP port defined (default port 80)
(b) It must have a configuration file supplied from AWS AppConfig service.
(c) It must have access to a running Redis (ElasticCache)server.
(d) It must have access to a running MySQL(RDS PostgreSQL) server with the table structure specified.
(e) It must have access to an area to store cached files. (EFS)
Architecture
The above example illustrates one possible architectural design for the deployment of the application. This shows
all required segments needed to server requests.
unicornid varchar(256),
unicornlocation varchar(256)
);
This example above creates a table called unicorns, your table name must be unicorns as well.
Note: The table name is set to "unicorns" in the application and cannot be changed. You will need to create the
table as defined in the example.
Redis (ElasticCache)
You will want to deploy a centralized Redis service for the same reasons as you want to create a centralized
MySQL service, for efficiency. Just as with MySQL, you can create a per-instance deployment of Redis but that
will operate slower (fewer responses to requests) than using a centralized solution. Again, this workload is not
intensive and thus should be deployed on t3.medium series instances. It should take no more than two Redis
instances to meet the needs of our application. Using more than two would indicate an inefficient deployment.
Please note that the application currently is not work with Redis Cluster.
File Storage
A central file storage location IS NOT a requirement for the application to operate. The application will serve
some requests faster with a centralized file storage solution but competitors should focus on initial application
functionality rather than fine tuning application performance. As with the previous service examples, you could
look to create a centralized file storage solution to use with your application. You can use a local directory to
save the cache files but a shared storage solution or the ability to share files to each instance will allow for faster
responses.
FsPath is the local directory (followed by a "/") on the instance where the server application is able to both read
and write to the cache files. This can be a local directory on the server or a remote directory mounted as a local
directory on the server.
{
"DBSecretArn": "arn:aws:secretsmanager:region:accountid:secret:prod-7aKIJz",
"DBName": "unicorn",
"FsPath": "./",
"Bucket": "unicorn-us-es-ws-1903",
"Port": 80
}
{
"RedisHost": "wschina.hqvb4d.ng.0001.use1.cache.amazonaws.com",
"RedisPort": "6379",
"FsPath": "./",
"Port": 80,
"Bucket": "unicorn-us-es-ws-1903"
}
RedisHost is the hostname of the Redis service provider.
RedisPort is the TCP port number for the service.
Bucket is the S3 bucket used to store refund records.
Port is the TCP port number on which Root server is listening
FsPath is the local directory (followed by a "/") on the instance where the server application is able to both read
and write to the cache files. This can be a local directory on the server or a remote directory mounted as a local
directory on the server.
Reference
1. Kubernetes Deployment: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
2. Kubernetes Service: https://kubernetes.io/docs/concepts/services-networking/service/
3. Kubernetes Ingress: https://kubernetes.io/docs/concepts/services-networking/ingress/
4. Amazon Web Services Load Balancer Controller: https://docs.aws.amazon.com/eks/latest/userguide/aws-
load-balancer-controller.html
5. Amazon Web Services Load Balancer Controller Guide: https://kubernetes-sigs.github.io/aws-load-
balancer-controller/v2.3/ , Please note that this guide may contains outdated information, all information
related to Kubernetes should align with Kubernetes official documents.