Skip to content

feat(installer): derive a data center's vault from the primary's - #624

Open
NJona wants to merge 2 commits into
multi-dc-01-installer-primitivesfrom
multi-dc-02-datacenter-secrets
Open

feat(installer): derive a data center's vault from the primary's#624
NJona wants to merge 2 commits into
multi-dc-01-installer-primitivesfrom
multi-dc-02-datacenter-secrets

Conversation

@NJona

@NJona NJona commented Jul 31, 2026

Copy link
Copy Markdown
Member

A multi-data-center installation shares one PostgreSQL server, so the postgres roles, the token signing keys and everything that encrypts rows in the shared database have to be identical in every data center's vault. Everything tied to a single cluster — the ingress CA, the cephadm SSH key, the kubeconfig, the Ceph credentials the installer writes back — must not be.

DeriveDataCenterVault copies the primary data center's vault and drops exactly the second group, so running EnsureSecrets over the result regenerates those and leaves the shared ones untouched. ClearDataCenterScopedConfig resets the config fields written alongside a dropped secret, since the Ensure* functions are gated on the vault entry and would otherwise leave a stale value paired with a freshly generated key.

Review notes

  • The Ceph cluster credentials are matched by prefix (ceph, csi, rgw), because the closed-source installer owns those names and adds to them.
  • postgresPrimaryServerKeyPem / postgresReplicaServerKeyPem are deliberately kept: dropping them would push regeneratePostgresCerts into its regeneration branch and mint a server key the running postgres has never seen.
  • Pure and GCP-independent, which is where the test coverage sits. No caller yet.

Part of the oms beta bootstrap-gcp --multi-dc stack (10 PRs). Merge in order; each PR is based on its predecessor.

NJona and others added 2 commits July 31, 2026 14:53
A multi-data-center installation shares one PostgreSQL server, so the
postgres roles, the token signing keys and everything else that encrypts
rows in the shared database has to be identical in every data center's
vault. Everything tied to a single cluster — the ingress CA, the cephadm
SSH key, the kubeconfig, the Ceph credentials the installer writes back
— must not be.

DeriveDataCenterVault copies the primary data center's vault and drops
exactly the second group, so running EnsureSecrets over the result
regenerates those and leaves the shared ones untouched. The Ceph cluster
credentials are matched by prefix, because the closed-source installer
owns those names. ClearDataCenterScopedConfig resets the config fields
that are written alongside a dropped secret, since the Ensure* functions
are gated on the vault entry and would otherwise leave a stale value
paired with a freshly generated key.

No caller yet; this is the pure, GCP-independent part of multi-DC
support.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Jona Neef <Jona.Neef.97@gmail.com>
Signed-off-by: NJona <25478046+NJona@users.noreply.github.com>
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.

1 participant