Split dmozdb into separate backend + web OKE workloads#2
Merged
Conversation
Separate the Deno/Fresh frontend from the Zig backend so SSR scales horizontally and a frontend CPU spike can no longer starve the backend health probe (the 100-VU CrashLoopBackOff root cause). - Backend: standalone StatefulSet binding 0.0.0.0; add CIDR support to DMOZDB_TRUSTED so cross-pod clients (pod + node subnet) are allowed. - Web: horizontally-scaled Deployment + HPA (min 2 / max 4) behind the Traefik ingress; reaches the backend over a ClusterIP service. - Users/sessions move to a shared in-cluster denokv StatefulSet (KV Connect). - Split the combined image into Dockerfile.backend + Dockerfile.web; CD builds and pushes both (arm64, tag-suffixed in one OCIR repo). - NetworkPolicies (best-effort under flannel), metrics-server install, and a one-shot users.db -> denokv migration script.
The first split cutover is manual (StatefulSet needs a one-time --cascade=orphan recreate), so PRs must build+push the images without triggering the deploy job. Tag PR builds with the PR head SHA.
poly-glot
added a commit
that referenced
this pull request
Jun 7, 2026
Split dmozdb into separate backend + web OKE workloads
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Fixes the 100-VU CrashLoopBackOff: the combined pod let Deno's SSR boot CPU starve the backend's health probe. Splitting them isolates the fault and lets SSR scale horizontally.
What
DMOZDB_TRUSTEDnow accepts CIDRs so cross-pod clients (pod10.244.0.0/16+ node10.0.1.0/24) are allowed. tcpSocket probes.denokvStatefulSet (KV Connect).Dockerfile.backend+Dockerfile.web; CD builds + pushes both (arm64, tag-suffixed in one OCIR repo).scripts/migrate-kv.ts.Verification
zig build testexit 0 (Linux + Zig 0.15.2 container), incl. new CIDR tests.cd web && deno task checkexit 0.--cascade=orphanrecreate — immutable volumeClaimTemplate removal).Cutover note
First deploy is a controlled manual cutover (delete STS
--cascade=orphan→ apply); CD's plain apply would fail on the immutable StatefulSet change. Done before merge so the merge-triggered CD apply is idempotent.