Files
mtusi2026lab3/docs/archive/k3s-migration.md

4.1 KiB

k3s and Pingap migration

Completed implementation specification. Native source, acceptance, measurements and reports are complete. Final ZIP verification and file hashes are recorded separately by the parent delivery workflow in DELIVERY.json.

Approved by the owner: replace the lab3 and lab4 runtime with k3s + Pingap, following the azur-games ingress pattern. Keep the existing Compose path until equivalent acceptance passes. Preserve original public contracts, tests and assignment files. No external publication or submission is authorized.

Use a separate single-server k3d cluster per lab on the test host, with an explicit private kubeconfig and context. Kubernetes resources and Pingap TOML live in git; generated synthetic credentials remain outside git and enter Kubernetes Secrets through stdin. This is a disposable coursework stand, not a multi-host HA cluster. No changes to the azur-games cluster are required.

Pingap is a Deployment behind a LoadBalancer Service. API uses a headless Service, DNS discovery and readiness. PostgreSQL, Valkey and lab4 RustFS use PVCs and private Services. Migrations and S3 bootstrap are bounded Jobs. User data stays outside API pods. Local k3d uses the already installed k3s image; image digests are pinned.

Acceptance cases before implementation

Situation Example Expected result Level
Wrong target foreign cluster/context, missing receipt, malformed name reject before mutation helper unit
Startup new isolated cluster and empty volumes migrations, dependencies, API and Pingap ready integration
Discovery two API pods, scale 1/2/4 distinct real pod IDs, DNS updates HTTP integration
API failure delete the actual serving pod surviving API serves within public test deadline, no duplicates e2e
Rolling replacement restart API Deployment during writes readiness, continuing writes, measured errors e2e
Persistence restart API, PostgreSQL, Valkey, Pingap and S3 old session, messages and original bytes survive e2e
Private S3 anonymous object read, unrelated bucket creation denied integration
Partial upload S3 or SQL error after write existing reconciliation guarantees preserved isolated integration
Resource limits fixed and growing API budget, pool ABBA verify actual requests/limits and collect new measurements experiment
Memory ten uploads and extreme PNG decoder bounded rejection and measured memory experiment

Failures include unavailable DNS/API/store, wrong namespace, unclaimed cluster, failed Jobs, stale readiness, rollout timeout and cleanup failure. Never turn a failed inventory read into permission to create or remove a cluster. Existing HAProxy evidence remains explicitly historical and is not relabeled as Pingap evidence.

Progress

  • Runtime and guarded operational helpers; native image inventory, scoped stdin, Pod UID ownership and cleanup guards verified.
  • Equivalent public and student acceptance for lab3 and lab4. Smoke, full persistence, both failover scenarios and lab4 isolated reconciliation passed. Final HTTP acceptance passed409/457 assertions; SQL stdin and replaced original Pod UIDs verified.
  • New measurements and reports:16 lab3 samples plus a30-second rollout, ten concurrent image uploads and the extreme PNG/Adam7 memory Job. Game guards returned exactly1. Historical Compose numbers stay separate.
  • Independent runtime review and verified source sync:89 lab3 and115 lab4 source files match the remote checked copy.
  • Final native source and reports prepared for clean local commits and archive generation. CRC and complete byte-equality receipts are maintained separately in the parent DELIVERY.json.

Independent read-only runtime/model/experiment-helper review found no remaining confirmed P1/P2. All84 unit cases and read-only Biome formatting/lint passed. Checked native source hashes are retained with the evidence. Independent review also verified the new measurements/report, including the negative pool result and the41.04% p95 reduction at4→2 API with equal total limits.