Skip to content

feat: Phase 1 production readiness (#12)#13

Merged
jensens merged 5 commits intomainfrom
feat/phase1-production-readiness
Apr 8, 2026
Merged

feat: Phase 1 production readiness (#12)#13
jensens merged 5 commits intomainfrom
feat/phase1-production-readiness

Conversation

@jensens
Copy link
Copy Markdown
Member

@jensens jensens commented Apr 8, 2026

Summary

Implements the critical missing components for production use, as identified in #12.

Changes

  1. -j none flag — disables chroot jail for non-root operation (§8.3 H4-Fix)
  2. Readiness probe on agent /health — pods not Ready until VCL pushed
  3. preStop hooksleep 5 for graceful shutdown (§3.3 K3-Fix)
  4. VCL-aware health — 503 when "boot" VCL, 200 after operator push
  5. Hash-based VCL naming<ns>-<name>-<hash[:8]> prevents collision
  6. Bootstrap VCL ConfigMap — clean 503 until operator pushes real VCL

Startup flow

Operator creates ConfigMap → StatefulSet → varnish starts with bootstrap VCL (503) → agent /health returns 503 → pod NOT Ready → operator pushes real VCL → agent /health returns 200 → pod Ready → traffic routed

Tests

  • All existing tests pass + 2 new health endpoint tests
  • Pre-commit hooks pass

jensens and others added 5 commits April 8, 2026 09:52
Architecture §8.3 H4-Fix requires -j none when running as non-root.
Without it, varnish tries chroot jail setup which needs root.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Readiness probe on agent /health (port 9090) ensures pods are only
marked Ready when the agent can reach varnishd. preStop sleep(5)
gives the endpoints controller time to remove the pod from routing
before varnish stops (architecture §3.3 K3-Fix).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Pods are not ready (readiness probe fails) until the operator
successfully pushes real VCL. The 'boot' VCL (varnish default)
triggers a 503 response from /health.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
VCL name is now <namespace>-<name>-<hash[:8]>. Each VCL generation
gets a unique name, preventing 'Already a VCL named ...' errors
when the operator pushes updated VCL.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Operator creates a ConfigMap with placeholder VCL that returns
503 'Cache initializing'. Mounted as /etc/varnish/default.vcl so
varnish starts cleanly. Combined with the readiness probe, pods
are not marked Ready until the operator pushes real VCL.

This replaces the need for a vinyl-init container (architecture
§3.3 — simpler approach with same result).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jensens jensens merged commit 8ee03ac into main Apr 8, 2026
7 of 8 checks passed
@jensens jensens deleted the feat/phase1-production-readiness branch April 8, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant