cnpg
Use when working with CloudNativePG (CNPG) for PostgreSQL on Kubernetes — creating or troubleshooting Cluster, Backup, ScheduledBackup, Pooler, or…
Skill by Aidas-dev
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/aidas-dev-cnpg
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: devops
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/cnpg
What's inside
- Skill name
cnpg- Description
- Use when working with CloudNativePG (CNPG) for PostgreSQL on Kubernetes — creating or troubleshooting Cluster, Backup, ScheduledBackup, Pooler, or ImageCatalog resources; defining bootstrap, storage, backup, or affinity settings.
- License
- MIT
- Instructions
- 127 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# CloudNativePG (CNPG)
## Overview
CloudNativePG operator manages HA PostgreSQL clusters on Kubernetes. API: `postgresql.cnpg.io/v1`. Deployed via Helm chart (latest: 0.28.2 \u2192 operator 1.29.1).
## CRD Reference
| CRD | Purpose |
|-----|---------|
| `Cluster` | HA PostgreSQL cluster (core resource) |
| `Backup` | On-demand backup |
| `ScheduledBackup` | Cron-based backup schedule |
| `Pooler` | PgBouncer connection pooler |
| `Database` | Database-level management within cluster |
| `Publication` / `Subscription` | Logical replication |
| `ImageCatalog` / `ClusterImageCatalog` | Extension image management (v1.29+) |
| `FailoverQuorum` | Quorum-based failover settings |
## Cluster Spec (Key Fields)
```yaml
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
spec:
instances: 1 # Replicas (1 = standalone primary)
imageName: ghcr.io/cloudnative-pg/postgresql:18
storage:
size: 10Gi
storageClass: ceph-block # Omit or null for cluster default
resizePVC: true # Allow storage resize via Helm upgrade
walStorage: # Optional \u2014 separate WAL volume
size: 5Gi
storageClass: ceph-block
bootstrap:
initdb:
database: app # Default DB name
owner: app # Default owner user
postInitSQL: # Run after init
- CREATE EXTENSION vector;
affinity:
nodeSelector:
kubernetes.io/hostname: worker-01
podAntiAffinity:
type: preferred # required or preferred
topologyKey: kubernetes.io/hostname
postgresql:
parameters:
shared_preload_libraries: vector # Extensions
pg_hba: # Custom pg_hba (v1.29+ use podSelectorRefs)
primaryUpdateStrategy: unsupervised # unsupervised (default) or switchover
primaryUpdateMethod: restart # restart or switchover
monitoring:
enablePodMonitor: true # Generates Prometheus PodMonitor
backup:
volumeSnapshot:
snapshotClass: csi-ceph-block # CSI snapshot class
```
## Bootstrap Methods
| Method | Use case |
|--------|----------|
| `initdb` | Fresh cluster from scratch |
| `pg_basebackup` | Clone from existing CNPG cluster |
| `recovery` | PITR from Barman/volumeSnapshot/plugin backup |
| `pg_basebackup` via `recovery` | Bootstrap replica from another cluster |
## Backup Methods
| Method | Status | Details |
|--------|--------|---------|
| `barmanObjectStore` | **Deprecated** (removed v1.30) | S3/GCS/Azure via Barman Cloud |
| `volumeSnapshot` | Current | CSI snapshots (recommended for Ceph, EBS, etc.) |
| `plugin` | Current | CNPG-I gRPC plugin for backup/WAL/recovery |
## Affinity / Scheduling Patterns
- **nodeSelector** — Pin to specific node (common for stateful workloads)
- **podAntiAffinity** — Spread replicas across nodes (`required` for HA, `preferred` for soft)
- **topologySpreadConstraints** — Distribute across zones
- **tolerations** — For tainted nodes (GPU, infra-only)
Set per-instance overrides via `instances` + `nodeSelector` to pin specific roles.
## ImageCatalog (v1.29+)
```yaml
apiVersion: postgresql.cnpg.io/v1
kind: ClusterImageCatalog
metadata:
name: postgres-extensions
spec:
images:
- image: ghcr.io/my-org/postgres:18-pgvector
major: 18
```
Then reference in Cluster: `spec.imageCatalogRef: postgres-extensions`
## Common Mistakes
- **BarmanObjectStore as default** \u2014 deprecated, use `volumeSnapshot` or `plugin`
- **No WAL storage** \u2014 important for HA. Add `walStorage` block for performance
- **`resizePVC: false`** \u2014 prevents storage expansion on Helm upgrade
- **`primaryUpdateStrategy: supervised`** \u2014 requires manual approval for switchover; use `unsupervised` for automatic
- **Same storageClass for all workloads** \u2014 ceph-block fine for most, but immich needs local-fast for vector extension performance
- **Missing `INHERITED_ANNOTATIONS` / `INHERITED_LABELS`** \u2014 empty is fine; only set if you want annotations propagated to PVCs
## Version MappingFrom Aidas-dev/k8s-agent-skills, MIT.
More from Aidas-dev/k8s-agent-skills
- 0.569score
harbor-terraform
Aidas-dev
Use when managing Harbor infrastructure as code with Terraform — projects, robot accounts, registries, replication rules, retention policies, webhooks, users…
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
gitea-webhooks
Aidas-dev
Use when managing Gitea webhooks — creating webhooks via API, understanding event types, system vs repo vs org webhooks, payload verification with…
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
harbor-api
Aidas-dev
Use when working with the Harbor REST API v2 — project management, artifact operations, robot accounts, replication, vulnerability scanning, OIDC/LDAP config…
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
cert-manager
Aidas-dev
Use when creating or managing cert-manager CRDs — Certificate, Issuer, ClusterIssuer, CertificateRequest.
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
dragonfly
Aidas-dev
Use when working with DragonflyDB operator on Kubernetes — creating or troubleshooting Dragonfly resources, configuring replication, snapshots, TLS…
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
flux
Aidas-dev
Use when working with Flux CD — debugging live clusters, writing/auditing Flux resources, or asking Flux CD questions.
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
gitea-runner
Aidas-dev
Use when configuring Gitea Actions runners — registration, deployment modes, Docker vs host mode, Talos/Kubernetes host-mode, ephemeral runners, and v1.26…
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
gitea-tea
Aidas-dev
Work with Gitea using tea CLI for auth, repo, issue, pull request, release, actions, webhook, and notification workflows.
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
harbor-helm
Aidas-dev
Use when deploying, configuring, or upgrading Harbor on Kubernetes via Helm chart — values configuration, external database, TLS/certificates, storage…
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
atlas
Aidas-dev
Use when working with Atlas Operator on Kubernetes — creating or troubleshooting AtlasSchema or AtlasMigration resources; configuring DevDB, migration…
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
cilium-gateway
Aidas-dev
Use when creating Gateway API resources for ingress, configuring TLS termination or passthrough, setting up HTTP-to-HTTPS redirect or traffic splitting…
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
cilium-network
Aidas-dev
Use when configuring Cilium CNI networking, writing network policies, debugging pod connectivity issues, setting up LB IPAM or L2 announcements for Service…
SkillBFreshness: B★ 4Claude Code +9
Signals
- Stars
- 4
- Forks
- 3
- Open issues
- 0
- Last commit (this folder)
- Jul 16, 2026 (3 months ago)
- Last release
- Aug 14, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/Aidas-dev/k8s-agent-skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Aidas-dev
- 0.569score
dragonfly
Aidas-dev
Use when working with DragonflyDB operator on Kubernetes — creating or troubleshooting Dragonfly resources, configuring replication, snapshots, TLS…
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
flux
Aidas-dev
Use when working with Flux CD — debugging live clusters, writing/auditing Flux resources, or asking Flux CD questions.
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
gitea-runner
Aidas-dev
Use when configuring Gitea Actions runners — registration, deployment modes, Docker vs host mode, Talos/Kubernetes host-mode, ephemeral runners, and v1.26…
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
gitea-tea
Aidas-dev
Work with Gitea using tea CLI for auth, repo, issue, pull request, release, actions, webhook, and notification workflows.
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
harbor-helm
Aidas-dev
Use when deploying, configuring, or upgrading Harbor on Kubernetes via Helm chart — values configuration, external database, TLS/certificates, storage…
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
cert-manager
Aidas-dev
Use when creating or managing cert-manager CRDs — Certificate, Issuer, ClusterIssuer, CertificateRequest.
SkillBFreshness: B★ 4Claude Code +9
Cite this page
cnpg skill. Agent Mart. https://agentmart.dev/skills/aidas-dev-cnpg (last updated 2026-10-24)