CloudNativePG#

Overview#

CloudNativePG is the shared PostgreSQL operator for the NVIDIA Mission Control components. It runs cluster-scoped and provides the Cluster custom resource definition. The Keycloak database is declared as one such Cluster, which the operator reconciles into PostgreSQL instances.

How it works#

The operator is delivered as an Argo CD Application from the upstream cloudnative-pg Helm chart, installed into the cnpg-system namespace. It installs the CloudNativePG CRDs and runs a cluster-scoped controller that watches Cluster resources across all namespaces.

The CRDs must exist before any Cluster resource is created. So the operator Application syncs ahead of the keycloak-cnpg Application that creates the Cluster. The owning Application supplies the Cluster spec: instance count, storage, and database bootstrap.

Argo CD applies its built-in CloudNativePG health check to the operator and the Cluster. A dependent Application can then gate on the Cluster reaching the healthy phase.

For how this Application is rendered and deployed, refer to Installing GitOps-Managed Components.

Configuration#

Add these settings under the cnpgOperator key in values.yaml. The key already carries the pinned version and syncWave from Installing GitOps-Managed Components; the following fields are the ones you set. A field shown with a value uses that value as its default when you omit it.

cnpgOperator:
  enabled: true                   # optional, deploy the operator Application
  podMonitorEnabled: true         # optional, emit a Prometheus PodMonitor
  grafanaDashboardEnabled: true   # optional, create the operator Grafana dashboard
  • enabled – deploy the operator Application and its CNPG CRDs. Default true.

  • podMonitorEnabled – emit a Prometheus PodMonitor for the operator. Default true.

  • grafanaDashboardEnabled – create the operator Grafana dashboard ConfigMap. Default true.

The operator is cluster-scoped, so one instance serves every Cluster across all namespaces. Per-database settings such as instance count and storage size live on the owning Application. For the Keycloak database, refer to the keycloakCnpg settings on Keycloak.

Secrets#

CloudNativePG consumes no bootstrap secrets. External Secrets creates the Keycloak database credential, which its Cluster owns. Refer to Keycloak.

Verify#

Confirm the operator Application is healthy and its controller is running:

kubectl get application -n argocd | grep cnpg-operator
kubectl get pods -n cnpg-system

Confirm the Cluster CRD is installed, so dependent Applications can declare databases:

kubectl get crd clusters.postgresql.cnpg.io

For a deployed database, confirm the Cluster reports a healthy phase:

kubectl get cluster -A