Create Postgres ΒΆ
Create a Postgres database.
Create .nais/postgres.yaml in your repository:
version: v1
type: Postgres
name: <POSTGRES-NAME>
spec:
majorVersion: "18"Replace <POSTGRES-NAME> with the name of your database. See the Postgres manifest reference for the field definition, or review the full example if you need to set resources or high availability.
Apply the manifest from your deploy workflow:
name: Deploy Nais resources
on:
push:
branches: [main]
paths:
- ".nais/**"
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
- uses: nais/setup@v1
with:
team: <TEAM>
- name: Apply Postgres
run: nais apply .nais/postgres.yaml --environment <ENVIRONMENT>See Deploy manifest changes without rebuilding for a complete pipeline example. To change settings later, edit the manifest or see Manage Postgres.
Create a Postgres database:
nais postgres create <POSTGRES-NAME> --team <TEAM> --environment <ENVIRONMENT>The CLI asks for confirmation before creating the database. It uses platform defaults unless you set options:
nais postgres create <POSTGRES-NAME> \
--team <TEAM> \
--environment <ENVIRONMENT> \
--high-availability \
--cpu 100m \
--memory 512Mi \
--disk-size 10GiTo change settings later, see Manage Postgres.
- Open your team in Nais Console and select Postgres.
- Select Create Postgres.
- Fill in the form and select Create Postgres.
To change settings later, see Manage Postgres.
Provisioning continues asynchronously. Follow the status on the database's page in Nais Console.