Skip to main content

Database

Mission Control stores all state in a Postgres Database, by default a Postgres StatefulSet is created.

Configuring the default Statefulset

values.yaml
db:
create: true
conf: # override postgres.conf settings
secretKeyRef: # auto-generated if it doesn't exist
name: incident-commander-postgres
key: DB_URL
storageClass: # optional storage class for PVC volume
storage: 20Gi
shmVolume: 256Mi # size of shm memory file to be mounted
resources: # resources to assign to the postgres /docs/guide/canary-checker/reference/database pod
requests:
memory: 4Gi

The /docs/guide/canary-checker/reference/database password can then be retrieved using

kubectl get secret incident-commander-postgres -o json | jq -r '.data.POSTGRES_PASSWORD' | base64 -d
Connecting

If you ever need to connect to the /docs/guide/canary-checker/reference/database, you can do so by forwarding the port:

kubectl port-forward svc/postgres 5432:5432
psql -U postgres localhost -p 5432 mission_control

Updating postgres.conf settings

Using an External Database

In order to connect to an existing /docs/guide/canary-checker/reference/database a secret needs to be created with the following key:

  • DB_URL

The following keys are required for kratos:

  • DB_HOST
  • DB_NAME
  • DB_USERNAME
  • DB_PASSWORD
values.yaml
db:
create: false
secretKeyRef: # auto-generated if it doesn't exist
name: mission-control-postgres
key: DB_URL

Google Cloud SQL

When you use Google Cloud SQL for PostgreSQL, grant the Mission Control database user the permissions required by startup migrations before you install or upgrade Mission Control:

GRANT cloudsqlsuperuser TO your_username;
ALTER ROLE your_username CREATEROLE;

Replace your_username with the user configured in the Mission Control database secret.