Install KubeBlocks
KubeBlocks is Kubernetes-native, you can use Helm or kubectl with a YAML file to install it.
To try out KubeBlocks on your local host, you can use the Playground or create a local Kubernetes test cluster first and then follow the steps in this tutorial to install KubeBlocks.
Environment preparation
Resource Requirements | ||
---|---|---|
Control Plane | It is recommended to create 1 node with 4 cores, 4GB memory and 50GB storage. | |
Data Plane | MySQL | It is recommended to create at least 3 nodes with 2 cores, 4GB memory and 50GB storage. |
PostgreSQL | It is recommended to create at least 2 nodes with 2 cores, 4GB memory and 50GB storage. | |
Redis | It is recommended to create at least 2 nodes with 2 cores, 4GB memory and 50GB storage. | |
MongoDB | It is recommended to create at least 3 nodes with 2 cores, 4GB memory and 50GB storage. |
Installation steps
- Install with Helm
- Install with kubectl
Use Helm and follow the steps below to install KubeBlocks.
Create dependent CRDs. Specify the version you want to install.
kubectl create -f https://github.com/apecloud/kubeblocks/releases/download/vx.y.z/kubeblocks_crds.yaml
You can view all versions of kubeblocks, including alpha and beta releases, on the kubeblocks releases list.
To get stable releases, use this command:
curl -s "https://api.github.com/repos/apecloud/kubeblocks/releases?per_page=100&page=1" | jq -r '.[] | select(.prerelease == false) | .tag_name' | sort -V -r
Add the KubeBlocks Helm repo.
helm repo add kubeblocks https://apecloud.github.io/helm-charts
helm repo updateInstall KubeBlocks.
helm install kubeblocks kubeblocks/kubeblocks --namespace kb-system --create-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 \
--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" }]'If you want to install KubeBlocks with a specified version, follow the steps below.
View the available versions in the KubeBlocks Release.
Specify a version with
--version
and run the command below.helm install kubeblocks kubeblocks/kubeblocks --namespace kb-system --create-namespace --version="x.y.z"
noteBy default, the latest release version is installed.
Like any other resource in Kubernetes, KubeBlocks can be installed through a YAML manifest applied via kubectl
.
Copy the URL of the
kubeblocks.yaml file
for the version you need from the Assets on the KubeBlocks Release page.Replace the YAML file URL in the command below and run this command to install KubeBlocks.
kubectl create -f https://github.com/apecloud/kubeblocks/releases/download/vx.y.x/kubeblocks.yaml
Verify KubeBlocks installation
Run the following command to check whether KubeBlocks is installed successfully.
kubectl -n kb-system get pods
Result
If the KubeBlocks Workloads are all ready, KubeBlocks has been installed successfully.
NAME READY STATUS RESTARTS AGE
alertmanager-webhook-adaptor-8dfc4878d-svzrc 2/2 Running 0 3m56s
grafana-77dfd6959-4gnhp 1/1 Running 0 3m56s
kb-addon-snapshot-controller-546f84b78d-8rjs4 1/1 Running 0 3m56s
kubeblocks-7cf7745685-ddlwk 1/1 Running 0 4m39s
kubeblocks-dataprotection-95fbc79cc-b544l 1/1 Running 0 4m39s
prometheus-alertmanager-5c9fc88996-qltrk 2/2 Running 0 3m56s
prometheus-kube-state-metrics-5dbbf757f5-db9v6 1/1 Running 0 3m56s
prometheus-node-exporter-r6kvl 1/1 Running 0 3m56s
prometheus-pushgateway-8555888c7d-xkgfc 1/1 Running 0 3m56s
prometheus-server-5759b94fc8-686xp 2/2 Running 0 3m56s