ADR-015: CloudNativePG as first-class database¶
Category: architecture Provenance: guided-ai
Decision¶
Support CloudNativePG (CNPG) as the officially recommended PostgreSQL solution for GitOps workflows. Provide examples and documentation for CNPG integration.
Rationale¶
GitOps native: CNPG is declarative, matches operator's GitOps philosophy. High availability: CNPG provides HA PostgreSQL clusters out of the box. Backup/restore: Built-in backup capabilities for disaster recovery. Kubernetes native: Follows K8s patterns, integrates with operator ecosystem. Trade-off: Users can still use external databases if needed.
Agent Instructions¶
When creating Keycloak examples or tests, prefer CNPG Cluster resources over manual PostgreSQL. Document CNPG setup in how-to guides. Integration tests use CNPG for Keycloak database (via scripts/deploy-test-keycloak.sh). Support both CNPG and external databases for flexibility.