fix(kyverno): set explicit replicas=1 for all controllers (EAI-6864)#743
fix(kyverno): set explicit replicas=1 for all controllers (EAI-6864)#743silokimmo wants to merge 1 commit into
Conversation
The upstream Helm chart uses replicas: ~ (YAML null) as the default for all four Kyverno controllers. The chart's null-replica guard in _deployment.tpl only checks kindIs "invalid", which null passes — causing Kubernetes to coerce the empty rendered value to 0 replicas. This silently breaks the admission controller webhook, meaning generate policies (e.g. dynamic-pvc-creation) never fire, leaving workspace pods stuck in Pending due to missing PVCs. Set replicas: 1 explicitly for admissionController, backgroundController, cleanupController, and reportsController so all cluster-forge installs get a working Kyverno from day one. Clusters needing HA can override via their cluster-values. Upstream bug: kyverno/kyverno#8941, #6182 Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
E2E Test Results ✅Tested on ephemeral OCI VM (Ubuntu 24.04) using cluster-bloom v2.1.0. Test setup:
Kyverno deployment results — all 4 controllers 1/1 Running:
Fix verified. Setting |
dynamic-pvc-creation ClusterPolicy Test Results ✅Tested admission controller policy on the same ephemeral VM (cluster-bloom v2.1.0 + this branch via ArgoCD). Policy:
Required annotations confirmed:
Policy report showed Admission controller is working correctly. |
Summary
sources/kyverno/3.5.1/values.yamlhadreplicas: ~(YAML null) for all four Kyverno controllers_deployment.tpluseskindIs "invalid"which null passes — rendering empty string → Kubernetes coerces to 0 replicasdynamic-pvc-creationfor workspace PVCs) never firekyverno-admission-controllerhad 0 desired replicas since cluster installation (2026-02-06)Syncedbecause live 0 replicas matched what the chart rendered — selfHeal never corrected itFix: Set
replicas: 1explicitly for all four controllers (admissionController,backgroundController,cleanupController,reportsController). Clusters needing HA can override via theircluster-values.Upstream bug: kyverno/kyverno#8941, #6182
Jira: EAI-6864
Immediate workaround already applied: cluster-values override on app-dev sets
admissionController.replicas: 1— that override can be removed once this PR is deployed to app-dev.Test plan
kyverno-admission-controllerdeploys with 1 replica on a fresh cluster installdynamic-pvc-creationClusterPolicy fires on workspace deployment (PVC created, pod reaches Running)🤖 Generated with Claude Code