Skip to content

Allow multiple databases in PostgresUser CR #92

Closed
@toboshii

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.

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