[Bug]: Inherited labels not inherited by ca, replication, and server secrets
Author: NoamNakashCreated Sep 27, 2026Updated Sep 28, 2026
Labelsbug :bug:triage
Is there an existing issue already for this bug?
- I have searched for an existing issue, and could not find anything. I believe this is a new bug.
I have read the troubleshooting guide
- I have read the troubleshooting guide and I think this is a new bug.
I am running a supported version of CloudNativePG
- I have read the troubleshooting guide and I think this is a new bug.
Contact Details
Version
1.30.0
What version of Kubernetes are you using?
1.35
What is your Kubernetes environment?
Self-managed: kind (evaluation)
How did you install the operator?
YAML manifest
What happened?
I enabled inherited labels using the following configmap
apiVersion: v1
kind: ConfigMap
metadata:
name: cnpg-controller-manager-config
namespace: cnpg-system
data:
ENABLE_INSTANCE_MANAGER_INPLACE_UPDATES: "true"
INHERITED_LABELS: "my.project/*"I then restarted the operator by deleting it's pod in the cnpg-system namespace
kubectl delete pod -n cnpg-system cnpg-controller-manager-695fcbbb85-ls2wxI then created a cluster using the following configuration:
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: cluster-example
labels:
my.project/banana: pi
spec:
instances: 3
storage:
size: 1Giafter fetching the pods, services, secrets I saw the label was inherited
apiVersion: v1
kind: Pod
metadata:
...
labels:
app.kubernetes.io/component: database
app.kubernetes.io/instance: cluster-example
app.kubernetes.io/managed-by: cloudnative-pg
app.kubernetes.io/name: postgresql
app.kubernetes.io/version: "18"
cnpg.io/cluster: cluster-example
cnpg.io/instanceName: cluster-example-1
cnpg.io/instanceRole: primary
cnpg.io/podRole: instance
**my.project/banana: pi**
role: primary
name: cluster-example-1
namespace: default
...
spec:
...
status:
...I then checked the secrets and noticed 3/4 secrets were missing the label
apiVersion: v1
items:
- apiVersion: v1
data:
...
user: YXBw
username: YXBw
kind: Secret
metadata:
annotations:
cnpg.io/operatorVersion: 1.30.0
creationTimestamp: "2026-09-27T12:46:25Z"
labels:
app.kubernetes.io/managed-by: cloudnative-pg
cnpg.io/cluster: cluster-example
cnpg.io/reload: "true"
cnpg.io/userType: app
my.project/banana: pi
name: cluster-example-app
namespace: default
ownerReferences:
- apiVersion: postgresql.cnpg.io/v1
controller: true
kind: Cluster
name: cluster-example
uid: 458715f2-baec-4dcf-8a18-5c52b77e967f
resourceVersion: "655121"
uid: 4a40f215-7542-4af8-9206-ed2a1805197e
type: kubernetes.io/basic-auth
- apiVersion: v1
data:
ca.crt: ...
ca.key: ...
kind: Secret
metadata:
creationTimestamp: "2026-09-27T12:46:25Z"
labels:
app.kubernetes.io/managed-by: cloudnative-pg
name: cluster-example-ca
namespace: default
ownerReferences:
- apiVersion: postgresql.cnpg.io/v1
controller: true
kind: Cluster
name: cluster-example
uid: 458715f2-baec-4dcf-8a18-5c52b77e967f
resourceVersion: "655118"
uid: 6b0ef63a-1ae2-4855-adf3-4d7bb877d364
type: Opaque
- apiVersion: v1
data:
tls.crt: ...
tls.key: ...
metadata:
creationTimestamp: "2026-09-27T12:46:25Z"
labels:
app.kubernetes.io/managed-by: cloudnative-pg
name: cluster-example-replication
namespace: default
ownerReferences:
- apiVersion: postgresql.cnpg.io/v1
controller: true
kind: Cluster
name: cluster-example
uid: 458715f2-baec-4dcf-8a18-5c52b77e967f
resourceVersion: "655120"
uid: a15d403d-ac6f-4b00-b01a-65b5b4a59810
type: kubernetes.io/tls
- apiVersion: v1
data:
tls.crt:
...
kind: Secret
metadata:
creationTimestamp: "2026-09-27T12:46:25Z"
labels:
app.kubernetes.io/managed-by: cloudnative-pg
name: cluster-example-server
namespace: default
ownerReferences:
- apiVersion: postgresql.cnpg.io/v1
controller: true
kind: Cluster
name: cluster-example
uid: 458715f2-baec-4dcf-8a18-5c52b77e967f
resourceVersion: "655119"
uid: 063487bc-5a34-4f5f-887d-ecc4bb42c480
type: kubernetes.io/tls
kind: List
metadata:
resourceVersion: ""Cluster resource
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: cluster-example
labels:
my.project/banana: pi
spec:
instances: 3
storage:
size: 1GiRelevant log output
Code of Conduct
- I agree to follow this project's Code of Conduct
Source: cloudnative-pg/cloudnative-pg