Skip to content

Database Provisioning ​

MCTL can provision databases for your services within a tenant.

Provision a Database ​

"Provision a PostgreSQL database for my-app in the staging tenant"

The mctl_provision_database tool:

  1. Creates a database and role on the shared CNPG PostgreSQL cluster
  2. Stores credentials in Vault and syncs them to a Secret in the tenant namespace
  3. Wires the Secret into the service configuration through GitOps

The tool returns a workflow name. Track it with mctl_get_workflow_status, then verify that the service can connect after ArgoCD and External Secrets sync.

Configuration ​

Database credentials are automatically injected into your service as environment variables:

VariableDescription
DB_HOSTDatabase hostname
DB_PORTDatabase port
DB_NAMEDatabase name
DB_USERDatabase username
DB_PASSWORDDatabase password

Supported Databases ​

The provisioning operation supports PostgreSQL on the platform's shared CNPG cluster.

The generated database secret exposes the DB_* variables above. If your app requires DATABASE_URL, configure it explicitly; it is not guaranteed by the provisioning template.