CNCFGabriele Bartolini (EnterpriseDB) and CNCF Ambassador, Rob Kenefeck (ControlPlane)16 min readtutorialintermediate
Running OpenBao on Kubernetes with a CloudNativePG PostgreSQL backend
Summary
Step‑by‑step recipe to run OpenBao (Vault fork) on Kubernetes using CloudNativePG as a password‑less, TLS‑authenticated PostgreSQL storage backend. Shows how to spin up a Kind cluster with the cnpg‑playground, deploy a 3‑node CNPG cluster with synchronous quorum replication, configure DatabaseRole‑based client certificates, set up pg_hba rules, and initialize OpenBao’s schema via a one‑off Job.
- Use CloudNativePG’s `ClusterImageCatalog` to track minimal PostgreSQL 18 images automatically.
- Enforce password‑less mTLS for both schema‑owner and application roles via `DatabaseRole` `clientCertificate` and explicit `pg_hba` entries.
- Leverage CNPG’s node selectors, tolerations, and required pod anti‑affinity to isolate Postgres pods on dedicated nodes across zones.
- Set secret volume `defaultMode: 0640` so libpq accepts mounted client keys (group‑readable but not world‑readable).
Provides a fully open‑source, vendor‑agnostic secret‑management stack that is self‑healing and HA on any conformant Kubernetes cluster, eliminating password sprawl and cloud‑managed database lock‑in.
6/10




