The bundled Postgres resource (templates/postgresql.yaml, gated by database.postgres.bundled.enabled) has no values hook for its pod template's labels — spec.template.metadata.labels is hardcoded to kagent.selectorLabels + app.kubernetes.io/component: database, with nothing merging in .Values.podLabels (unlike the controller and UI Deployments, which do — see controller-deployment.yaml/ui-deployment.yaml, both merge .Values.podLabels + a per-component podLabels into their pod template).
This means any cluster with an admission policy requiring specific labels on all Pods (e.g. OPA Gatekeeper's required-labels constraint, commonly expanded from Deployments onto their generated Pods) can install every other kagent-created resource, but never the bundled Postgres Deployment — there's no values-driven way to satisfy it.
Concretely, I hit this trying to install kagent (with bundled Postgres) in a cluster enforcing exactly this kind of policy: controller/ui install fine once I set podLabels, but kagent-postgresql's Deployment is permanently rejected.
Suggested fix: same pattern the controller/UI deployments already use — merge .Values.podLabels (and maybe a database.postgres.bundled.podLabels override) into the bundled Postgres pod template's labels in templates/postgresql.yaml.
Workaround in the meantime: a Helm post-renderer patching just this one Deployment's pod template labels after helm template.
The bundled Postgres resource (
templates/postgresql.yaml, gated bydatabase.postgres.bundled.enabled) has no values hook for its pod template's labels —spec.template.metadata.labelsis hardcoded tokagent.selectorLabels+app.kubernetes.io/component: database, with nothing merging in.Values.podLabels(unlike the controller and UI Deployments, which do — seecontroller-deployment.yaml/ui-deployment.yaml, both merge.Values.podLabels+ a per-componentpodLabelsinto their pod template).This means any cluster with an admission policy requiring specific labels on all Pods (e.g. OPA Gatekeeper's
required-labelsconstraint, commonlyexpanded from Deployments onto their generated Pods) can install every other kagent-created resource, but never the bundled Postgres Deployment — there's no values-driven way to satisfy it.Concretely, I hit this trying to install kagent (with bundled Postgres) in a cluster enforcing exactly this kind of policy:
controller/uiinstall fine once I setpodLabels, butkagent-postgresql's Deployment is permanently rejected.Suggested fix: same pattern the controller/UI deployments already use — merge
.Values.podLabels(and maybe adatabase.postgres.bundled.podLabelsoverride) into the bundled Postgres pod template's labels intemplates/postgresql.yaml.Workaround in the meantime: a Helm post-renderer patching just this one Deployment's pod template labels after
helm template.