zalando / postgres-operator

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

replicaCount not being respect #2707

Open zyue110026 opened 3 months ago

zyue110026 commented 3 months ago

We have noticed an instance of incorrect helming in one of your Kubernetes configuration files. Hardcoded or default configuration values in the template are considered anti-pattern and configurable values in the values.yaml file are not being respect, resulting in user-provided configurations never being applied. Additionally, we provide anecdotal evidence from trivy-operator#729 regarding the incorrect helming defect.

replicaCount does not take effect when changed to a value other than 1. This issue arises due to replicaCount value is hardcoded in deployment.yaml file:

https://github.com/zalando/postgres-operator/blob/73f72414f65690fe38d6892559f085e9e1f3f33d/charts/postgres-operator-ui/templates/deployment.yaml#L12

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

ghcr.io/zalando/postgres-operator:v1.12.2

FxKu commented 3 months ago

I wonder why this is even configurable? What do we gain by setting the replica count bigger than 1? Availability? It's a simple front end application, after all.

zyue110026 commented 3 months ago

@FxKu It is because you have a https://github.com/zalando/postgres-operator/blob/ce15d10aa32899e3cd5b0a430991b7ac5a31c8cb/charts/postgres-operator-ui/values.yaml#L5 in your values.yaml file, which should be considered a configurable value for the availability purpose, if you think configure the replica count number is meaningless, why you add this value in values.yaml file.

FxKu commented 3 months ago

The helm charts were for the most part provided by people from the OS community. There might inconsistencies here an there. At Zalando we don't use them so we don't care too much about them.

zyue110026 commented 3 months ago

@FxKu I see, but I still want to collect the practitioners' perceptions of the incorrect helming defect for our research purpose. Do you think it is a bug and will you fix it if you are using that helm chart?