postgres-operator icon indicating copy to clipboard operation
postgres-operator copied to clipboard

Postgres Operator setup for Kubernetes cluster

Open fabianem opened this issue 9 months ago • 2 comments

  • Which image of the operator are you using? e.g. ghcr.io/zalando/postgres-operator:v1.12.2
  • Where do you run it - cloud or metal? Kubernetes or OpenShift? K8s
  • Are you running Postgres Operator in production? yes
  • Type of issue? question

Hi,

We are using the Postgres Operator in a setup where we have a lot of different users on a Kubernetes cluster with some isolation level applied. This means each user might have multiple Postgres instances running in one or multiple namespaces.

Now my question is, what is the best approach for deploying the Postgres Operator in such a case:

  1. Should every Postgres instance have its own Operator running (could be multiple Operators in one namespace)
  2. Install a cluster-wide Postgres Operator to manage all Postgres instances across all namespaces
  3. Create one Operator per each namespace (so max one Operator in a namespace but possibly multiple Postgres instances)

fabianem avatar Feb 17 '25 19:02 fabianem

I think a cluster wide Postgres Operator is good to go if all instances can share common operator-level configurations (e.g., backups, connection pooling, etc.). This will be easy to manage. Otherwise you will have to manage RBAC for each operator if not doing cluster-wide

KavyaBhalodia avatar Mar 01 '25 09:03 KavyaBhalodia

First of all, thanks for your answer. I would like to clarify our use case a little bit more. We are building a multi-tenant platform, where every tenant can provision postgresql based on their needs. Tenant's deployments are separated on kubernetes namespace level, multiple tenants in the same cluster. In some cases, tenants might require additional security measures to be enforced (rbac security, network policies, etc). Are there any risks with having the operator deployed cluster-wide for a multi-tenant use case? Would it make sense to deploy the operator per tenant/namespace rather than to do it cluster-wide?

fabianem avatar Mar 04 '25 11:03 fabianem