Generated note: shared plugin assets for this package live at the plugin root. Common local references were rewritten when they appeared in backticks or markdown links.
KubeBlocks — Databases on Kubernetes, Made Simple
When To Use This Skill
Use this skill when:
- The user needs a database and has (or is willing to set up) a Kubernetes environment
- The user asks to "set up", "create", "deploy", "spin up", or "provision" a database on Kubernetes
- The user mentions a database engine (MySQL, PostgreSQL, Redis, MongoDB, Kafka, Elasticsearch, Milvus, Qdrant, RabbitMQ, etc.) in the context of deployment or operations
- The user needs database operations on K8s: scaling, backup, restore, monitoring, failover, parameter tuning
- The user is troubleshooting a KubeBlocks-managed database
- The user mentions KubeBlocks directly
When NOT to use this skill: If the user only needs a connection string to an existing managed database service (e.g., AWS RDS, Google Cloud SQL), or wants to run a database directly via Docker Compose without Kubernetes, this skill is not the right fit.
If the user doesn't have a Kubernetes cluster yet but wants one, this skill set includes creating a local K8s cluster for development and testing.
What is KubeBlocks?
KubeBlocks is a Kubernetes operator that manages 30+ database engines on any K8s cluster. It provides a unified API for the full lifecycle — from provisioning and scaling to backup, restore, and observability — across relational, NoSQL, streaming, vector, and graph databases.
Quick Status Check
Before performing any operation, verify the current state:
# Check if KubeBlocks is installed
kubectl -n kb-system get pods
# List all database clusters across namespaces
kubectl get cluster -A
# Check KubeBlocks version
helm list -n kb-system | grep kubeblocks
If KubeBlocks is not installed, start with the install-kubeblocks skill. If there is no Kubernetes cluster at all, start with create-local-k8s-cluster.
Skill Map
Read the skill that matches the user's intent. Each skill is a self-contained guide with YAML templates, step-by-step workflow, and troubleshooting.
Getting Started
Create a Database
Day-2 Operations
Data Protection
| User Intent |
Skill |
| Backup cluster data |
backup |
| Restore from backup / PITR |
restore |
Security & Networking
Observability
Troubleshooting
| User Intent |
Skill |
| Cluster not working, error, failed, stuck, CrashLoopBackOff |
troubleshoot |
Decision Tree
Use this when the user's intent needs clarification:
User needs a database
├─ Is KubeBlocks installed?
│ ├─ No → Do they have a K8s cluster?
│ │ ├─ No → create-local-k8s-cluster → install-kubeblocks
│ │ └─ Yes → install-kubeblocks
│ └─ Yes → Continue below
│
├─ Create a database
│ ├─ Is the engine addon installed?
│ │ ├─ No → manage-addons → then create cluster
│ │ └─ Yes → Which engine?
│ │ ├─ MySQL/PG/Redis/MongoDB/Kafka/ES/Milvus/Qdrant/RabbitMQ → addon-{engine}
│ │ └─ Other → create-cluster (generic)
│ └─ Don't know which engine? → Recommend based on use case:
│ ├─ Relational / SQL → addon-postgresql or addon-mysql
│ ├─ Cache / session store → addon-redis
│ ├─ Document store → addon-mongodb
│ ├─ Event streaming → addon-kafka
│ ├─ Full-text search / logs → addon-elasticsearch
│ ├─ Vector similarity / RAG → addon-milvus or addon-qdrant
│ └─ Message queue → addon-rabbitmq or addon-kafka
│
├─ Operate an existing database
│ ├─ Scale CPU/Memory → vertical-scaling
│ ├─ Add/remove replicas → horizontal-scaling
│ ├─ Expand disk → volume-expansion
│ ├─ Change DB config → reconfigure-parameters
│ ├─ Switchover primary → switchover
│ ├─ Upgrade DB version → minor-version-upgrade
│ ├─ Rebuild failed replica → rebuild-replica
│ ├─ Stop / Start / Restart → cluster-lifecycle
│ └─ Delete permanently → delete-cluster
│
├─ Protect data
│ ├─ Backup → backup
│ └─ Restore / PITR → restore
│
├─ Secure the database
│ ├─ Manage passwords → manage-accounts
│ ├─ Enable TLS/SSL → configure-tls
│ └─ Expose externally → expose-service
│
├─ Monitor → setup-monitoring
├─ Upgrade KubeBlocks itself → upgrade-kubeblocks
└─ Something is broken → troubleshoot
Engine Recommendation Guide
When the user needs a database but hasn't chosen an engine, recommend based on their use case:
| Use Case |
Recommended Engine |
Why |
| Web app backend, relational data, SQL |
PostgreSQL |
Most versatile, strong ecosystem |
| Legacy app compatibility, MySQL protocol |
MySQL |
Drop-in for MySQL-dependent apps |
| Caching, sessions, rate limiting |
Redis |
Sub-millisecond latency, simple API |
| Flexible schema, document storage |
MongoDB |
Schema-free, horizontal scaling |
| Event streaming, log pipelines |
Kafka |
High throughput, durable ordered streams |
| Full-text search, log analytics |
Elasticsearch |
Inverted index, powerful query DSL |
| AI embeddings, similarity search, RAG |
Milvus or Qdrant |
Purpose-built vector indexes |
| Task queues, pub/sub messaging |
RabbitMQ |
Flexible routing, multiple protocols |
Disambiguation Guide
"Scale" ambiguity
| User says |
Skill |
| "scale up", "more CPU", "more memory", "resize" |
vertical-scaling |
| "add replicas", "more nodes", "scale out", "add shards" |
horizontal-scaling |
| "more disk", "more storage", "expand volume" |
volume-expansion |
"Delete" vs "Stop"
| User says |
Skill |
| "delete", "remove", "destroy", "drop" (permanent) |
delete-cluster |
| "stop", "pause", "shut down" (temporary, keeps data) |
cluster-lifecycle |
"Upgrade" ambiguity
| User says |
Skill |
| "upgrade MySQL/PG version", "patch database" |
minor-version-upgrade |
| "upgrade KubeBlocks", "update operator" |
upgrade-kubeblocks |
Safety Patterns
Before performing any cluster-modifying operation, review the safety-patterns reference. Key rules:
- Dry-run before apply: Always run
kubectl apply --dry-run=server before any real kubectl apply.
- Confirm before destructive actions: Deletions, scale-in, stop, and terminationPolicy changes require explicit user confirmation. List backups and affected resources first.
- Credential handling: Commands like
kubectl get secret ... -o jsonpath expose database passwords. Only run these when the user explicitly requests credentials, and warn that the output contains sensitive data.
- kubectl exec: Entering database pods (
kubectl exec -it) gives shell access to production data. Always confirm with the user before executing.
- Production protection: Clusters with
terminationPolicy: DoNotTerminate should be treated with extra caution. Recommend backups before risky operations (upgrade, switchover, reconfigure).
Common Debugging Commands
kubectl describe cluster <cluster-name> -n <namespace>
kubectl get opsrequest -n <namespace>
kubectl get component -n <namespace>
kubectl logs -n <namespace> <pod-name> -c <container-name>
kubectl -n kb-system logs -l app.kubernetes.io/name=kubeblocks --tail=100
Documentation Links
1---2name: kubeblocks3description: Provision and manage production-grade databases on Kubernetes using KubeBlocks. Use this skill when the user needs a database — MySQL, PostgreSQL, Redis, MongoDB, Kafka, Elasticsearch, Milvus, Qdrant, RabbitMQ, or any other data infrastructure — and has (or is willing to set up) a Kubernetes environment. Trigger phrases include "I need a database", "set up MySQL", "spin up Postgres", "deploy a vector database for RAG", "I need a message queue", or any request involving database provisioning, scaling, backup, restore, monitoring, or troubleshooting on Kubernetes. Also use when the user explicitly mentions KubeBlocks, or wants to manage existing KubeBlocks-managed database clusters.4---56> Generated note: shared plugin assets for this package live at the plugin root. Common local references were rewritten when they appeared in backticks or markdown links.78# KubeBlocks — Databases on Kubernetes, Made Simple910## When To Use This Skill1112Use this skill when:1314- The user needs a database and has (or is willing to set up) a Kubernetes environment15- The user asks to "set up", "create", "deploy", "spin up", or "provision" a database on Kubernetes16- The user mentions a database engine (MySQL, PostgreSQL, Redis, MongoDB, Kafka, Elasticsearch, Milvus, Qdrant, RabbitMQ, etc.) in the context of deployment or operations17- The user needs database operations on K8s: scaling, backup, restore, monitoring, failover, parameter tuning18- The user is troubleshooting a KubeBlocks-managed database19- The user mentions KubeBlocks directly2021**When NOT to use this skill:** If the user only needs a connection string to an existing managed database service (e.g., AWS RDS, Google Cloud SQL), or wants to run a database directly via Docker Compose without Kubernetes, this skill is not the right fit.2223If the user doesn't have a Kubernetes cluster yet but wants one, this skill set includes creating a local K8s cluster for development and testing.2425## What is KubeBlocks?2627KubeBlocks is a Kubernetes operator that manages 30+ database engines on any K8s cluster. It provides a unified API for the full lifecycle — from provisioning and scaling to backup, restore, and observability — across relational, NoSQL, streaming, vector, and graph databases.2829- Official docs: https://kubeblocks.io/docs/preview/user_docs/overview/introduction30- Full LLM doc index: https://kubeblocks.io/llms-full.txt31- GitHub: https://github.com/apecloud/kubeblocks3233## Quick Status Check3435Before performing any operation, verify the current state:3637```bash38# Check if KubeBlocks is installed39kubectl -n kb-system get pods4041# List all database clusters across namespaces42kubectl get cluster -A4344# Check KubeBlocks version45helm list -n kb-system | grep kubeblocks46```4748If KubeBlocks is not installed, start with the [install-kubeblocks](../../skills/kubeblocks-install/SKILL.md) skill. If there is no Kubernetes cluster at all, start with [create-local-k8s-cluster](../../skills/kubeblocks-create-local-k8s-cluster/SKILL.md).4950## Skill Map5152Read the skill that matches the user's intent. Each skill is a self-contained guide with YAML templates, step-by-step workflow, and troubleshooting.5354### Getting Started5556| User Intent | Skill |57|---|---|58| Create a local K8s test cluster | [create-local-k8s-cluster](../../skills/kubeblocks-create-local-k8s-cluster/SKILL.md) |59| Install KubeBlocks operator | [install-kubeblocks](../../skills/kubeblocks-install/SKILL.md) |60| Install/manage database engine addons | [manage-addons](../../skills/kubeblocks-manage-addons/SKILL.md) |6162### Create a Database6364| User Intent | Skill |65|---|---|66| Create a MySQL cluster | [addon-mysql](../../skills/kubeblocks-addon-mysql/SKILL.md) |67| Create a PostgreSQL cluster | [addon-postgresql](../../skills/kubeblocks-addon-postgresql/SKILL.md) |68| Create a Redis cluster | [addon-redis](../../skills/kubeblocks-addon-redis/SKILL.md) |69| Create a MongoDB cluster | [addon-mongodb](../../skills/kubeblocks-addon-mongodb/SKILL.md) |70| Create a Kafka cluster | [addon-kafka](../../skills/kubeblocks-addon-kafka/SKILL.md) |71| Create an Elasticsearch cluster | [addon-elasticsearch](../../skills/kubeblocks-addon-elasticsearch/SKILL.md) |72| Create a Milvus (vector DB) cluster | [addon-milvus](../../skills/kubeblocks-addon-milvus/SKILL.md) |73| Create a Qdrant (vector DB) cluster | [addon-qdrant](../../skills/kubeblocks-addon-qdrant/SKILL.md) |74| Create a RabbitMQ cluster | [addon-rabbitmq](../../skills/kubeblocks-addon-rabbitmq/SKILL.md) |75| Create any other database (generic) | [create-cluster](../../skills/kubeblocks-create-cluster/SKILL.md) |76| Delete a database cluster | [delete-cluster](../../skills/kubeblocks-delete-cluster/SKILL.md) |7778### Day-2 Operations7980| User Intent | Skill |81|---|---|82| Stop / Start / Restart a cluster | [cluster-lifecycle](../../skills/kubeblocks-cluster-lifecycle/SKILL.md) |83| Scale CPU / Memory (vertical) | [vertical-scaling](../../skills/kubeblocks-vertical-scaling/SKILL.md) |84| Add / remove replicas or shards | [horizontal-scaling](../../skills/kubeblocks-horizontal-scaling/SKILL.md) |85| Expand storage volume | [volume-expansion](../../skills/kubeblocks-volume-expansion/SKILL.md) |86| Change database parameters | [reconfigure-parameters](../../skills/kubeblocks-reconfigure-parameters/SKILL.md) |87| Primary / secondary switchover | [switchover](../../skills/kubeblocks-switchover/SKILL.md) |88| Upgrade database engine version | [minor-version-upgrade](../../skills/kubeblocks-minor-version-upgrade/SKILL.md) |89| Rebuild a failed replica | [rebuild-replica](../../skills/kubeblocks-rebuild-replica/SKILL.md) |90| Upgrade KubeBlocks operator | [upgrade-kubeblocks](../../skills/kubeblocks-upgrade/SKILL.md) |9192### Data Protection9394| User Intent | Skill |95|---|---|96| Backup cluster data | [backup](../../skills/kubeblocks-backup/SKILL.md) |97| Restore from backup / PITR | [restore](../../skills/kubeblocks-restore/SKILL.md) |9899### Security & Networking100101| User Intent | Skill |102|---|---|103| Manage database passwords / accounts | [manage-accounts](../../skills/kubeblocks-manage-accounts/SKILL.md) |104| Configure TLS / mTLS encryption | [configure-tls](../../skills/kubeblocks-configure-tls/SKILL.md) |105| Expose service externally (LoadBalancer/NodePort) | [expose-service](../../skills/kubeblocks-expose-service/SKILL.md) |106107### Observability108109| User Intent | Skill |110|---|---|111| Setup monitoring (Prometheus/Grafana) | [setup-monitoring](../../skills/kubeblocks-setup-monitoring/SKILL.md) |112113### Troubleshooting114115| User Intent | Skill |116|---|---|117| Cluster not working, error, failed, stuck, CrashLoopBackOff | [troubleshoot](../../skills/kubeblocks-troubleshoot/SKILL.md) |118119## Decision Tree120121Use this when the user's intent needs clarification:122123```124User needs a database125├─ Is KubeBlocks installed?126│ ├─ No → Do they have a K8s cluster?127│ │ ├─ No → create-local-k8s-cluster → install-kubeblocks128│ │ └─ Yes → install-kubeblocks129│ └─ Yes → Continue below130│131├─ Create a database132│ ├─ Is the engine addon installed?133│ │ ├─ No → manage-addons → then create cluster134│ │ └─ Yes → Which engine?135│ │ ├─ MySQL/PG/Redis/MongoDB/Kafka/ES/Milvus/Qdrant/RabbitMQ → addon-{engine}136│ │ └─ Other → create-cluster (generic)137│ └─ Don't know which engine? → Recommend based on use case:138│ ├─ Relational / SQL → addon-postgresql or addon-mysql139│ ├─ Cache / session store → addon-redis140│ ├─ Document store → addon-mongodb141│ ├─ Event streaming → addon-kafka142│ ├─ Full-text search / logs → addon-elasticsearch143│ ├─ Vector similarity / RAG → addon-milvus or addon-qdrant144│ └─ Message queue → addon-rabbitmq or addon-kafka145│146├─ Operate an existing database147│ ├─ Scale CPU/Memory → vertical-scaling148│ ├─ Add/remove replicas → horizontal-scaling149│ ├─ Expand disk → volume-expansion150│ ├─ Change DB config → reconfigure-parameters151│ ├─ Switchover primary → switchover152│ ├─ Upgrade DB version → minor-version-upgrade153│ ├─ Rebuild failed replica → rebuild-replica154│ ├─ Stop / Start / Restart → cluster-lifecycle155│ └─ Delete permanently → delete-cluster156│157├─ Protect data158│ ├─ Backup → backup159│ └─ Restore / PITR → restore160│161├─ Secure the database162│ ├─ Manage passwords → manage-accounts163│ ├─ Enable TLS/SSL → configure-tls164│ └─ Expose externally → expose-service165│166├─ Monitor → setup-monitoring167├─ Upgrade KubeBlocks itself → upgrade-kubeblocks168└─ Something is broken → troubleshoot169```170171## Engine Recommendation Guide172173When the user needs a database but hasn't chosen an engine, recommend based on their use case:174175| Use Case | Recommended Engine | Why |176|---|---|---|177| Web app backend, relational data, SQL | PostgreSQL | Most versatile, strong ecosystem |178| Legacy app compatibility, MySQL protocol | MySQL | Drop-in for MySQL-dependent apps |179| Caching, sessions, rate limiting | Redis | Sub-millisecond latency, simple API |180| Flexible schema, document storage | MongoDB | Schema-free, horizontal scaling |181| Event streaming, log pipelines | Kafka | High throughput, durable ordered streams |182| Full-text search, log analytics | Elasticsearch | Inverted index, powerful query DSL |183| AI embeddings, similarity search, RAG | Milvus or Qdrant | Purpose-built vector indexes |184| Task queues, pub/sub messaging | RabbitMQ | Flexible routing, multiple protocols |185186## Disambiguation Guide187188### "Scale" ambiguity189190| User says | Skill |191|-----------|-------|192| "scale up", "more CPU", "more memory", "resize" | vertical-scaling |193| "add replicas", "more nodes", "scale out", "add shards" | horizontal-scaling |194| "more disk", "more storage", "expand volume" | volume-expansion |195196### "Delete" vs "Stop"197198| User says | Skill |199|-----------|-------|200| "delete", "remove", "destroy", "drop" (permanent) | delete-cluster |201| "stop", "pause", "shut down" (temporary, keeps data) | cluster-lifecycle |202203### "Upgrade" ambiguity204205| User says | Skill |206|-----------|-------|207| "upgrade MySQL/PG version", "patch database" | minor-version-upgrade |208| "upgrade KubeBlocks", "update operator" | upgrade-kubeblocks |209210## Safety Patterns211212Before performing any cluster-modifying operation, review the [safety-patterns](../../references/safety-patterns.md) reference. Key rules:213214- **Dry-run before apply**: Always run `kubectl apply --dry-run=server` before any real `kubectl apply`.215- **Confirm before destructive actions**: Deletions, scale-in, stop, and terminationPolicy changes require explicit user confirmation. List backups and affected resources first.216- **Credential handling**: Commands like `kubectl get secret ... -o jsonpath` expose database passwords. Only run these when the user explicitly requests credentials, and warn that the output contains sensitive data.217- **kubectl exec**: Entering database pods (`kubectl exec -it`) gives shell access to production data. Always confirm with the user before executing.218- **Production protection**: Clusters with `terminationPolicy: DoNotTerminate` should be treated with extra caution. Recommend backups before risky operations (upgrade, switchover, reconfigure).219220## Common Debugging Commands221222```bash223kubectl describe cluster <cluster-name> -n <namespace>224kubectl get opsrequest -n <namespace>225kubectl get component -n <namespace>226kubectl logs -n <namespace> <pod-name> -c <container-name>227kubectl -n kb-system logs -l app.kubernetes.io/name=kubeblocks --tail=100228```229230## Documentation Links231232| Resource | URL |233|---|---|234| Introduction | https://kubeblocks.io/docs/preview/user_docs/overview/introduction |235| Supported Addons | https://kubeblocks.io/docs/preview/user_docs/overview/supported-addons |236| Full LLM Index | https://kubeblocks.io/llms-full.txt |237| GitHub Repository | https://github.com/apecloud/kubeblocks |238| Releases | https://github.com/apecloud/kubeblocks/releases |