The purpose of this test scenario is to find out if the candidate is able to quickly study new technologies and apply them in practice. Even though most of the configuration snippets can be found around the Internet, we also expect the candidate to understand how the infrastructure works and is able to explain choices he made during the implementation.
Discussion will take place on chosen solution and used technologies after task is completed.
- Start an instance of Kubernetes (use minikube or other similar project, don't use cloud provider's managed kubernetes).
- Run the
go-simple-server
service (built from this repo) in the Kubernetes instance.- create Dockerfile and build container
- push container image into some public registry (e.g. https://hub.docker.com/)
- create kubernetes manifests and deploy them into your k8s cluster - Service rolling update must not lead to an outage.
- Run Prometheus and Grafana in the same Kubernetes instance observing the running service.
- Create a Grafana dashboard with information about the state of the
go-simple-server
service. It should show at least:- Number of requests served by the service grouped by a status code (as a graph).
- Histogram of a response latency.
Simple go server with healthcheck, metrics and logging listening on port :8080
Requires Go version 1.16.
go build
$ ./go-simple-server
INFO[2021-04-29T12:01:25+02:00] Server started
/
- returns200 OK
,404 Not Found
,500 internal server error
. There is 5:2:3 chances to get 200, 404, 500 status code. Also there is random latency (0-1000 ms)/liveness
- used for kubernetes liveness check - returns200 OK
/readiness
- used for kubernetes readinsss check - returns200 OK
/metrics
- used for prometheus metrics scraping