Consolidate database related settings for gitlab-rails to use `gitlab_rails['databases']` and deprecate other top level `db_*` keys

In !5480 (merged), we are adding a new key named gitlab_rails['databases']. The main intent is to support specifying database related configuration for many databases to gitlab-rails.

In &6458 (closed), Geo is also looking to use the many databases feature of Rails, which means instead of a separate geo_database.yml file, all the Geo related settings will live under a geo key in the main database.yml file. This, along with the decomposition effort where main and ci keys are also being added to databases.yml will mean there are 3 databases to be supported at the rails side.

As of now, these three are controlled by three different settings

  1. gitlab_rails['db_*'] settings to control the main database.
  2. gitlab_rails['databases']['ci']['db_*'] settings to control the ci database. (Similar structure also works for main database, but we are not broadcasting that yet).
  3. geo_secondary['db_*'] settings to control Geo's tracking database in secondaries.

As part of &6458 (closed), we can think of deprecating every other way of setting database related configuration in favour of gitlab_rails['databases']['<database name>']['db_*']. While decomposition takes time to test and be proven at GitLab.com, if Geo adopts the many databases format, we have a better case to move database configuration to gitlab_rails['databases']['main']['db_*'] and gitlab_rails['databases']['geo']['db_*']. And when we do that, once more databases are decomposed, it is just a matter of adding them to the allowed databases list.

Edited by Balasankar 'Balu' C