Files
aevolution/docs/adr/0088-rendered-deployment-policy.md
T
2026-10-08 12:08:53 -04:00

3.1 KiB

[Reviewed]

ADR-0088: Rendered deployment-policy checks with pinned kustomize

Status

Accepted 2026-10-02 (M9.8f review correction). Extends ADR-0069's offline policy check.

Context

tools/ci/deploy-policy-check.py validated manifest files one by one. Kustomize inline strategic-merge or JSON patches, components and namespace transformations change the effective objects without appearing as checkable files; the M9.8f review reproduced inline patches enabling the session listener, sessions, synthetic inputs and a session port while the check passed.

Decision

  • The check renders every non-component kustomization under deploy/ with a pinned kustomize and validates the effective output: overlay namespaces; evo-region's session/input/listener environment, the single listener argument and container ports; Service types and the session port; route Service shape; NetworkPolicies admitting the session port; quotas; Ingresses; and the absence of Secrets. Source-file checks stay.
  • NetworkPolicies (review of 8a1e5ef): every rendered environment keeps its default-deny (all pods, both directions, no rules). Any rendered ingress rule whose selector can select a region pod (empty or expression selectors count) must not admit the session port: omitted or empty ports, a TCP entry without a port, the name session, 7400 or a range spanning it all count, whatever the sources. Only the route policy may, with its full reviewed shape. The route Service and policy use the same validators for source and rendered objects (VIP, ranges, annotations, selector).
  • Kustomizations may use only the keys in use today (resources, components, patches, images, labels, common labels/annotations, namespace, ConfigMap generators); generators/transformers plugins, Helm inflation and Secret generators are refused.
  • Dependency: kustomize v5.8.1 (kubernetes-sigs, Apache-2.0), official Linux amd64 release archive, SHA-256 029a7f0f4e1932c52a0476cf02a0fd855c0bb85694b82c338fc648dcb53a819d, matching the release's checksums.txt. Maintenance evidence (GitHub releases, 2026-10-02): v5.8.0 2025-11-09, v5.8.1 2026-02-09, v5.8.2 2026-09-30. v5.8.1 is pinned rather than the two-day-old v5.8.2; updates change the version and checksum together.
  • Acquisition is explicit: tools/ci/prepare-kustomize.sh [dir] downloads, verifies and installs it (default .cache/tools/kustomize-v5.8.1); the CI deploy image runs it. The check uses $KUSTOMIZE, that cache path or kustomize on PATH, and fails unless the binary reports exactly the pinned version. No build step downloads it implicitly.

Alternatives considered

  • kubectl kustomize: its embedded kustomize version follows kubectl releases.
  • Parsing patches in Python: re-implements kustomize semantics incompletely.
  • kubeconform/schema validation: complements but does not evaluate policy.

Consequences

Running the policy check locally needs the pinned binary (Linux x86_64 is pinned). Rendering adds seconds to the deploy suite. The self-test covers inline and JSON patches, namespace changes and unsupported features.