A small stateless order API designed to demonstrate a complete container delivery workflow.
GET /healthandGET /ready— Kubernetes probesGET /orders— list in-memory ordersPOST /orders— create an order withcustomerand non-emptyitems
npm test
npm start
# or: docker compose up --build
curl -X POST localhost:3000/orders -H 'content-type: application/json' \
-d '{"customer":"Ada","items":["keyboard"]}'Node.js built-in test runner, non-root/read-only container, GitHub Actions, GHCR publishing, Kubernetes probes, resource limits and HorizontalPodAutoscaler. Replace OWNER in k8s/app.yaml before deployment.
Client -> Node API (/orders, /health, /ready) -> Docker Compose (local) / Kubernetes HPA (prod)
src/server.js— in-memory order store, payload limit and JSON validation..github/workflows/ci-cd.yml— test, build, publish and gated deploy jobs.k8s/app.yaml— Deployment, Service, probes, limits andHorizontalPodAutoscaler.
Autoscaling is only useful when the metrics and the HPA target are right: couple the HPA to CPU and expose a /metrics endpoint when you expect load spikes. A read-only root container with explicit requests/limits keeps the node process honest about its footprint, and validating the request body (non-empty items) at the edge prevents bad orders from ever reaching the store.
| Path | Method | Purpose |
|---|---|---|
POST /orders |
POST | create an order (customer + non-empty items) |
GET /orders |
GET | list stored orders |
GET /health, /ready |
GET | Kubernetes probes |