multigres/multigres-operator/exercise-cluster

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Deploy MultigresCluster fixtures, run mutation scenarios, and validate health using the observer. Finds bugs in the operator and upstream multigres by exercising real cluster operations and verifying end-to-end health beyond CRD phase status. Use this skill whenever the user wants to test the operator, exercise the cluster, run exerciser scenarios, validate cluster health after changes, find bugs through mutation testing, or deploy and mutate fixtures.

Install

npx vskill@latest install multigres/multigres-operator/exercise-cluster

SKILL.md

Exercise Cluster Skill

Goal: Find bugs in the multigres operator and upstream multigres by deploying real MultigresCluster configurations, mutating them through operator-driven workflows, and using the observer to verify true end-to-end cluster health.

Core principles:

  • The observer is the single source of truth for cluster health. CRD phase Healthy is necessary but NOT sufficient — it misses broken replication, connection failures, and multi-primary states.
  • You drive kubectl directly. Read the live CR, understand its structure, construct correct patches. Fixtures have different structures (.spec.pools vs .overrides.pools).
  • Every post-grace-period error is potentially a real bug. NEVER dismiss errors — operator logs, RBAC warnings, webhook warnings, kubectl output. Investigate everything, report everything, including transient findings that resolved.

Phase 0: Cluster Setup

Verify the kind cluster and observer are running:

bash
KUBECONFIG=$(pwd)/kubeconfig.yaml kubectl cluster-info
KUBECONFIG=$(pwd)/kubeconfig.yaml kubectl get pods -l app.kubernetes.io/name=multigres-observer -n multigres-operator

If cluster is down: make kind-deploy. If only observer is missing: make kind-deploy-observer.

Define the observer helper:

bash
observer() {
KUBECONFIG=$(pwd)/kubeconfig.yaml kubectl exec -n multigres-operator deploy/multigres-observer -- curl -sf "http://localhost:9090$1"
}

Verify: observer /api/status | jq '.summary'

Phase 1: Deploy Fixture & Baseline

Pick a fixture from Fixture Selection below. For topology fixtures, read references/topology-awareness.md first.

  1. Deploy prerequisites if they exist, wait for pods to be Running:

``bash KUBECONFIG=$(pwd)/kubeconfig.yaml kubectl apply -f fixtures/<fixture>/prerequisites.yaml ``

  1. Deploy the cluster. Read the kubectl output — webhook warnings mean real problems. Stop and fix before proceeding.

``bash KUBECONFIG=$(pwd)/kubeconfig.yaml kubectl apply -f fixtures/<fixture>/cluster.yaml ``

  1. Run the Stability Verification Protocol (below) with tier lifecycle. Baseline must be fully clean — any error is a bug.
  2. For template/override fixtures: run references/template-verification.md.

Phase 2: Mutation Testing

Consult references/scenarios/index.md for the full scenario catalog. For each scenario:

  1. Read the live CR: KUBECONFIG=$(pwd)/kubeconfig.yaml kubectl get multigrescluster <name> -n <ns> -o yaml
  2. Save pre-mutation state for teardown.
  3. Construct and apply the correct patch based on the actual CR.
  4. Verify using the appropriate protocol:
  • Fast-path eligible → references/fast-path-verification.md
  • Concurrent mutations → references/concurrent-mutations.md
  • Negative assertions → references/negative-assertions.md
  • All others → Stability Verification Protocol below
  1. Log results, teardown if applicable, verify stability again. Proceed only after confirmed stable.

Stability Verification Protocol

Run after EVERY cluster change: deploy, mutation, teardown.

Tiers
TierWhenCRD TimeoutMin Observation
quickConfig-only (annotations, PVC policy)3 min60s
standardScale, resources, images5 min60s
lifecycleDeploy, delete-recreate, template switches10 min90s
Step 1 — CRD Phase Gate

Poll .status.phase every 5s until Healthy:

bash
KUBECONFIG=$(pwd)/kubeconfig.yaml kubectl get multigrescluster <name> -n <ns> -o jsonpath='{.status.phase}'

If Degraded/Failed persists >2 min or timeout reached → STOP, investigate.

Step 2 — Grace Period

The observer suppresses pool pod errors for 2 min after creation. Wait until ALL pool pods are at least 150s old:

bash
KUBECONFIG=$(pwd)/kubeconfig.yaml kubectl get pods -n <ns> -l app.kubernetes.io/component=shard-pool \
-o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.metadata.creationTimestamp}{"\n"}{end}'
Step 3 — Stability Observation

Poll every 10s, tracking: consecutive_clean (polls with 0 errors/fatals), all_findings (every error/fatal seen), elapsed.

bash
observer /api/status | jq '{
summary: .summary,
errors: [(.findings // [])[] | select(.level == "error" or .level == "fatal")],
warns: [(.findings // [])[] | select(.level == "warn")]
}'

Exit conditions:

ConditionAction
consecutive_clean >= 3 AND elapsed >= min_observationSTABLE
Error persists > 3 minUNSTABLE — investigate
elapsed >= 5 min without stabilityTIMEOUT — investigate

A finding "persists" when the same check+component appears in consecutive polls. Use /api/history to classify.

Step 4 — Result Classification
  • STABLE (clean): No findings during observation.
  • STABLE (transients observed): Errors appeared then resolved. List each with check, component, message, duration. Report these — they may indicate intermittent bugs.
  • UNSTABLE: Persistent errors. Investigate via references/deep-investigation.md.
Step 5 — Post-Stability Checks

Run all three after stability is confirmed:

Warn review:

bash
observer /api/status | jq '[(.findings // [])[] | select(.level == "warn")]'

Note persistent warnings (replication lag, WAL replay paused).

Primary verification — catches stale podRoles bugs:

bash
# Exactly 1 PRIMARY per pool per cell in CRD
kubectl get shard -n <ns> -o json | jq '[.items[].status.podRoles | to_entries[] | select(.value == "PRIMARY")] | length'
# Cross-reference with actual PG state
for pod in $(kubectl get pods -n <ns> -l app.kubernetes.io/component=shard-pool -o name); do
echo -n "$pod: "
kubectl exec -n <ns> $pod -c postgres -- psql -h 127.0.0.1 -p 5432 -U postgres -tAc "SELECT CASE WHEN pg_is_in_recovery() THEN 'REPLICA' ELSE 'PRIMARY' END"
done

CRD PRIMARY must match SQL pg_is_in_recovery() = false. Mismatch → trigger reconcile, report as "error".

Observer history assertion:

bash
observer /api/history | jq '{persistent: .persistent, flapping: .flapping, transientCount: (.transient | length)}'

Assert persistent == [] and flapping == []. Investigate before proceeding if not.

Execution Modes

ModeWhat it doesWhen to use
smokeDeploy → baseline verification. Template fixtures include TVP.Quick sanity check
coresmoke + scale-up, scale-down, update-resources, delete-pool-podStandard coverage
fullAll applicable scenarios including concurrent, webhooks, negativesThorough testing

Default to core when unspecified.

Fixture Selection

FixtureKind-ReadyTVPTests
minimal-retainYes—Core logic, PVC retention
minimal-deleteYes—PVC deletion paths
templated-fullYes (prereqs)FullTemplate resolution
overrides-complexYes (prereqs)OverrideOverride merging
external-etcd-mixedYes (prereqs)—External topology server
s3-backupNeeds real S3—Backup with S3
multi-cell-quorumYes (heavy)—Multi-cell, quorum
postgres-config-refYes (prereqs)—ConfigMap-based postgresql.conf, rolling update on content change
external-adminwebYes—External admin web IPs, annotations, status
multi-cell-topologykind-deploy-topology—Zone-aware scheduling
observability-customYes (prereqs)—Custom observability

Prerequisites are self-contained (except s3-backup). Deploy prereqs first, wait for pods Running.

Recommended order: minimal-retain → minimal-delete → templated-full → overrides-complex → external-etcd-mixed → multi-cell-topology

Reporting

Create report at agent-docs/exerciser/exercise-run-<YYYY-MM-DD-HHMMSS>.md:

  • Environment (cluster, observer, operator image, multigres images)
  • Per-fixture: baseline, each scenario (mutation, stability result, all findings, teardown)
  • Summary: fixtures tested, scenarios run, bugs found, transients observed

Reference Documents

ReferenceWhen to Read
references/scenarios/index.mdBefore mutations — master scenario lookup with files, tiers, fixtures
references/scenarios/core.mdCore mode scenarios (scale, resources, delete-pod)
references/scenarios/*.mdLoad specific scenario files as directed by the index
references/operator-knowledge.mdWhen investigating bugs
references/fast-path-verification.mdFor fast-path eligible scenarios
references/template-verification.mdAfter deploying template/override fixtures
references/negative-assertions.mdFor deletion, rejection, cleanup scenarios
references/deep-investigation.mdWhen UNSTABLE
references/concurrent-mutations.mdFull mode concurrent testing
references/topology-awareness.mdTopology fixtures or topology warnings
patches/Reusable mutation scripts

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
260
Repository forks
28
7-day trend score
28

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/multigres/multigres-operator/exercise-cluster/badge)](https://verified-skill.com/skills/multigres/multigres-operator/exercise-cluster)

Something wrong with this skill or its page? Tell us.