Skip to content

Allow multiple databases in PostgresUser CR #92

Closed

Description

@toboshii

First off, loving many things about this operator but one issue I ran into trying to migrate some things to it is that I have a few third party apps I run in my cluster that are designed in a way in which they need multiple Postgres databases (not schemas, completely separate databases) but only allow for a single hostname, username, password config. Afaict there's no way for ext-postgres-operator to handle this currently.

Ideally I'd like to be able to do something like this:

---
apiVersion: db.movetokube.com/v1alpha1
kind: Postgres
metadata:
  name: radarr-config-db
  namespace: media
spec:
  database: radarr-config
---
apiVersion: db.movetokube.com/v1alpha1
kind: Postgres
metadata:
  name: radarr-log-db
  namespace: media
spec:
  database: radarr-log
---
apiVersion: db.movetokube.com/v1alpha1
kind: PostgresUser
metadata:
  name: radarr-user
  namespace: media
spec:
  role: radarr
  databases:
    - name: radarr-config-db
      privileges: OWNER
    - name: radarr-log-db
      privileges: OWNER
  secretName: database
---

and would expect the database-radarr-user secret created to contain a role the has the referenced privileges on both referenced databases.

Activity

  1. michalschott commented on Aug 15, 2022

    @michalschott

    On top of that, I'd even say it would be handy to have some sort of PostgresqlClass to run multiple instances of this operator in single cluster to handle multiple lets say RDS clusters.

  2. TheAceMan commented on Jul 7, 2023

    @TheAceMan

    This would require changes to the secret that is created. For backward compatibility if there is just one database secret naming could remain the same. But if there are multiple databases then the secret would contain the database name in the secret name.

  3. locked and limited conversation to collaborators on May 12, 2025
  4. converted this issue into a discussion #201 on May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions