Skip to content

Discussion: CloudNativePG as foundational database infrastructure for software packs #303

@dcmcand

Description

@dcmcand

Context

Software packs that need PostgreSQL (e.g., Superset, Gitea) currently depend on upstream Helm charts that bundle Bitnami PostgreSQL sub-charts. This dependency is no longer viable.

The Bitnami situation

Effective August 28, 2025, Broadcom moved Bitnami container images behind a paywall (Bitnami Secure Images, starting at $72,000/year). Key impacts:

  • All versioned image tags (e.g., bitnami/postgresql:14.17.0-debian-12-r3) were moved to bitnamilegacy/ and will receive no further updates
  • Public catalog deletion was set for September 29, 2025
  • Only :latest tags remain free, which are unsuitable for production (no version pinning)
  • Helm charts on Docker Hub (bitnamicharts/) remain available as OCI artifacts but reference paywalled images
  • The chart source code on GitHub remains Apache 2 licensed, but the images they reference are not freely available

This means any Helm chart depending on Bitnami sub-charts for PostgreSQL or Redis is building on a dead foundation. The bitnamilegacy mirrors are frozen and accumulating unpatched CVEs.

Proposal

Add CloudNativePG as an optional foundational service managed by the nebari-operator. Software packs would request managed PostgreSQL databases through the NebariApp CRD, similar to how they request Keycloak clients today with provisionClient: true.

NebariApp CRD extension

spec:
  database:
    enabled: true
    provider: cloudnativepg
    instances: 1
    size: 1Gi

When enabled, the operator would:

  1. Create a CloudNativePG Cluster resource
  2. Wait for the database to become ready
  3. Store connection credentials in a secret (<name>-db-credentials) with keys: host, port, username, password, database, uri
  4. Create RBAC allowing the app's ServiceAccount to read the credentials secret

How packs would use it

Packs would reference the operator-created secret via extraEnv or envFrom, disable the bundled Bitnami PostgreSQL sub-chart, and point their database config at the operator-provided credentials. The same pattern already established for OIDC client provisioning.

Why CloudNativePG

  • CNCF project - actively maintained, strong community, vendor-neutral governance
  • No Bitnami dependency - uses official PostgreSQL Docker images from the PostgreSQL community
  • Kubernetes-native - declarative CRDs, no external tools (no Patroni/repmgr/Stolon). Integrates directly with the Kubernetes API for failover
  • Production-ready - automated failover, continuous backup to object storage, point-in-time recovery, connection pooling (PgBouncer), rolling updates
  • Observability - built-in Prometheus metrics exporter, structured logging
  • Security - TLS by default, certificate rotation, RBAC integration
  • Resource efficiency - one operator manages all databases across all packs, vs. one Bitnami sub-chart per pack

Considerations

  • Adds a new foundational dependency to the Nebari platform (alongside Envoy Gateway, cert-manager, Keycloak)
  • Packs still need to work without it for standalone/non-Nebari deployments
  • Need a migration path for existing deployments using bundled Bitnami PostgreSQL
  • The CloudNativePG operator itself needs lifecycle management

Prior art

This follows the pattern already established for Keycloak - the operator manages a shared platform service and provisions per-app resources (OIDC clients / databases) through the NebariApp CRD.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions