phase2-prep: per-component no-secret rollout + component hardening (author-first)

Prep only — nothing deployed; running cluster untouched.

Reconciliation graph (operator-approved Option A): author clusters/dev/rollout/
= 4 per-component Flux Kustomizations (kyverno->cilium->longhorn->monitoring,
monitoring dependsOn longhorn). Dev overlay $patch:delete's the monolithic base
platform/apps and adds ./rollout, so only the no-secret tier reconciles; the
secret-blocked components are simply not created until hand-offs arrive. The
no-secret tier carries no SOPS content, so it needs no sops-age key. prod is
untouched (still builds the monolith). Convergence path coded in (delete rollout/
+ the two deletes) — R-ENV-02 divergence flagged for architect review.

Component hardening via cluster-vars (prod keeps strict posture):
- KYVERNO_VALIDATION_ACTION Enforce->Audit(dev), _WEBHOOK_FAILURE_POLICY
  Fail->Ignore(dev), _ADMISSION_REPLICAS 3->1(dev); webhook namespaceSelector
  excludes system+platform namespaces.
- MONITORING_STORAGE_CLASS var; GRAFANA_ADMIN_SECRET var (dev ''=chart default);
  Alertmanager SMTP/secret deferred to Phase-4 with verbatim re-enable markers.

Cilium parity verified against the live CNI (no-op adopt). Validated:
kubectl kustomize dev/prod/all-components, envsubst->YAML parse, make -C ci gate PASS.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
jakman85andClaude Opus 4.8 committed 2026-08-16 21:34:57 -05:00
1 parent 99eef2fe4c
commit d9a80e5350
16 files changed
+278 -53

No files matched your search

+20 -6
View File
@@ -34,18 +34,32 @@ spec:
remediation:
retries: 3
values:
# HA admission controller so a single pod restart cannot open an enforcement gap.
# Admission controller replicas — cluster-vars knob (prod 3 / dev 1). HA so a single pod
# restart cannot open an enforcement gap; dev drops to 1 to save RAM during bootstrap.
admissionController:
replicas: 3
replicas: ${KYVERNO_ADMISSION_REPLICAS}
backgroundController:
enabled: true # needed for generate (default-deny baseline) + sync
reportsController:
enabled: true
cleanupController:
enabled: true
# Fail-CLOSED: if the webhook is unreachable, reject rather than silently admit
# non-conforming resources (coordination-protocol.md #8). Tune per-resource in
# the policies' webhook config if a bootstrap deadlock appears.
# Webhook failure policy — cluster-vars knob (prod Fail / dev Ignore). Fail is fail-CLOSED
# (reject rather than silently admit when the webhook is unreachable, coordination-protocol.md
# #8); dev uses Ignore (fail-open) so a cold/unhealthy Kyverno cannot brick admission during
# bootstrap. The namespaceSelector ALSO excludes system + platform namespaces at the webhook
# layer — belt-and-suspenders: policies already scope to app-namespace=true, but this
# guarantees kube-system/flux-system/CNI/storage/monitoring admission never routes to Kyverno.
config:
webhooks:
- failurePolicy: Fail
- failurePolicy: ${KYVERNO_WEBHOOK_FAILURE_POLICY}
namespaceSelector:
matchExpressions:
- key: kubernetes.io/metadata.name
operator: NotIn
values:
- kube-system
- flux-system
- kyverno
- longhorn-system
- monitoring
@@ -24,7 +24,7 @@ metadata:
homelab.keithjackson.dev/requirements: R-SEC-01
homelab.keithjackson.dev/scope: admission-only
spec:
validationFailureAction: Enforce
validationFailureAction: ${KYVERNO_VALIDATION_ACTION}
background: false
rules:
- name: secrets-must-be-flux-managed
@@ -25,7 +25,7 @@ metadata:
Pods in application namespaces must declare
homelab.keithjackson.dev/auth-mode = oidc | forward-auth | native | none.
spec:
validationFailureAction: Enforce
validationFailureAction: ${KYVERNO_VALIDATION_ACTION}
background: true
rules:
- name: require-auth-mode
@@ -25,7 +25,7 @@ metadata:
Pods in application namespaces must declare
homelab.keithjackson.dev/egress-class = internet | vpn.
spec:
validationFailureAction: Enforce
validationFailureAction: ${KYVERNO_VALIDATION_ACTION}
background: true
rules:
- name: require-egress-class
@@ -24,7 +24,7 @@ metadata:
Application-namespace pods must not use hostNetwork/hostPID/hostIPC (which
bypass default-deny) or run privileged containers.
spec:
validationFailureAction: Enforce
validationFailureAction: ${KYVERNO_VALIDATION_ACTION}
background: true
rules:
- name: disallow-host-namespaces
@@ -20,7 +20,7 @@ metadata:
to include both Ingress and Egress. Rejects a baseline that silently leaves
a direction open.
spec:
validationFailureAction: Enforce
validationFailureAction: ${KYVERNO_VALIDATION_ACTION}
background: true
rules:
- name: baseline-must-deny-both-directions