Automate db creation for praefect on release-environments
What
As part of #19968 (closed), we create a praefect deployment. Unfortunately, there's a manual step that needs to be done: https://docs.gitlab.com/charts/charts/gitlab/praefect/#creating-the-database. This issue is to automate this step.
Why
The helm installation of praefect, will get stuck until the database gets created, thus, the deployment might fail due to timing issue.
How
There are multiple options we can do
- on the PostgreSQL init container we can use
initContainerto create the database/fetch the secret from*-praefect-dbsecretand use it- this might be tricky though, as the praefect should have been deployed and its secrets are ready.
- As suggested by Graeme, the best option is a custom K8s job with the secrets mounted on it that can run the commands against Postgres.
Edited by Ahmad Tolba