Production platform architecture
Start with a service contract
The capstone integrates the bookstore lessons into one architecture. A customer reads a catalog and places an order. The API can scale independently of the order ledger, but an order must be committed exactly once for a given request key. Use a Deployment for stateless API replicas, a single-replica StatefulSet for the toy ledger with its own PVC, and a bounded Job for reconciliation. The single ledger is deliberately a single point of failure: it demonstrates persistence and recovery, not a highly available database. For real production, a replicated or managed database with verified consistency and failover is a separate architecture decision.
customer -> reviewed Gateway -> catalog/order API DeploymentAPI -> ledger Service -> single StatefulSet + PVCreconciliation Job -> ledger read endpointDefine two deployment variants
The self-managed candidate uses a disposable Linux cluster, local CSI-backed storage and a reviewed Gateway implementation; operators own control-plane availability, etcd recovery and node upgrades. The managed candidate retains application intent but changes the storage class, ingress implementation, workload federation and operational responsibility. For the fictional managed design, use a supported EKS cluster as a candidate, private management access, approved EBS CSI and an installed Gateway API implementation; actual class names and permissions must be established before rendering. Neither design is ready to deploy with the placeholder image references. For managed production, move the ledger to a separately designed HA data service if the required availability cannot be met.
Base: service identities, ports, resource and probe settingsLocal overlay: two API replicas; LOCAL_CLASS_REVIEWManaged overlay: three API replicas; MANAGED_CLASS_REVIEWBoth: require actual storage, network and artifact evidenceMake trust boundaries explicit
The application namespace contains only lab workloads. The platform namespace holds the reviewed Gateway separately. A Namespace is not a security sandbox. Disable automatic ServiceAccount token mounts for applications that do not call the Kubernetes API. Grant a synthetic reader group only get/list on Pods, not Secrets. Apply restricted-style security contexts, default-deny policies, and specific allow rules for Gateway-to-API and API/Job-to-ledger flows; DNS needs explicit allowances for the actual resolver. The example uses fictional pod labels for DNS and Gateway and must be adapted and tested. NetworkPolicy does not authenticate users or encrypt traffic. The real API must enforce authentication and authorization separately.
allow: gateway -> api:8080allow: api / reconciliation -> ledger:8081allow: selected DNS endpoints:53 TCP/UDPdeny: unrelated tenant -> ledgerverify application authorization separatelyDesign delivery and capacity together
Keep a Kustomize base with local and managed overlays in Git, and use one GitOps owner for each resource. Argo CD is an optional reviewed controller, not included or executed. Start with manual approval, pruning and self-healing disabled until ownership and recovery are proven. Use readiness, liveness and bounded startup checks with distinct meanings. Two API replicas requesting 250m CPU each require 500m before other workloads and system overhead; a surge of one adds another 250m. A PDB helps constrain voluntary evictions, not every failure or rolling-update decision. Topology spread needs eligible nodes and correct labels; the two overlays deliberately use different host and zone assumptions.
baseline API requests: 2 × 250m = 500mrolling surge: 1 × 250m = 250m additionalpeak API requests: 750m, excluding ledger, job and system overheadWork through the starter and solution
The capstone folder includes a learner starter, original Python ledger, static Kubernetes manifests, two Kustomize overlays, a reference decision record and a verification matrix. The offline ledger is a local SQLite exercise, not the packaged Kubernetes HTTP application. Images refer to registry.invalid and cannot be pulled; the HTTP endpoint contract, image build, runtime tests, actual storage and Gateway are required extensions. Run the provided validator only after making predictions. Explain why a valid YAML parse and a successful local database test do not establish deployment success.
cd lab-fixtures/production-capstonepython validate_offline.pyPractice and handoff
Complete starter/decisions.json using requirements.json, compare solution/decisions.json, identify two unresolved prerequisites in each overlay and explain why the ledger is not HA. Work in the extracted offline fixture. No cloud or cluster operations are needed.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Production platform architecture — knowledge check
Integrate identity, network, storage and delivery decisions
Why is the toy ledger a StatefulSet candidate?
What must change between the two variants?
What does default-deny egress require for normal DNS?
Two API replicas at 250m plus one surge require what peak API CPU requests?
Does parsing the static manifests establish admission or deployment?