posit-dev / posit-dev/team-operator

Support separate database instances per product

Open
#116 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
10
Forks
1
Avg merge
1d 8h
Merged PRs (30d)
4

Description

Summary

Currently, all products (Connect, Workbench, Package Manager) must share a single PostgreSQL server. The operator creates separate databases and users per product within that server, but there is no way to point individual products at different database instances.

Use Case

Customers may need per-product database instances for:

  • Sizing — Connect may have heavier database workload than Workbench
  • Availability — Different RDS/Azure DB tiers or failover configurations per product
  • Compliance — Isolation requirements that go beyond logical database separation
  • BYO database — Customer wants to reuse an existing database server for one product but use a managed one for others

Current Behavior

  • A single main-database-url is resolved via DetermineMainDatabaseUrl() in internal/get_db_secret.go
  • All product controllers use this same URL to create their databases
  • Product CRDs have a PostgresDatabaseConfig with a Host field, but reconciliation still flows through the single main database URL

Proposed Behavior

Allow each product to optionally specify its own database connection, overriding the site-level default. For example:

spec:
  connect:
    databaseSettings:
      connectionSecret: "connect-db-secret"  # optional override
  workbench:
    databaseSettings:
      connectionSecret: "workbench-db-secret"  # optional override

Products without an override would continue using the site-level mainDatabaseCredentialSecret.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading internal/get_db_secret.go and tracing DetermineMainDatabaseUrl through the product controllers and their PostgresDatabaseConfig handling. Compare how the site-level mainDatabaseCredentialSecret currently reaches each product, then define the override and fallback paths described in the issue. Done means each product can use its own connection secret while products without one retain the site-level default.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes, postgresql
Domain
database, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.