zalando / postgres-operator

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

imagepullsecrets for postgres clusters in other namespaces than the operator #2690

Open olivier-derom opened 2 months ago

olivier-derom commented 2 months ago

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

Some general remarks when posting a bug report:

We are pulling all docker images through our own registry, which requires imagepullsecrets. I was able to successfully do this by creating a ServiceAccount with the needed imagepullsecrets and referencing it in the helm values under podServiceAccount.name. However, this only works as long as you create postgres-clusters in the same namespace as your operator. When creating a cluster in a different namespace, it is not able to retrieve the correct imagepullsecrets.

It would make things a lot easier if we had the possibility to provide imagepullsecrets in the postgres-cluster manifest instead, which will then be used in all the relevant pods.

Our idea was: Have one general postgres-operator in its own postgres-operator namespace. Have clusters related to a project in the projects namespace (so that the application can directly access the cluster's secrets to get login creds to the database, as secrets cannot be accessed across namespaces)

If anyone has a workaround, this is welcome as well. Let me know what you think. Thanks!

teimyBr commented 1 month ago

https://github.com/zalando/postgres-operator/issues/2721

See this issue we are using pg operator and also different pg in different ns