proxy-operator: Kubernetes operator for crawling-proxy fleets #1
Reference in New Issue
Block a user
Delete Branch "feat/proxy-operator"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements the full proxy-operator prototype per docs/plans/2026-08-07-1747-proxy-operator.md (execution log with per-step details: docs/plans-executions/2026-08-07-1747-proxy-operator.md).
What's in here:
ProxyCRD (crawl.example.com/v1alpha1) with CEL cross-field validation and full structural defaultingVerification:
make testgreen with -race across 11 packages (75–100% coverage on the internal ones); full end-to-end pass on a throwaway kind cluster — Squid pod Ready via a real CONNECT probe, lease grant/report/cooldown-409/release through the API, finalizer cleanup. Two things the kind run caught and fixed: squid FD-table OOM under containerd's unlimited RLIMIT_NOFILE, and the quickstart moving in-cluster because host-side probes can't reach kind pod IPs.Note:
mainwas pushed at the scaffold baseline commit (the repo had no remote branches before this MR), so the diff here is the entire feature on top of the untouched kubebuilder scaffold.🤖 Generated with Claude Code
Full ProxySpec/ProxyStatus/Proxy types per the plan: PlacementSpec, CloudInitSpec, EndpointSpec, HealthCheckSpec, SecretKeySelector, all defaults, and 7 CEL XValidation rules enforcing mode/provider immutability, provider/endpoint required-iff-Managed/External, and cloud-init exactly-one-of inline/secretRef. Applies the four corrections identified during planning that would otherwise be silent bugs: MaxLeases as *int32 (so an explicit 0 survives Go round-trips instead of re-defaulting to 5), HealthCheck's default={} marker (so nested defaults apply even when the field is omitted entirely), MinLength=1 on Provider/CloudInit.Inline (so the CEL has() checks stay simple), and listType=map on Conditions. Adds pure helpers (EffectivePort, EffectiveHost, HealthCheckOrDefault, MaxLeasesOrDefault) with table-driven tests, for use by the health engine, discovery API, and spec-hash computation in later steps. Patches the scaffolded placeholder controller test's resource literal to a schema-valid spec so it survives the new CRD validation — the test itself is rewritten wholesale in Step 4 alongside the real reconciler. Regenerated deepcopy and the CRD; make test green (envtest confirmed all 7 CEL rules enforced by a real apiserver). Co-Authored-By: Claude <noreply@anthropic.com>