Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multiple databases in PostgresUser CR #92

Open
toboshii opened this issue Jul 20, 2022 · 2 comments
Open

Allow multiple databases in PostgresUser CR #92

toboshii opened this issue Jul 20, 2022 · 2 comments

Comments

@toboshii
Copy link

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.

@michalschott
Copy link

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.

@TheAceMan
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants