cloudnative-pg / charts

CloudNativePG Helm Charts
Apache License 2.0
138 stars 62 forks source link

cluster.annotations does not annotate pods #235

Closed ghost closed 3 months ago

ghost commented 3 months ago

Add annotations to cluster like this :

cluster:
  annotations:
    exampleannotation: "exampleannotation"
  enableSuperuserAccess: true
  initdb:
    database: "my_app_db"
    owner: "coucou"
    secret:
      name: "pg-app-user"
  superuserSecret: 'pg-superuser'
type: postgresql

No annotations are added to our cluster pods,

Is it the expected behavior? If yes how do we add annotations to our pods?

Thanks a lot in advance,

F.N.

itay-grudev commented 3 months ago

This is a limitation of the operator.

See: https://cloudnative-pg.io/documentation/current/labels_annotations/

By default, no label or annotation defined in the cluster's metadata is inherited by the associated resources. To enable label/annotation inheritance, follow the instructions provided in Operator configuration.

Current Limitations Currently, CloudNativePG doesn't automatically propagate labels or annotations deletions. Therefore, when an annotation or label is removed from a cluster that was previously propagated to the underlying pods, the operator doesn't remove it on the associated resources.

ghost commented 3 months ago

Thanks a lot for your answer @itay-grudev :)