cnpg-migration

Migrate per-app CNPG clusters to a central Postgres cluster via Crossplane AppDBClaim.

Updated Aug 26, 2025
One-click install
npx skills add https://github.com/timosur/homelab --skill cnpg-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cnpg-migration
Source: https://github.com/timosur/homelab/tree/main/.github/skills/cnpg-migration
Command: npx skills add https://github.com/timosur/homelab --skill cnpg-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables consolidating per-app CNPG databases into a single central Postgres instance using Crossplane AppDBClaim, reducing operational overhead and keeping credentials centralized.

Core Features & Use Cases

  • AppDBClaim-driven migrations: creates and binds app-specific databases and credentials on a central cluster.
  • Cross-app configuration updates: updates app configurations to consume Crossplane secrets rather than per-app CNPG resources.
  • Guided multi-phase workflow: provides a proven sequence (research, claim, update, data-migration, cleanup, verify) for safe consolidation.

Quick Start

Create an AppDBClaim in the app's namespace and update deployments to reference the Crossplane-provisioned database secret.

Frequently Asked Questions about cnpg-migration

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

FAQPage Schema
How do I migrate a per-app CNPG cluster to a central Postgres instance?

To migrate a per-app CNPG cluster to central Postgres, create a Crossplane AppDBClaim to provision the database, update app deployments to consume the new Crossplane secrets, optionally migrate data, and then clean up the old CNPG resources.

What is a Crossplane AppDBClaim used for in Kubernetes database consolidation?

A Crossplane AppDBClaim is used for self-service provisioning of app-specific databases and credentials on a central Postgres cluster, enabling the consolidation of per-app CNPG databases and reducing operational overhead.

How do I update Kubernetes app configurations to use Crossplane secrets after database migration?

Update app configurations to reference Crossplane secrets by adjusting deployment methods like envFrom, env variables, ExternalSecret, or Helm values to point to the newly provisioned database credentials instead of per-app CNPG resources.

Can I migrate data when moving from a CNPG cluster to a central shared Postgres?

Yes, data migration is an optional phase when moving to central shared Postgres, following AppDBClaim creation and app configuration updates, allowing you to transfer existing data before cleaning up the original CNPG cluster.

What naming rules are required for Crossplane AppDBClaim database migration?

The Crossplane AppDBClaim migration process defines specific naming rules for appName, databaseName, and roleName to ensure consistent provisioning and binding of app-specific databases on the central Postgres cluster.

What central Postgres endpoint is used for Crossplane AppDBClaim migration?

The central Postgres endpoint used for Crossplane AppDBClaim migration is central-postgres-rw.postgres.svc.cluster.local, which serves as the target shared cluster for consolidating per-app CNPG databases.