AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Cnpg

skill-aidas-dev-k8s-agent-skills-cnpg · by Aidas-dev

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.

No reviews yet
0 installs
30 views
0.0% view→install

Install

$ agentstack add skill-aidas-dev-k8s-agent-skills-cnpg

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-aidas-dev-k8s-agent-skills-cnpg)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
1mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Cnpg? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

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)

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+)

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 Mapping

| Helm Chart | Operator | Release Notes | |------------|----------|---------------| | 0.28.2 | 1.29.1 | Latest (CVE fixes) | | 0.28.0 | 1.29.0 | ImageCatalog, podSelectorRefs, CNPG-I plugins |

Check helm list -n for deployed chart version; cross-reference with cloudnative-pg.io/release-notes.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.