zalando / postgres-operator

Postgres operator creates and manages PostgreSQL clusters running in Kubernetes
https://postgres-operator.readthedocs.io/
MIT License
4.37k stars 980 forks source link

Orphan ClusterRole dployed #2752

Open zhangyue110026 opened 2 months ago

zhangyue110026 commented 2 months ago

We have noticed three instances of an orphan resource in some of your Kubernetes configuration files. Deploying Kubernetes resources that are not being actively used or referenced by any other resources in the cluster can lead to orphan resources. These orphan resources consume unnecessary resources and can potentially cause confusion or clutter within the cluster. Additionally, we provide anecdotal evidence from htopolvm-topolvm#484 regarding the orphan resource defect.

What happened:

cluster role postgres-pod does not have any role binding: https://github.com/zalando/postgres-operator/blob/e71891e2bd704084e9d0bcfee864b61cec0cf20b/manifests/operator-service-account-rbac.yaml#L249

https://github.com/zalando/postgres-operator/blob/e71891e2bd704084e9d0bcfee864b61cec0cf20b/manifests/operator-service-account-rbac-openshift.yaml#L241

https://github.com/zalando/postgres-operator/blob/2e398120d2d0b3bb2b8bb239c6d49011ebe37e88/charts/postgres-operator/templates/clusterrole-postgres-pod.yaml#L5

What you expected to happen:

cluster role postgres-pod should have a role binding, otherwise it is a orphan resource. Or delete postgres-pod to avoid deploy orphan resource.

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

Some general remarks when posting a bug report:

FxKu commented 2 months ago

It’s not an orphaned role. Patroni uses it and it’s referenced in the operator configuration. Not easy to spot admittedly.