PostgreSQL Store Configuration

View as Markdown

Overview

NVSentinel can use PostgreSQL instead of MongoDB as the health-events datastore. With postgresql.enabled: true, the chart deploys an in-cluster Bitnami PostgreSQL instance.

For architecture, schema, TLS modes, and MongoDB migration, see PostgreSQL Provider.

To use a cloud-managed PostgreSQL service (RDS, Azure Database for PostgreSQL, Cloud SQL), see External Datastore.

Enable in-cluster PostgreSQL

1global:
2 datastore:
3 provider: "postgresql"
4 connection:
5 host: "nvsentinel-postgresql"
6 port: 5432
7 database: "nvsentinel"
8 username: "postgres"
9 sslmode: "verify-full"
10 sslcert: "/etc/ssl/client-certs/tls.crt"
11 sslkey: "/etc/ssl/client-certs/tls.key"
12 sslrootcert: "/etc/ssl/client-certs/ca.crt"
13
14 mongodbStore:
15 enabled: false
16
17postgresql:
18 enabled: true

Full example: distros/kubernetes/nvsentinel/values-postgresql.yaml

$helm upgrade --install nvsentinel <chart-path> \
> -f distros/kubernetes/nvsentinel/values-postgresql.yaml \
> --namespace nvsentinel \
> --create-namespace

Configuration keys

AreaHelm keys
Datastore providerglobal.datastore.*
In-cluster PostgreSQLpostgresql.*

Server TLS, pg_hba, and init scripts are under postgresql.primary.* (see the example values file).

Verify after install

$kubectl get statefulset -n <namespace> -l app.kubernetes.io/name=postgresql
$kubectl get pods -n <namespace> -l app.kubernetes.io/name=postgresql

In-cluster service hostname is typically <release-name>-postgresql (for example nvsentinel-postgresql when the release name is nvsentinel).