Skip to content

tribelt and estate-dashboard sign in to Postgres with rotating credentials #448

Closed

Description

@ExtraToast

Parent

#444

What to build

tribelt and the estate dashboard sign in to Postgres with rotating credentials. Both declare credentials: on their edge to platform-postgres and read the credential as environment. Their fixed logins and cluster.sh's two database stages are removed.

Acceptance criteria

  • Both Processes connect with credentials Vault issued, and survive a credential rotation.
  • The tribelt and estate-dashboard logins are dropped, and so are their documents under secret/<project>-system/database.
  • cluster.sh has no database stage.

Blocked by

Activity

  1. added
    type: featureNew user-facing or operator-facing capability.
    area: deployhomelab-deploy, deploy-v2, manifests, and rollout flow.
    status: ready-for-agentFully specified; an agent may take it with nobody watching.
    on Oct 15, 2026
  2. added and removed
    status: ready-for-agentFully specified; an agent may take it with nobody watching.
    on Oct 16, 2026
  3. ExtraToast commented on Oct 16, 2026

    @ExtraToast
    ContributorAuthor

    Status 2026-10-16: tribelt 0.10.0 and estate-dashboard 0.5.0 sign in to Postgres with logins Vault issues from tribelt-owner and estate-dashboard-owner (pg_stat_activity shows only v-kubernet-… users on both databases). Each lease is 3600 s and renewable; the role's max_ttl is 24 h, after which VSO issues a new login and restarts the Process.

    Left, once each app has come through its first rotation (by 2026-10-17 about 14:30 UTC):

    • Drop the Postgres logins tribelt and estate-dashboard, reassigning anything they still own to the owner role first. estate-dashboard is the role the catalog adopted the database from, so it is a member of estate-dashboard-owner.
    • Delete secret/tribelt-system/database and secret/estate-dashboard-system/database.
    • Remove bootstrap/cluster.sh stages 8 and 9 in JorisJonkers-dev/estate.

    The rollout tripped #466: removing the old grant pruned the Secret the old primary still read, and both canaries failed until the primaries were rolled back by hand and the canaries re-run.

  4. added
    status: ready-for-agentFully specified; an agent may take it with nobody watching.
    and removed
    status: ready-for-agentFully specified; an agent may take it with nobody watching.
    on Oct 20, 2026
  5. added
    status: ready-for-agentFully specified; an agent may take it with nobody watching.
    and removed on Oct 21, 2026
  6. ExtraToast commented on Oct 21, 2026

    @ExtraToast
    ContributorAuthor

    The logins tribelt and estate-dashboard are dropped, their documents under secret/<project>-system/database are deleted, and JorisJonkers-dev/estate#179 removes cluster.sh's two database stages. Both apps connect only as v-kubernet-… users. Left: observe both surviving a credential rotation.

  7. added and removed
    status: ready-for-agentFully specified; an agent may take it with nobody watching.
    on Oct 21, 2026
  8. ExtraToast commented on Oct 21, 2026

    @ExtraToast
    ContributorAuthor

    Watched both Processes across one credential rotation on 2026-10-21. The last criterion holds.

    Rotation (18:16:37Z for tribelt, 18:17:07Z for estate-dashboard). Vault Secrets Operator issued a new lease for each VaultDynamicSecret (database/creds/tribelt-owner, database/creds/estate-dashboard-owner), rewrote the destination Secret, and restarted tribelt-primary and estate-dashboard-primary through rolloutRestartTargets (RolloutRestartTriggered, restartedAt set by the operator). After that the operator only renewed the 1 h leases (18:58:41Z and 19:01:23Z) and left the Secrets untouched. A credential expiring at its max TTL rotates through the same path.

    The login changed, and the old one is gone. Read from pg_roles and pg_stat_activity on the platform Postgres at about 19:38Z, without printing a login name:

    Project login issued (UTC) valid until (UTC) sessions
    estate-dashboard 18:17:07 20:01:28 3
    tribelt 18:16:37 19:58:46 1

    Each Project has exactly one Vault-issued login, the one issued at the rotation, and all of its sessions use it. The login from before the rotation no longer exists.

    Both Processes keep working on the new credential, more than an hour after the old lease stopped renewing.

    • tribelt started at 18:16:40Z, applied its migrations as the owner role, and serves https://tribelt.jorisjonkers.dev/ with 200.
    • Both pods answer ready on /readyz (five probes each).
    • No authentication or permission error appears in either log since the rotation.

    estate-dashboard's readiness probe times out on single probes now and then (not ready: context deadline exceeded, never three in a row). Its log shows no authentication error, so these timeouts are latency, not the credential. This is noted as a separate observation, not part of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: deployhomelab-deploy, deploy-v2, manifests, and rollout flow.type: featureNew user-facing or operator-facing capability.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions