Skip to content

Instantly share code, notes, and snippets.

@qtangs
Created June 10, 2020 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qtangs/6b344e8e3df62c36656473caabfed7cb to your computer and use it in GitHub Desktop.
Save qtangs/6b344e8e3df62c36656473caabfed7cb to your computer and use it in GitHub Desktop.
2020 Code Challenges

Problem #1 (Kubernetes)

We will be using kubernetes to manage our containers, and we need to know how basic kubernetes objects work, and how to provision them.

Challenge

Write the k8 config required to deploy a basic nginx webserver with this image nginxdemos/hello, using minikube to provision your cluster control plane.

Your resulting created objects should look similar to the likes of the below:

NAME                                     READY   STATUS    RESTARTS   AGE
pod/nginx-hello-world-84c67f76c4-4g5sd   1/1     Running   0          6s
pod/nginx-hello-world-84c67f76c4-xgdkc   1/1     Running   0          12m

NAME                        TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE
service/kubernetes          ClusterIP   10.96.0.1       <none>        443/TCP        18m
service/nginx-hello-world   NodePort    10.97.240.170   <none>        80:32042/TCP   12m

NAME                                READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/nginx-hello-world   2/2     2            2           12m

NAME                                           DESIRED   CURRENT   READY   AGE
replicaset.apps/nginx-hello-world-84c67f76c4   2         2         2       12m

And you should be able to see this page by hitting the browser with the minikube ip and nodeport:

Click here to see screenshot. Note, this screenshot does not include the url to hit, please also include the url to hit in your screenshot.

Note: Please use declarative configs to provision the objects.

Deliverables

  1. A public github repo link of your config files.
  2. Output of your "kubectl get all" just like above
  3. A screenshot of the browser with the nginx page, with the url configured in the address bar.
  4. README.md in the repo for steps to setup the minikube cluster + apply the k8 configs + curl the url on the machine.

Options

Choose an operating system you want to run the cluster from. If you are performing the above on your laptop, it is your laptop OS:

  1. Centos
  2. Ubuntu
  3. Mac
  4. Windows

Problem #2 (Architecture)

Symbiosis is a health product manufacturing company and currently on-premises infrastructure. They have recognized the benefits of moving to a cloud infrastructure & would like to evaluate an AWS cloud solution.

Based on their priorities and internal discussions, they have provided you with some high-level requirements which they would like you to implement in the proposed solution. The high-level requirements are as follows:

  • A private isolated network which would best suit Symbiosis’s 2 tier architectural needs. In order to meet their internal SLA’s they require a highly available solution as well.

  • Symbiosis being a B2C company, would typically like their web applications to be accessible over the internet and thus handle HTTP traffic.

  • The database tier should have restricted access (not open to HTTP) and allow traffic only through the web tier. The database tier should allow outbound requests via NAT.

  • They would like to reduce the administrative burden of managing their SQL database and requires a managed database for their SQL engine in the proposed solution. They need the database to be highly available.

  • Currently they experience medium to high traffic on their network. The traffic to the web tier is managed by a load balancer which diverts traffic to healthy instances. They would ideally like a Load Balancer with an ability to perform layer 4 (Transport Protocol) and layer 7 (Application) checks while balancing the load. There is no requirement at this point to balance the load on the database tier.

  • In their current setup, the traffic being inconsistent, requires over provisioning resulting in increased costs. In order to overcome this issue, they would like the new system to allow automatic scaling in the event of a traffic spike.

Assignment deliverables

  1. An architecture diagram that would suit the needs of the above case study
  2. An implementation of the said architecture. You can choose any application to host in your implementation. A good example of a webapp that does CRUD operations can also be found here: https://github.com/chapagain/nodejs-mysql-crud. Please provide us with:

At the end of this assignment, please provide us with:

  1. A URL to the web app
  2. A public repo with the deliverables included

Tip: You do not need to strongly constrain yourselves with the requirements above! If an alternative solution is more cost-effective, and easier to maintain, why not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment