deploying-postgres-k8s

Deploys PostgreSQL clusters on Kubernetes using the CloudNativePG operator with automated failover.

9|2|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/AbdullahMalik17/Hacathan_5 --skill deploying-postgres-k8s-abdullahmalik17
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: deploying-postgres-k8s
Source: https://github.com/AbdullahMalik17/Hacathan_5/tree/main/.claude/skills/deploying-postgres-k8s
Command: npx skills add https://github.com/AbdullahMalik17/Hacathan_5 --skill deploying-postgres-k8s-abdullahmalik17

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Setting up a highly available PostgreSQL database on Kubernetes involves complex operator installation, cluster configuration, connection management, and backup setup. This Skill provides tested manifests and commands to get a production-grade PostgreSQL cluster running with automated failover, without deep CloudNativePG expertise. ## Core Features & Use Cases - Operator Installation: Install the CloudNativePG operator via direct manifest, Helm, or namespace-scoped configuration for enhanced security. - Cluster Configurations: Ready-to-use YAML for development (single instance) and production (3-replica HA with tuned parameters, resource limits, and pod anti-affinity). - Connection & Secrets Management: Retrieve auto-generated connection secrets, use rw/ro service endpoints, and wire DATABASE_URL into application deployments. - Backup & Monitoring: Configure S3 backups with retention policies, scheduled backups, and Prometheus metrics via PodMonitor. - Use Case: You are deploying a FastAPI application on Kubernetes and need a highly available PostgreSQL backend. Use this Skill to install the operator, create a 3-instance cluster with S3 backups, and inject the connection URI into your app's deployment. ## Quick Start Ask the AI to deploy a production PostgreSQL cluster on Kubernetes using CloudNativePG with three replicas and S3 backups.

Frequently Asked Questions about deploying-postgres-k8s

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy PostgreSQL on Kubernetes with high availability?▼

Install the CloudNativePG operator with kubectl apply, then create a Cluster resource with instances set to 3 and pod anti-affinity enabled. CloudNativePG handles replication and automated failover between the primary and replicas.

How to install the CloudNativePG operator on Kubernetes?▼

Apply the release manifest with kubectl apply --server-side, or use Helm with the cnpg/cloudnative-pg chart. For namespace-scoped deployments, set config.clusterWide=false during Helm installation.

How do I get the PostgreSQL connection string from CloudNativePG?▼

CloudNativePG creates secrets named cluster-app and cluster-superuser containing connection URIs. Retrieve them with kubectl get secret pg-cluster-app -o jsonpath and reference them in deployments via secretKeyRef.

Does CloudNativePG support backups to S3?▼

Yes, CloudNativePG supports S3 backups through barmanObjectStore configuration with gzip compression for WAL and data. You can also create ScheduledBackup resources with cron schedules and retention policies like 30 days.

When should I not use CloudNativePG for PostgreSQL?▼

Avoid CloudNativePG when using managed Postgres services like Neon, RDS, or Cloud SQL, or when a simple Docker container suffices. It is designed for Kubernetes-native production workloads requiring failover and replication.

Why is my CloudNativePG cluster stuck in pending state?▼

A pending cluster usually means PVCs cannot bind because no storage class is available. Add a storageClass to the cluster spec and check status with kubectl describe cluster and pod logs.