Files
Myasnikov Daniil d3e36778d1 fix(installer): host cozy-system labeler hook in kube-system
Re-introduces the pre-install/pre-upgrade Job hook (cozy-system-labeler)
that was added by 3a87485c/4754f57f and dropped by be0a6687, but moves
it into kube-system to dodge the PSA admission denial that broke the
in-namespace approach:

    pods "cozy-system-labeler-..." is forbidden: violates PodSecurity
    "baseline:latest": host namespaces (hostNetwork=true)

The operator pod needs hostNetwork=true (no CNI yet at install time),
which violates PodSecurity baseline. cozy-system therefore needs
enforce=privileged before the operator pod can be admitted. A labeler
pod inside cozy-system would itself need hostNetwork=true and hit the
same admission denial — Job admission denial means no pod is ever
created, .status.failed never increments and backoffLimit never trips,
helm waits for Complete=True until its budget elapses.

`kube-system` is PSA-exempt on Talos (defaults.exemptions.namespaces in
the apiserver PodSecurityConfiguration) and unlabeled on vanilla
kubeadm/kind/k3s, so hostNetwork pods are admitted there. The hook's
ServiceAccount is bound to a ClusterRole scoped via
`resourceNames: ["cozy-system"]` to the one target namespace, keeping
the cluster permission grant minimal.

Also revert the e2e bats workaround (ddc429c8) that pre-applied
cozy-system manually before helm install: the labeler hook handles
the labels in-chart now, so the bats can go back to plain
`helm upgrade --install --namespace cozy-system --create-namespace ...`.

Mirrors the corresponding fix on PR #2508
(fix/installer-namespace-bootstrap) so the two branches converge on
the same resolution.

Verified end-to-end in CI on this branch: cold install passes admission,
operator pod comes up, all downstream E2E tests pass.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-05-02 17:49:36 +05:00
..
2026-04-22 07:28:09 +00:00
2026-03-20 15:51:59 +01:00
2026-04-22 07:28:09 +00:00