CrunchyData / postgres-operator

Production PostgreSQL for Kubernetes, from high availability Postgres clusters to full-scale database-as-a-service.
https://access.crunchydata.com/documentation/postgres-operator/v5/
Apache License 2.0
3.93k stars 591 forks source link

feature request: add support for custom tags and local configs #3941

Open dberardo-com opened 4 months ago

dberardo-com commented 4 months ago

https://github.com/CrunchyData/postgres-operator/blob/c7a885d862fa7e3c43e802c623dad4c4e9991e5c/internal/patroni/config.go#L515

is there any way to add custom local configuration in patroni ?

this would include most importantly tags.

could it be a workaround to remove the ownerREference from the configmap generated by the operator and manually edit the configs ? this might cause an error in the operator itself when it tries to create a configmap finding one with the same name already, but might this work ?

benjaminjb commented 4 months ago

Hi @dberardo-com , I am double-checking, but I don't believe there's currently a way to update patroni tags. And I don't believe removing the ownerReference would work because the operator will find the CM with the name/labels that it expects and set the missing fields.

Let me dig in a bit here and get back to you.

benjaminjb commented 4 months ago

Oh, and also, for my notes, what functionality are you trying to achieve? What tags would you want to apply?

benjaminjb commented 4 months ago

Hey @dberardo-com, just circling back to this to let you know that we don't have a way to handle per-instance tags, but have a ticket for just that in the backlog; and I've added to that a comment re: cluster-wide tags.

dberardo-com commented 4 months ago

thanks for the catch up. at the moment i am trying to use the nofailover and failover_priority tags, since i have nodes in the cluster that have not the same hardware characteristics and thus require different handling. i believe that the failover_priority also requires one of the latest patroni versions, so i might have to update the operator CRD as well. If you could kindly confirm this information of mine, as I have never gone through a pgo CRD update and would like to avoid it if not necessary.

at the moment my current "workaround" is to pause the cluster (spec.paused: true) and apply the tags manually on the single configmap files ... quite a bad workaround i know :D

is the tags handling on your release roadmap for next CRD version? i believe that is a quite useful, perhaps still less-known feature of patroni.