Repository navigation
feature: a PgBouncer pooler for plugin databases, 100 connections kept for the panel, a Secret for plugin passwords, and nightly plugin database backups - #796
Merged
Conversation
…t for the panel, a Secret for plugin passwords, and nightly plugin database backups
…ase, never Hasura's
…ch the main backups; the pooler rolls on a config change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Panel side of the plugin databases work (api#1000, web#1232).
plugin-db-pooler(PgBouncer 1.26.1, CloudNativePG's image, pinned by digest) in transaction mode. Game servers will connect through it, so many servers share up to 100 real connections per database. Onlyplugin_*login roles can authenticate (SCRAM pass-through viaauth_query); every other user gets "no such user", so the api and Hasura keep connecting straight totimescaledb. The lookup function andpgbouncer_auth's CONNECT live in thepostgresmaintenance database; nothing touches Hasura's database.pgbouncer_authgets a fresh password on each pod start, kept in a memory volume, so there is no new secret to add to env files or Vault.hasurasuperuser the api and Hasura log in as, so plugins can never starve the panel. The database restarts once when this rolls out.plugin-databasesSecret, plusget/patch/updateon that one Secret for the api. It has no data on purpose: panel updates run client-sidekubectl apply, which only removes fields it applied before, so keys the api writes stay.plugin-databases-backupCronJob (03:30, after the main one) dumps everyplugin_*database on its own toplugin-databases/<name>/backup-<ts>.zip, keeping the newest 7 each, with owners kept so a restore hands the tables back to the plugin's role. It never touches the main backups. A retry skips any database that already has today's dump,pg_dumpwaits at most 300s for a lock, and the Job allows 2 retries and 2 hours. The main backup job is unchanged except that its pruning now counts only top-levelbackup-*.zip; before, it kept 7 keys across the whole bucket.pgbouncer.inicomes from a configMapGenerator, so a config change rolls the pooler.Checked locally: the backup script tests (21/21, 9 new), the startup probe, host port and image update tests, both overlays render, and the pooler in Docker against TimescaleDB pg18.