skills/kubeblocks-upgrade/SKILL.md
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).
npx skillsauth add apecloud/kubeblocks-skills kubeblocks-upgradeInstall 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.
This skill covers upgrading the KubeBlocks operator (the controller that manages database clusters). The upgrade is done via helm upgrade on the kubeblocks chart. Running database clusters are not affected — they keep running during the operator upgrade. After upgrading the operator, addons may need to be upgraded separately.
Official docs: Upgrade to v1.0.x, Upgrade to v0.9.x
- [ ] Step 1: Check current version
- [ ] Step 2: Pre-upgrade checklist
- [ ] Step 3: Update CRDs
- [ ] Step 4: Helm upgrade
- [ ] Step 5: Verify operator pods
- [ ] Step 6: Upgrade addons (optional)
helm list -n kb-system | grep kubeblocks
Or with kbcli: kbcli version
Upgrade paths: | Current | Target v1.0.x | Target v0.9.x | |---------|---------------|---------------| | v1.0.x | ✅ Direct | N/A | | v0.9.x | ❌ Not supported | ✅ Direct | | v0.8.x | ❌ Upgrade to v0.9.x first | ✅ Direct (extra steps) | | v0.7.x or earlier | ❌ Upgrade to v0.8 first | ❌ Upgrade to v0.8 first |
CRDs are separate from the Helm chart. Update them before the helm upgrade:
# Replace {VERSION} with target version, e.g. v1.0.2
kubectl replace -f https://github.com/apecloud/kubeblocks/releases/download/{VERSION}/kubeblocks_crds.yaml
For v0.9.x same-minor upgrade (e.g. v0.9.1 → v0.9.5), you can skip CRD update and use --set crd.enabled=false in Step 4 for faster deployment.
helm repo add kubeblocks https://apecloud.github.io/helm-charts
helm repo update kubeblocks
Global network (docker.io):
helm -n kb-system upgrade kubeblocks kubeblocks/kubeblocks --version {VERSION}
China mainland network:
helm -n kb-system upgrade kubeblocks kubeblocks/kubeblocks --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
v0.9.x same-minor (faster): add --set crd.enabled=false
v0.8 → v0.9: requires --set admissionWebhooks.enabled=true --set admissionWebhooks.ignoreReplicasCheck=true and pre-steps (annotate addons, delete incompatible OpsDefinitions). See upgrade-to-v09-version.
kubectl -n kb-system get pods
Expected: kubeblocks and kubeblocks-dataprotection pods in Running state. Typical: 1–3 min. If stuck >5 min: kubectl -n kb-system describe pods and kubectl -n kb-system logs deployment/kubeblocks.
Addon upgrade may restart clusters. Since v1.0.0, existing clusters are generally not affected by addon upgrade, but test in non-production first.
Upgrade all addons with KubeBlocks:
helm -n kb-system upgrade kubeblocks kubeblocks/kubeblocks --version {VERSION} --set upgradeAddons=true
Upgrade specific addon: see install-addons. For migrating clusters to a new addon version, see migrate-clusters-to-new-addon.
CRD replace fails: For K8s <= 1.23, try kubectl create -f ... || kubectl replace -f .... Add --validate=false if x-kubernetes-validations errors occur.
Image pull errors: Switch to China mirror registry (Step 4b). Verify: helm get values kubeblocks -n kb-system.
Pods not Running: Check kubectl -n kb-system logs deployment/kubeblocks and GitHub Issues.
For dry-run before apply, status confirmation, and production cluster protection, see safety-patterns.md.
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).
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.
data-ai
Perform planned primary-secondary switchover for KubeBlocks database clusters via OpsRequest. Promotes a replica to primary with minimal downtime. Use when the user wants to promote a replica, switch primary, change leader, perform a planned failover, or do maintenance on the current primary node. NOT for unplanned failover recovery (handled automatically by HA middleware like Patroni, Orchestrator, or Sentinel) or restarting all pods (see kubeblocks-cluster-lifecycle).