Skip to content

inherited_labels are not propagated to the PersistentVolumeClaim #1783

@dmvolod

Description

@dmvolod

Please, answer some short questions which should help us to understand your problem / question better?

  • Which image of the operator are you using? registry.opensource.zalan.do/acid/postgres-operator:v1.7.1
  • Where do you run it - cloud or metal? Kubernetes or OpenShift? [Kind K8s]
  • Are you running Postgres Operator in production? [no]
  • Type of issue? [feature request or probably bug(missing functionality)]

inherited_labels configured inside the OperatorConfiguration or ConfigMap are not propagated to the PersistentVolumeClaim level and it's not possible to easy identify PVC/PV related to the provided labels. Also some common cluster labels are also need to be propagated (team label missing). It's possible to list by labels from the related objects, i.e. Pods, but would be better to have a direct labels here.

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    pv.kubernetes.io/bind-completed: "yes"
    pv.kubernetes.io/bound-by-controller: "yes"
    volume.alpha.kubernetes.io/storage-class: default
    volume.beta.kubernetes.io/storage-provisioner: rancher.io/local-path
    volume.kubernetes.io/selected-node: kind-control-plane
  creationTimestamp: "2022-02-16T15:17:23Z"
  finalizers:
  - kubernetes.io/pvc-protection
  labels:
    application: spilo
    cluster-name: osc-customer-postgresql-sample
  name: pgdata-osc-customer-postgresql-sample-0
  namespace: default
  resourceVersion: "257612"
  uid: 36b26f34-0775-4d2d-9e51-1b4eb77257b4
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
  storageClassName: standard
  volumeMode: Filesystem
  volumeName: pvc-36b26f34-0775-4d2d-9e51-1b4eb77257b4
status:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 1Gi
  phase: Bound

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions