Getting Started
Concepts and Features
Backup and Restore
In Place Update
Instance Template
Trouble Shooting
References
Upgrade KubeBlocks
This guide covers KubeBlocks deployment on existing Kubernetes clusters. Choose your preferred installation method:
Component | Database | Recommendation |
---|---|---|
Control Plane | - | 1 node (4 cores, 4GB RAM, 50GB storage) |
Data Plane | MySQL | 2 nodes (2 cores, 4GB RAM, 50GB storage) |
PostgreSQL | 2 nodes (2 cores, 4GB RAM, 50GB storage) | |
Redis | 2 nodes (2 cores, 4GB RAM, 50GB storage) | |
MongoDB | 3 nodes (2 cores, 4GB RAM, 50GB storage) |
Before installation, verify your environment meets these requirements:
kubectl
v1.21+ installed and configured with cluster access# Step 1: Install CRDs
kubectl create -f https://github.com/apecloud/kubeblocks/releases/download/{{VERSION}}/kubeblocks_crds.yaml
# Step 2: Configure Helm Repository
helm repo add kubeblocks https://apecloud.github.io/helm-charts
helm repo update
# Step 3: Deploy KubeBlocks
helm install kubeblocks kubeblocks/kubeblocks --namespace kb-system --create-namespace --version={{VERSION}}
If you are using K8s <= 1.23, you may encounter the following error when installing CRDs:
unknown field "x-kubernetes-validations".... if you choose to ignore these errors, turn validation off with --validate\=false
You can fix this by running the following command:
kubectl create -f https://github.com/apecloud/kubeblocks/releases/download/{{VERSION}}/kubeblocks_crds.yaml --validate\=false
Need a different version?
For other versions, you can find available releases on KubeBlocks Releases or query using:
# Get latest stable release
curl -s https://api.github.com/repos/apecloud/kubeblocks/releases/latest | jq -r '.tag_name'
# Get all releases (including pre-releases)
curl -s https://api.github.com/repos/apecloud/kubeblocks/tags | jq -r '.[0].name'
Before You Begin:
kbcli kubeblocks install --version={{VERSION}} --create-namespace
Need a different version?
List available versions or find other releases:
# List stable releases
kbcli kubeblocks list-versions
# List all releases (including pre-releases)
kbcli kb list-versions --devel --limit=100
Or browse all releases on KubeBlocks Releases.
Version Compatibility
KubeBlocks requires matching major versions between kbcli
and the installed release:
Mismatched major versions may cause unexpected behavior or errors.
By default, KubeBlocks installs in the kb-system
namespace. To specify a different namespace:
kbcli kubeblocks install --version={{VERSION}} --create-namespace --namespace my-namespace
💡 Remember to replace my-namespace
with your desired namespace name.
Run the following command to check whether KubeBlocks is installed successfully.
kubectl -n kb-system get pods
If the KubeBlocks Workloads are all ready, KubeBlocks has been installed successfully.
NAME READY STATUS RESTARTS AGE
kubeblocks-7cf7745685-ddlwk 1/1 Running 0 4m39s
kubeblocks-dataprotection-95fbc79cc-b544l 1/1 Running 0 4m39s
kbcli kubeblocks status
If the KubeBlocks Workloads are all ready, KubeBlocks has been installed successfully.
KubeBlocks is deployed in namespace: kb-system,version: {{VERSION}}
Kubernetes Cluster:
VERSION PROVIDER REGION AVAILABLE ZONES
v1.29.2 Kind
KubeBlocks Workloads:
NAMESPACE KIND NAME READY PODS CPU(CORES) MEMORY(BYTES) CREATED-AT
kb-system Deployment kubeblocks 1/1 N/A N/A May 26,2025 13:53 UTC+0800
kb-system Deployment kubeblocks-dataprotection 1/1 N/A N/A May 26,2025 13:53 UTC+0800
KubeBlocks Addons:
NAME STATUS TYPE PROVIDER
apecloud-mysql Enabled Helm N/A
etcd Enabled Helm N/A
kafka Enabled Helm N/A
Here list some commonly used configurations for KubeBlocks. For more information about KubeBlocks options, please refer to KubeBlocks Options.
Specify image repository by specifying the following parameters.
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
kbcli kubeblocks upgrade --version {{VERSION}} \
--set image.registry=docker.io \
--set dataProtection.image.registry=docker.io \
--set addonChartsImage.registry=docker.io
Here is an introduction to the flags in the above command.
--set image.registry
specifies the KubeBlocks image registry.--set dataProtection.image.registry
specifies the KubeBlocks-DataProtection image registry.--set addonChartsImage.registry
specifies Addon Charts image registry.If you cannot access docker.io
please use following registry and namespace:
If you want to install KubeBlocks with custom tolerations, you can use the following command:
helm install kubeblocks kubeblocks/kubeblocks --namespace kb-system --create-namespace \
--version {{VERSION}} \
--set-json 'tolerations=[ { "key": "control-plane-taint", "operator": "Equal", "effect": "NoSchedule", "value": "true" } ]' \
--set-json 'dataPlane.tolerations=[{ "key": "data-plane-taint", "operator": "Equal", "effect": "NoSchedule", "value": "true"}]'
kbcli kubeblocks install --version {{VERSION}} --create-namespace \
--set image.registry=docker.io \
--set dataProtection.image.registry=docker.io \
--set addonChartsImage.registry=docker.io
helm install kubeblocks kubeblocks/kubeblocks --namespace kb-system --create-namespace \
--version {{VERSION}} \
--set autoInstalledAddons="{}"
To enable in-place vertical scaling for KubeBlocks, set the feature gate parameter during installation or upgrade:
featureGates.inPlacePodVerticalScaling.enabled=true
helm install kubeblocks kubeblocks/kubeblocks \
--namespace kb-system \
--create-namespace \
--version {{VERSION}} \
--set featureGates.inPlacePodVerticalScaling.enabled=true
helm upgrade kubeblocks kubeblocks/kubeblocks \
--namespace kb-system \
--version {{VERSION}} \
--set featureGates.inPlacePodVerticalScaling.enabled=true
kbcli kubeblocks install \
--version={{VERSION}} \
--create-namespace \
--set featureGates.inPlacePodVerticalScaling.enabled=true
kbcli kubeblocks upgrade \
--version={{VERSION}} \
--set featureGates.inPlacePodVerticalScaling.enabled=true
Verification
After installation or upgrade, verify the feature gate is enabled:
kubectl -n kb-system get deployments.apps kubeblocks -oyaml | \
yq '.spec' | \
grep IN_PLACE_POD_VERTICAL_SCALING -A 1
The output should show:
- name: IN_PLACE_POD_VERTICAL_SCALING
value: "true"
Please delete all clusters and backups before uninstalling KubeBlocks and kbcli.
# get cluster and backups
kubectl get cluster -A
kubectl get backup -A
# delete clusters and backups by by namespace
kubectl delete cluster <clusteName> -n <namespace>
kubectl delete backup <clusteName> -n <namespace>
# list all addons
helm list -n kb-system | grep kb-addon
helm list -n kb-system | grep kb-addon | awk '{print $1}' | xargs -I {} helm -n kb-system uninstall {}
While uninstalling, you will get messages like
Release "kb-addon-etcd" uninstalled
These resources were kept due to the resource policy:
[ConfigMap] kafka27-configuration-tpl-1.0.0
[ComponentDefinition] kafka-combine-1.0.0
[ComponentDefinition] kafka-controller-1.0.0
[ComponentDefinition] kafka-exporter-1.0.0
[ComponentDefinition] kafka27-broker-1.0.0
[ComponentDefinition] kafka-broker-1.0.0
Some resources are kept due to resource policy, then check and remove them all
kubectl get componentdefinitions.apps.kubeblocks.io
kubectl get parametersdefinitions.parameters.kubeblocks.io
kubectl get configmap -n kb-system | grep configuration
kubectl get configmap -n kb-system | grep template
For example
kubectl delete componentdefinitions.apps.kubeblocks.io --all
kubectl delete parametersdefinitions.parameters.kubeblocks.io --all
kubectl get configmap -n kb-system | grep configuration | awk '{print $1}' | xargs -I {} kubectl delete -n kb-system cm {}
kubectl get configmap -n kb-system | grep template| awk '{print $1}' | xargs -I {} kubectl delete -n kb-system cm {}
kubectl delete addon.extensions.kubeblocks.io --all
kubectl get crd | grep kubeblocks.io | awk '{print $1}' | while read crd; do
echo "Processing CRD: $crd"
kubectl get "$crd" -o json | jq '.items[] | select(.metadata.finalizers != null) | .metadata.name' -r | while read resource; do
echo "Custom Resource left: $resource in CRD: $crd"
done
done
If the output shows any custom resource left, please remove them all.
helm uninstall kubeblocks --namespace kb-system
Helm does not delete CRD objects. You can delete the ones KubeBlocks created with the following commands:
kubectl get crd -o name | grep kubeblocks.io | xargs kubectl delete
kubectl get crd | grep kubeblocks.io | awk '{print $1}' | while read crd; do
echo "Processing CRD: $crd"
kubectl get "$crd" -o json | jq '.items[] | select(.metadata.finalizers != null) | .metadata.name' -r | while read resource; do
echo "Custom Resource left: $resource in CRD: $crd"
done
done
The output should be empty.
kbcli addon list | grep Enabled
keepResource=false
for all addons# update addons values, to remove annotation 'helm.sh/resource-policy: keep' from ComponentDefinition/ConfigMaps
kbcli addon enable <addonName> --set extra.keepResource=false
For example
kbcli addon enable apecloud-mysql --set extra.keepResource=false
kbcli addon enable etcd --set extra.keepResource=false
kbcli addon enable kafka --set extra.keepResource=false
kbcli addon enable mongodb --set extra.keepResource=false
kbcli addon enable mysql --set extra.keepResource=false
kbcli addon enable postgresql --set extra.keepResource=false
kbcli addon enable redis --set extra.keepResource=false
kbcli addon disable <addonName>
For example,
kbcli addon disable apecloud-mysql
kbcli addon disable etcd
kbcli addon disable kafka
kbcli addon disable mongodb
kbcli addon disable mysql
kbcli addon disable postgresql
kbcli addon disable redis
kubectl get crd | grep kubeblocks.io | awk '{print $1}' | while read crd; do
echo "Processing CRD: $crd"
kubectl get "$crd" -o json | jq '.items[] | select(.metadata.finalizers != null) | .metadata.name' -r | while read resource; do
echo "Custom Resource left: $resource in CRD: $crd"
done
done
If the output shows some custom resource left, please remove them all.
kbcli kubeblocks uninstall
kubectl get crd | grep kubeblocks.io | awk '{print $1}' | while read crd; do
echo "Processing CRD: $crd"
kubectl get "$crd" -o json | jq '.items[] | select(.metadata.finalizers != null) | .metadata.name' -r | while read resource; do
echo "Custom Resource left: $resource in CRD: $crd"
done
done
check there is no ConfigMap leftover:
kubectl get configmap -n kb-system