Skip to content

Choose a database

Vesicle stores its data in PostgreSQL. The chart does not install a database server; it either configures a CloudNativePG cluster for you or connects to a server you provide.

database.providerDatabaseUse when
cnpg (default)A CloudNativePG Cluster that the chart createsReplicas, backups and monitoring in the cluster
externalYour own PostgreSQL (database.host)A managed database

The CloudNativePG operator must already be running in the cluster; the chart creates the Cluster resource for it.

  • database.cnpg.instances is the number of PostgreSQL instances: 1 is a single read/write instance, 2 or more adds streaming replicas. Failover is handled by the operator. With replicas, the engine also reads from the read-only service; see Scaling and availability.
  • Give the database a realistic memory limit (database.cnpg.resources). A very small limit lets PostgreSQL be killed during large room purges.
  • Storage is set with database.cnpg.storage.size and storageClass.
  • database.cnpg.imageName points at a mirror of the PostgreSQL image if you need one.

Passwords are never values. The chart generates the database passwords once and keeps them across upgrades, or reads Secrets that you name (database.credentials.*.existingSecret). The services connect as a role that can read and write data; only the migration job connects as the role that owns the schema.

Turn on backups before real use: Back up and restore the database.

database:
provider: external
host: db.example.com
credentials:
app:
existingSecret: vesicle-db
matrix-authentication-service:
database:
existingSecret: mas-db

Each Secret is kubernetes.io/basic-auth with the keys username and password. The connection settings for Matrix Authentication Service are derived from the same database.* values. Backups of an external database are your responsibility.

helm uninstall deletes the CloudNativePG cluster, and the operator normally deletes its volumes with it. Take a backup first and confirm it finished.