Skip to content

[FEATURE] Bundled Postgres Deployment has no hook for pod-template labels #2748

Description

@jrhuerta

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions