Kubernetes Simulator

advanced · ~30 min

Launch the bookstore

Ticket WEB-142 — launch the Bookstore. The cluster is empty apart from the ingress controller. Build it the way you'd build it at work.

  • frontend — nginx:1.27, 2 replicas, serving our page: index.html in your directory.
  • api — ghcr.io/hackademy/orders-api:1.2, 2 replicas, listening on 8080. It reads DB_PASSWORD from its environment; the database password is b00ks-prod-7, and it must not appear in any Deployment.
  • Customers use http://bookstore.local: / goes to the frontend, /api to the API.
  • The API answers /ready only once it can reach the database. Don't send it traffic before that.
  • The launch email goes out in about ten minutes: the API must scale itself between 2 and 6 replicas on CPU.

Name things as the ticket does (frontend, api) — the team's dashboards look for those names. There are no starter files beyond the page, and the hints won't hand you commands.

Objectives

  • The API runs 2 ready replicas, its password from a Secret
  • Only API pods that can reach the database get traffic
  • The frontend serves index.html from a ConfigMap, 2 replicas
  • bookstore.local serves the page at / and the API at /api
  • The API scales itself between 2 and 6 replicas on CPU
  • Ride out launch traffic with at least 4 ready API pods
  • Bonus: Check the page through the front door with curl

Best on a computer with a keyboard. It works on a phone, with shortcuts under the terminal.