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

Mysql can't be in a different namespace than the user/db #418

Open
halkeye opened this issue Dec 31, 2024 · 5 comments
Open

Mysql can't be in a different namespace than the user/db #418

halkeye opened this issue Dec 31, 2024 · 5 comments

Comments

@halkeye
Copy link

halkeye commented Dec 31, 2024

Use Case

  1. Have mysql setup in a single namespace (ext-mysql-operator)
  2. Have new application in new namespace (new-app)
  3. Have MySQLDB in app namespace (new-app)
  4. Have mysqluser in app namespace (new-app)

This is to avoid the hostname/password being in each namespace and potentially getting out of sync.

@halkeye
Copy link
Author

halkeye commented Dec 31, 2024

ideas

  1. mysqlDB.Spec.MysqlNamespace
  • Have an optional spec field that lets you specify namespace of mysql
  1. allow namespace to be specified with /, so
    mysqlDB.Spec.MysqlName = "server" == $namespace/server
    while
    mysqlDB.Spec.MysqlName = "operator/server" == "operator/server" type thing
  2. globally search for it across all namespaces if not found
  3. Allow hostname/port to be fetched from secret too

@halkeye
Copy link
Author

halkeye commented Dec 31, 2024

ah, reading the code, the resultant secret doesn't have hostname/port anyways, so i'd have to share it everywhere :(

@nakamasato
Copy link
Owner

nakamasato commented Jan 14, 2025

ah, reading the code, the resultant secret doesn't have hostname/port anyways, so i'd have to share it everywhere :(

Do you expect to have db_url in the secret?

@halkeye
Copy link
Author

halkeye commented Jan 14, 2025

I think so? I've been using https://github.com/movetokube/postgres-operator/ which when you create a postgresuser item, it creates a user and a secret for you. I liked it because my superuser credentials were only in the operator namespace.

@nakamasato
Copy link
Owner

Let me check it. Thanks.

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

2 participants