feat(labels): adopt Kubernetes recommended labels for all CNPG resources by JefeDavis · Pull Request #8087 · cloudnative-pg/cloudnative-pg

jsilvela

@dosubot dosubot bot added size:L

This PR changes 100-499 lines, ignoring generated files.

and removed size:M

This PR changes 30-99 lines, ignoring generated files.

labels

Jul 27, 2025

jsilvela

Signed-off-by: Jeff Davis <mr.jefedavis@gmail.com>
Signed-off-by: Jeff Davis <mr.jefedavis@gmail.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Co-authored-by: Jaime Silvela <jaime.silvela@mailfence.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@gmail.com>
Co-authored-by: Jaime Silvela <jaime.silvela@mailfence.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@gmail.com>
Co-authored-by: Jaime Silvela <jaime.silvela@mailfence.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@gmail.com>
Co-authored-by: Christian Rolland <c.rolland@protonmail.com>
Signed-off-by: Jeff Davis <mr.jefedavis@gmail.com>
Signed-off-by: Jeff Davis <mr.jefedavis@gmail.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
…ccount

Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
…sion"

This reverts commit 2b9fae5.

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>

@mnencia

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>

Samyak2605 pushed a commit to Samyak2605/cloudnative-pg that referenced this pull request

Nov 6, 2025
…ces (cloudnative-pg#8087)

This commit adds the recommended Kubernetes labels to all resources
generated by the operator for a cluster. This improves discoverability
and allows users to reliably target CNPG-managed resources with
`matchLabels` selectors in policy engines, service meshes, and other
Kubernetes-native tooling.

The following labels are now applied:

- `app.kubernetes.io/name`: postgresql
- `app.kubernetes.io/instance`: <cluster-name>
- `app.kubernetes.io/version`: <postgres-major-version>
- `app.kubernetes.io/component`: database
- `app.kubernetes.io/managed-by`: cloudnative-pg

This change follows the best practices outlined in the official
Kubernetes and Helm documentation, ensuring the labels are intuitive
and consistent with the broader ecosystem.

Closes: cloudnative-pg#8066