skills/kubeblocks-install/SKILL.md
Install the KubeBlocks operator on any Kubernetes cluster via Helm. Handles version selection, environment detection (local dev vs production, China mainland vs global network), image registry configuration, prerequisite checks, and post-install verification. Use when the user asks to install, deploy, or set up KubeBlocks. NOT for upgrading an existing KubeBlocks installation (see KubeBlocks official upgrade docs), uninstalling KubeBlocks (see the Uninstall section in this skill), or creating database clusters after installation (see kubeblocks-create-cluster or kubeblocks-addon-* skills).
npx skillsauth add apecloud/kubeblocks-skills kubeblocks-installInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
KubeBlocks is a Kubernetes operator for managing databases (MySQL, PostgreSQL, Redis, MongoDB, Kafka, etc.). This skill guides installation of the KubeBlocks operator onto any Kubernetes cluster.
Official docs: https://kubeblocks.io/docs/preview/user_docs/overview/install-kubeblocks Full doc index: https://kubeblocks.io/llms-full.txt
Copy this checklist and track progress:
- [ ] Step 1: Check prerequisites
- [ ] Step 2: Determine version
- [ ] Step 3: Detect network environment
- [ ] Step 4: Install CRDs
- [ ] Step 5: Install KubeBlocks via Helm
- [ ] Step 6: Verify installation
This skill requires an existing Kubernetes cluster. If the user does not have one, point them to the create-local-k8s-cluster skill first.
Run these checks and install any missing tools automatically:
kubectl version --client 2>/dev/null
If the command fails (not found), install it:
# macOS
brew install kubectl
# Linux (amd64)
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl && sudo mv kubectl /usr/local/bin/
# Linux (arm64)
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl"
chmod +x kubectl && sudo mv kubectl /usr/local/bin/
helm version --short 2>/dev/null
If the command fails (not found), install it:
# macOS
brew install helm
# Linux (script, works on amd64/arm64)
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
kubectl get nodes
If this fails, the user has no accessible Kubernetes cluster. Stop here and tell the user:
~/.kube/config or $KUBECONFIG)Resource requirements (minimum):
Ask the user if they want a specific version. If not specified, fetch the latest stable release:
# Get latest stable version
curl -s https://api.github.com/repos/apecloud/kubeblocks/releases/latest | grep '"tag_name"' | cut -d'"' -f4
To list all available versions:
# Via GitHub API
curl -s https://api.github.com/repos/apecloud/kubeblocks/tags | grep '"name"' | head -20 | cut -d'"' -f4
# Or via Helm (after adding repo)
helm search repo kubeblocks/kubeblocks --versions
Known stable releases: v1.0.2, v1.0.1, v1.0.0, v0.9.5, v0.9.4, v0.9.3, v0.9.2, v0.9.1, v0.9.0
Always tell the user which version is being installed.
Determine which image registry to use.
Default (global access / docker.io available):
docker.ioapecloudChina mainland (docker.io blocked/slow):
apecloud-registry.cn-zhangjiakou.cr.aliyuncs.comapecloudHow to detect: Ask the user, or run a quick test:
# Test docker.io connectivity (timeout 5s)
curl -sS --connect-timeout 5 https://registry-1.docker.io/v2/ > /dev/null 2>&1 && echo "docker.io: reachable" || echo "docker.io: unreachable, use China mirror"
# Replace {VERSION} with the chosen version, e.g. v1.0.2
kubectl create -f https://github.com/apecloud/kubeblocks/releases/download/{VERSION}/kubeblocks_crds.yaml
For K8s <= 1.23, add --validate=false:
kubectl create -f https://github.com/apecloud/kubeblocks/releases/download/{VERSION}/kubeblocks_crds.yaml --validate=false
helm repo add kubeblocks https://apecloud.github.io/helm-charts
helm repo update
Global network (docker.io accessible):
helm install kubeblocks kubeblocks/kubeblocks \
--namespace kb-system --create-namespace \
--version {VERSION} \
--set image.registry=docker.io \
--set dataProtection.image.registry=docker.io \
--set addonChartsImage.registry=docker.io
China mainland network:
helm install kubeblocks kubeblocks/kubeblocks \
--namespace kb-system --create-namespace \
--version {VERSION} \
--set image.registry=apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com \
--set dataProtection.image.registry=apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com \
--set addonChartsImage.registry=apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com
# Custom tolerations (e.g. for dedicated control-plane nodes)
--set-json 'tolerations=[{"key":"control-plane-taint","operator":"Equal","effect":"NoSchedule","value":"true"}]'
# Skip auto-installing default addons (lightweight install)
--set autoInstalledAddons="{}"
# Enable in-place vertical scaling
--set featureGates.inPlacePodVerticalScaling.enabled=true
For the full options reference, see reference.md.
# Check pods in kb-system namespace
kubectl -n kb-system get pods
# Expected: kubeblocks and kubeblocks-dataprotection pods in Running state
# Example output:
# NAME READY STATUS RESTARTS AGE
# kubeblocks-7cf7745685-ddlwk 1/1 Running 0 2m
# kubeblocks-dataprotection-95fbc79cc-b544l 1/1 Running 0 2m
If pods are not Running, check events:
kubectl -n kb-system describe pods
kubectl -n kb-system get events --sort-by='.lastTimestamp'
Installation success does not mean the environment is ready for database rollout.
Before creating the first MySQL / PostgreSQL / Redis / MongoDB / Kafka cluster, run kubeblocks-preflight to decide:
CRD install fails with x-kubernetes-validations error:
--validate=false to the kubectl create command.Image pull errors:
helm get values kubeblocks -n kb-systemHelm install timeout:
kubectl describe nodes--set autoInstalledAddons="{}"KubeBlocks already installed:
helm list -n kb-system | grep kubeblockshelm upgrade kubeblocks kubeblocks/kubeblocks --namespace kb-system --version {VERSION}See reference.md for detailed uninstall instructions.
Quick uninstall:
# Delete all clusters and backups first
kubectl get cluster -A
kubectl delete cluster --all -A
# Uninstall addons
helm list -n kb-system | grep kb-addon | awk '{print $1}' | xargs -I {} helm -n kb-system uninstall {}
# Uninstall KubeBlocks
helm uninstall kubeblocks --namespace kb-system
# Remove CRDs
kubectl get crd -o name | grep kubeblocks.io | xargs kubectl delete
devops
Expand persistent volume storage for KubeBlocks database clusters via OpsRequest. Requires the StorageClass to support volume expansion (allowVolumeExpansion=true). Use when the user needs more disk space, wants to increase storage, expand volumes, or resize PVCs. NOT for changing CPU/memory (see vertical-scaling) or adding more replicas (see horizontal-scaling). Note that volume shrinking is not supported by Kubernetes.
data-ai
Scale CPU and memory resources for KubeBlocks database clusters via OpsRequest (vertical scaling). Supports in-place updates when the feature gate is enabled. Use when the user wants to change, increase, decrease, resize, or adjust CPU or memory resources of a database cluster. NOT for adding/removing replicas or shards (see horizontal-scaling) or expanding disk storage (see volume-expansion).
data-ai
Upgrade the KubeBlocks operator itself via Helm. Covers update operator, upgrade to v1.0, update kubeblocks version, and CRD updates. Use when the user wants to upgrade KubeBlocks, update the operator, or upgrade to a new KubeBlocks release. NOT for upgrading database engine versions (see minor-version-upgrade).
development
Diagnostic guide for KubeBlocks-managed database clusters. Use when the user reports troubleshoot, debug, diagnose, not working, error, failed, stuck, CrashLoopBackOff, cluster exception, or similar problems with their database cluster. This skill guides the agent through diagnostic steps — it does NOT perform actions.