zalando / postgres-operator

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

Question: Why is it impossible to override external-dns.alpha.kubernetes.io/hostname on cluster-level? #2591

Open Kaonael opened 6 months ago

Kaonael commented 6 months ago

Hi. I want to use external-dns integration, but unfortunately master_dns_name_format is not suitable for me. I searched the documentation and found the line:

external-dns.alpha.kubernetes.io/hostname with the value defined by the operator configs master_dns_name_format and replica_dns_name_format. This value can't be overwritten. If any changing in its value is needed, it MUST be done changing the DNS format operator config parameters

Why can't overriding be done at masterServiceAnnotations/replicaServiceAnnotations level?

FxKu commented 5 months ago

That is actually an interesting idea - being able to override with service annotations. Can you come up with a PR? The annotations are set first when service resource is generated and then hostname is added. Maybe an containment check is all that's needed to prevent setting/overriding the hostname. WDYT?

jpuskar commented 5 days ago

Why is it important to prevent overriding the hostname? For me it would be preferable to configure this per-cluster.