Skip to content

feat: replace Core Pepr with Go operator and native admission - #3190

Open
jeff-mccoy wants to merge 61 commits into
mainfrom
codex/uds-native-controller-20261031
Open

jeff-mccoy wants to merge 61 commits into
mainfrom
codex/uds-native-controller-20261031

Conversation

@jeff-mccoy

@jeff-mccoy jeff-mccoy commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Stack order. #3284 retires Registry1 on the current Pepr implementation and should merge first. This PR remains the Go operator integration reference.

Replaces Core’s Pepr runtime with a Go operator and Kubernetes CEL admission across base, standard, and derived bundles. Application packages retain the Package, Exemption, and ClusterConfig APIs. Kubernetes 1.36 is the minimum, and exemption name patterns now use RE2.

Controller and admission

The Go operator owns Package networking, Istio and Envoy Gateway resources, SSO, monitoring, probes, CA bundles, status, and finalization. CEL handles object-local checks and defaults; Go handles contextual admission and waypoint behavior. Two replicas serve admission; one elected replica reconciles Packages and compiles exemptions. Losing leadership drains reconciliation and re-campaigns without stopping admission. Different namespaces reconcile concurrently; shared resources retain scoped locks and ownership-checked conflict retries.

Both admission paths use one protected, revisioned exemption union. Only the compiler writes its snapshot; Helm does not seed it. Debug-container updates enforce current policy without requiring a creation-time revision stamp that Kubernetes cannot update on that subresource. Service validation uses current grants directly; its mutation markers are informational. RE2 patterns compile once per matcher when the Go store changes. Matching remains unanchored, uses generateName when needed, and preserves empty-pattern matching. Unsupported patterns are rejected at admission and before upgrading. Historical invalid matchers degrade individually, with Warning Events and snapshot diagnostics; they do not revoke unrelated exemptions. Informational mutation annotations reset noncanonical content instead of invoking JavaScript.

Informer scopes avoid caching unrelated Secrets, ConfigMaps, and Pods. Workload events no longer fan out into Package reconciles. Serving certificates renew proactively with overlapping trust, and deleted webhook registrations repair automatically within the current installation’s UID boundary. Scoped watches trigger serving maintenance under an independent API budget. Bounded HTTP requests, listener liveness, replica spreading, a disruption budget, retry Events, and admission decision metrics support operation.

Installation and image distribution

The transition is one-way. Zarf runs packaged host helpers using the deployment host’s existing authentication, without exporting a kubeconfig. Preflight checks compatibility before draining Pepr. Installation preserves API identities, waits for replacement readiness, verifies admission in a scratch namespace, requests its UID-guarded deletion, then retires Core-owned Pepr resources. Interrupted transitions recover forward by rerunning the package.

Package creation consumes published controller images and helpers, without compiling Go or invoking Docker/buildx. CI builds upstream and unicorn images for amd64 and arm64; release workflows publish multi-architecture manifests, keyless signatures, and SBOM attestations. Development and integration tests have explicit local artifact overrides.

Upstream uses a pinned public Chainguard static base. Unicorn uses the digest-pinned, licensed Chainguard go-fips compiler and the minimal static runtime, with startup and installer FIPS checks. This release retires the Registry1 flavor across builds, packages, CI, and publication. Existing Registry1 consumers should review the flavor transition guidance before upgrading. The ADR records the architecture, alternatives, and distribution contract.

Fresh API-server replicas can temporarily reject native-policy requests while their parameter-CRD discovery cache warms. Enforcement stays fail-closed; installation checks actual mutation and denial probes before retirement. The upgrade guide covers recovery and asynchronous scratch-namespace cleanup.

Validation

Local validation passed: the full Go race suite, vet, vulnerability checks, 16 chart tests, installer credential-inheritance tests, and generated-artifact drift checks. CEL differential tests execute all 18 Pod and Service validations against pinned inputs. Live API-server tests on Kubernetes 1.36 and 1.37 compare native defaults with Go and verify debug-container admission, protected snapshot writes, and namespace teardown. Live Helm tests verify registration repair, upgrades, and teardown. HA fixtures use embedded etcd, with an explicit runtime check; standard SQLite coverage remains. The AKS CI database uses newer D4ds_v5 compute at the existing four-vCPU/16-GiB size.

The licensed-builder unicorn image passed static-build and FIPS runtime checks; the binary refuses startup with FIPS disabled. Full integration CI passed on 5e9ccf1, including Legacy/Next compatibility, HA installs and upgrades, K0s, private PKI, and all EKS, AKS, and RKE2 flavors. All current-run cloud teardowns completed. Release image publication, signing, and SBOM attachment are wired but are not executed by PR checks. The frozen Pepr oracle is manual-only. Core retains Keycloak and does not depend on the separate identity-provider proposal.

The current FIPS image declares user 65532, and its Quarkus application is accessible only to the image owner and group. UID 1000 causes AccessDeniedException during startup. Match the runtime UID, GID and volume group while preserving the non-root and capability restrictions. Add rendered-chart coverage using the actual Unicorn values.
The read-only diagnostic confirmed image user 65532 and Quarkus application ownership 65532:65532 with mode 0770. The runtime values and rendered regression now cover the correction; remove the one-off image export and filesystem scan.
The image UID changed from 1000 to 65532. Fresh installs succeed with the corrected runtime identity, but upgraded Keycloak cannot rewrite the existing 1000-owned truststore and H2 data. Enable the existing upgrade-only permission migration for Unicorn and derive its target UID/GID from the runtime security context instead of hard-coding 1000. Preserve the registry1 identity and the migration container capability restrictions.
@jeff-mccoy
jeff-mccoy marked this pull request as ready for review October 31, 2026 17:49
@jeff-mccoy
jeff-mccoy requested a review from a team as a code owner October 31, 2026 17:49
@jeff-mccoy
jeff-mccoy marked this pull request as draft October 31, 2026 21:34
Install the Go operator and CEL admission in base, standard, and derived variants. Preserve application APIs, legacy finalizers and exemption semantics, and migrate existing Core ownership before retiring only its Pepr module.
@jeff-mccoy jeff-mccoy changed the title feat: add Go UDS controller and native admission policies feat: replace Core Pepr with Go operator and native admission Oct 31, 2026
Resolve the host architecture when CI does not set an override, provide the internal image template to lint, declare YAML tooling directly, and remove stale Pepr dependency assumptions from reload tests and Renovate.
Keep Lease heartbeats independent of reconciliation load, preserve the installer's registry internally, and wait for real admission cache convergence before retirement. Prepare test dependencies explicitly, verify fixture Package readiness, resolve passthrough addresses within their request action, and generate unchanged Velero CRDs from the pinned Helm chart.
@jeff-mccoy
jeff-mccoy marked this pull request as ready for review November 1, 2026 00:29
@jeff-mccoy
jeff-mccoy requested a review from a team as a code owner November 1, 2026 00:29
Wait for the fixture's declared Packages before creating dependent workloads, and allow the bounded cold-start reconciliation queue to drain before transport assertions. Keep API and browser assertions and their deadlines unchanged.
Drain writer epochs before releasing leadership, retain queued work, and isolate admission maintenance from reconciliation. Scope Package locks to namespaces and shared aggregates while retrying ownership-checked apply conflicts.

Protect compiler snapshots, preserve debug-container admission across exemption revisions, harden serving and deployment behavior, and restore useful retry Events. Execute native policies on Kubernetes 1.36 and 1.37 and gate generated artifacts and Go hygiene.
Wait for an actual policy rejection using a non-persisting dry-run canary. Share the installer contract count and test it against the shipped native policies and callback registrations.
Retain the revision fence for security-relevant Pod defaults and guard the optional subresource field. Service validation uses current policy without requiring informational markers to match. Add live SSA coverage and allow enough bounded request space for both old and new admission objects.
Bound serving initialization and reconciliation with contexts while allowing watch streams to remain connected under the independent admission API budget.
Keep the General Purpose fixture at four vCPUs and 16 GiB while moving from D4s_v3 to D4ds_v5.
Select K3s cluster-init through the existing Legacy and Next HA configuration variables. Retain the existing node topology and workload assertions.
Require successful probes and accepted UID-guarded scratch cleanup without waiting for asynchronous namespace finalizers. Preserve failures for refused or unauthorized deletion and document API-server discovery warm-up.
Adopt main's Keycloak runtime-user implementation and updated Falco artifacts while retaining native transition compatibility.
Retain the Zarf action cutover and the native Kubernetes support floor. Carry forward Core 1.18 tooling, chart and schema updates, and port the current Keycloak credential-renewal behavior into Go.
Retain registry checks for external images and require the native platform builds for candidate controller artifacts. Describe the Zarf log-level mappings for standalone package linting and resolve the patched FIPS builder with the existing build identity.
Use Go 1.27.4 for builds and validation. Pin the matching multi-architecture Unicorn compiler digest resolved by the authenticated image build.
Remove registry1 from package builds, release publication, dependency readiness checks, and CI. Build and qualify upstream and unicorn across the supported architectures.

BREAKING CHANGE: Core no longer produces registry1 packages or snapshots. Consumers must select a supported flavor before moving to this release.

This branch has not been deployed

No deployments
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