--- name: deploying-postgres-k8s description: | Deploys PostgreSQL on Kubernetes using the CloudNativePG operator with automated failover. Use when setting up PostgreSQL for production workloads, high availability, or local K8s development. Covers operator installation, cluster creation, connection secrets, and backup configuration. NOT when using managed Postgres (Neon, RDS, Cloud SQL) or simple Docker containers. --- # Deploying PostgreSQL on Kubernetes Deploy production-ready PostgreSQL clusters using CloudNativePG operator (v1.28+) with automated failover. ## Quick Start ```bash # 1. Install CloudNativePG operator kubectl apply --server-side -f \ https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/release-1.28/releases/cnpg-1.28.0.yaml # 2. Wait for operator kubectl rollout status deployment -n cnpg-system cnpg-controller-manager # 3. Deploy PostgreSQL cluster kubectl apply -f - <