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

chore: support read-only api-db connections #122

Closed
wants to merge 1 commit into from

Conversation

tobybellwood
Copy link
Member

@tobybellwood tobybellwood commented May 16, 2024

It would be preferable to support read-only access to the api-db.

This can occur two ways (in the future anyway):

  • via a manually created read-only user - adding the API_DB_RO_USERNAME and API_DB_RO_PASSWORD variables to the deployment as additionalEnvs
  • via a read-replica (more common in cloud installs) - by adding the API_DB_RO_ADDRESS variable to the deployment as additionalEnvs

Kong will resolve the vars in the declared order, so if there is no _RO_ it will use the version in the chart

For clarity, I created an additional variable(s) to avoid reusing the API_DB_PASSWORD variable - as it is a write password in other services that need write access.

MariaDB [infrastructure]> CREATE USER 'readonly'@'%' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.003 sec)

MariaDB [infrastructure]> GRANT SELECT, SHOW VIEW ON infrastructure.* TO 'readonly'@'%';
Query OK, 0 rows affected (0.003 sec)

@smlx
Copy link
Member

smlx commented Jun 7, 2024

As discussed on slack maybe we can put this logic in the helm chart. 🙂

@smlx smlx closed this Jun 7, 2024
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

Successfully merging this pull request may close these issues.

2 participants