Skip to content

Commit

Permalink
charms: Update (qa)staging DB user management process
Browse files Browse the repository at this point in the history
We've switched to new (qa)staging databases that are entirely controlled
by developers.  The procedure still needs some tidying up, but this
should work for now.
  • Loading branch information
cjwatson authored and jugmac00 committed Nov 28, 2023
1 parent 6da635f commit 01aad8d
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions explanation/charms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ to provide charms with database credentials rather than relating them to
complications when the database is deployed in a different region from some
of our applications). As a result, we need to do some manual user
management in these environments. On staging and qastaging, developers can
do most of this themselves when adding new charms to those existing
deployment environments.
do this themselves when adding new charms to those existing deployment
environments.

Taking the librarian as an example: ``charm/launchpad-librarian/layer.yaml``
lists the ``binaryfile-expire``, ``librarian``, ``librarianfeedswift``, and
Expand Down Expand Up @@ -244,24 +244,25 @@ like this, again replacing ``<secret>`` with the generated password:
.. code-block:: yaml
launchpad_qastaging_librarian:
master: "postgresql://juju_launchpad-librarian:<secret>@pamola.internal:6432/launchpad_qastaging?connect_timeout=10"
master: "postgresql://juju_launchpad-librarian:<secret>@database-ps5-1.qastaging.lp.internal:6432/launchpad_qastaging?connect_timeout=10"
standbys: []
In the connection string URL, the database host, port, and name (in this
case, ``pamola.internal``, ``6432``, and ``launchpad_qastaging``
respectively) should match those of other entries in ``db_connections``.
case, ``database-ps5-1.qastaging.lp.internal``, ``6432``, and
``launchpad_qastaging`` respectively) should match those of other entries in
``db_connections``.

The configuration for the ``pgbouncer`` connection pooler must also be
updated to match, which currently requires help from IS. On
``pamola.internal``, IS should take the relevant username/password pair from
the ``deploy-secrets`` file above and add it to
``/etc/pgbouncer/userlist.txt``.
updated to match. For now, take the relevant username/password pair from
the ``deploy-secrets`` file above; then, on each of the ``postgresql`` units
in ``[email protected]``, add this pair to
``/etc/pgbouncer/userlist.txt`` and run ``sudo systemctl reload
pgbouncer.service``. In the near future this will be turned into a Mojo
spec.

Staging works similarly with the obvious substitutions of ``staging`` for
``qastaging``. The qastaging and staging environments currently share a
``pgbouncer``; as a result, while the user still has to be created on both
database clusters, the passwords for a given user on qastaging and staging
must be identical.
``qastaging``, and using
``[email protected]``.

Production works similarly, except that IS needs to generate the user on the
production database, add it to the production ``pgbouncer`` by editing
Expand Down

0 comments on commit 01aad8d

Please sign in to comment.