Closed
Description
We are missing a way for an application to consume the database created by the MySQL schema operator. It saves the URL of the database into the status of the schema custom resource, but that doesn't contain the user and password to access the schema and it would require the application to access the Kubernetes API to read it. Another issue is that the only user we have is the one the operator is using, which has to have admin privileges.
Proposed solution
- When creating the schema the operator should also create a new user with a random name and password.
- Save the URL, username, and password into a Secret, which the application can mount as a volume or environment variables. It has to have a predictable name otherwise, the application can't reference it.
- When deleting the schema, delete the user from MySQL and the Secret from the cluster.