Databases
Seven Swarmd services keep relational state, plus Keycloak. How they share Postgres is the single most consequential choice you make at install time.Who stores what
Keycloak always gets its own database, in every mode. Its ~100-table data
model has no business mingling with application schemas.
The three layouts
- database-per-service (default)
- schema-per-service
- instance-per-service
One Postgres pod. Seven databases inside it, plus Keycloak’s. One shared
PVC.Pick this when you want DB-level isolation between services without
running eight Postgres instances. It’s the shipped default and the
best-trodden path.The trade-off: every service shares one PVC and one set of resource
limits. When audit grows, it competes with everything else for the same disk.
postgres.mode is validated at render time. A typo fails the install with
“postgres.mode must be one of: database-per-service, schema-per-service,
instance-per-service” rather than producing a half-wired release.Sizing guidance
Ininstance-per-service mode, anything you don’t override inherits
postgres.storage / postgres.resources. Reasonable starting points:
Bring your own Postgres
For anything you care about, run Postgres properly — RDS, Cloud SQL, CloudNativePG, your DBA’s cluster — and point the chart at it.${db} is a placeholder the chart substitutes per service — registry,
agent_relay, audit and so on from the table above. So one template covers
every service.
One database instead of seven
If your managed instance gives you a single database and you want the services to share it with a schema each — the external equivalent ofschema-per-service:
singleDatabase set, ${db} resolves to that one name for every
service and each gets its own schema. Flyway creates the schema on first
migration.
What you have to create yourself
What you have to create yourself
The chart does not create databases on an external server — it has no
superuser and no business having one. Before installing, create:
- Each database from the table above (or the single
singleDatabase), and - A role with full rights on them.
External Postgres forces external Keycloak
External Postgres forces external Keycloak
keycloak.deploy=true with postgres.deploy=false is not supported, and
the chart fails the render rather than pretending. The bundled Keycloak needs
a host and port, and the chart won’t parse them out of an arbitrary JDBC URL.Bringing your own Postgres? Bring your own Keycloak too — see
external Keycloak.TLS to your database
TLS to your database
Put it in the JDBC URL — the chart passes the template through verbatim:Mounting a CA bundle into every service is not something the chart does for
you today; if you need
verify-full with a private CA, talk to us.ClickHouse
Audit and registry write their long-window history to ClickHouse when it’s enabled. It’s off by default, and the platform works without it — the long-window scan endpoints simply return empty results.- In-cluster
- Your own
Backups
The chart does not back anything up. What to point your tooling at:
Also back up the
swarmd-generated-credentials Secret. It holds the
encryption-key that registry, relay, teams and the UI use for data at rest.
Restoring a database without it leaves you with rows you cannot decrypt.
Next
Ingress
Real hostnames and TLS.
Presets
Tested values files for each layout.
