kb-cloud-installer
A Helm chart for installing/uninstalling/upgrading the KubeBlocks Enterprise, include the dependency components. KubeBlocks Enterprise is a ready-to-use database management platform enabling users to run and manage multiple types of databases on Kubernetes.
About this chart
KubeBlocks Cloud Installer
This installer is used to deploy KubeBlocks Cloud on a Kubernetes cluster. It will install the following components:
- Zalando Postgres Operator, which will provision the meta database
- PostgreSQL, the meta database for KubeBlocks Cloud
- Certificate Manager, which will issue the certificates for KubeBlocks Cloud, if the
tls.enabledis set totrue. - Casdoor, the IDP service for KubeBlocks Cloud
- KubeBlocks Cloud
These components will be installed to the kb-cloud namespaces by default.
Prerequisites
- Kubernetes 1.20+
- Helm 3.10.0+
Supported Actions
The installer supports the following actions via the action parameter:
install: Initial installation or upgrade of KubeBlocks Cloudupgrade: Upgrade operation (reserved for future use)switch_logto_to_casdoor: Switch from Logto to Casdoor as IDPrestore_casdoor_to_logto: Restore from Casdoor back to Logtouninstall: Uninstall KubeBlocks Cloud components
Quick Start
Initial Installation
# Install KubeBlocks Cloud
helm install installer deploy/installer \
--namespace kb-cloud \
--create-namespace \
--set action=install \
--set fqdn.domain=mytest.kubeblocks.com \
--wait --timeout=30m
Check Installation Status
# List all installer jobs
kubectl get jobs -n kb-cloud -l app.kubernetes.io/name=kb-cloud-installer
# Check job logs, replace {JOB_NAME} with the actual job name
kubectl logs -n kb-cloud job/{JOB_NAME} -f
Upgrade KubeBlocks Cloud
# First, delete the previous install job if it still exists
kubectl delete job kb-cloud-installer-install -n kb-cloud --ignore-not-found=true
# Upgrade to a new version (no need to uninstall first)
helm upgrade installer deploy/installer \
--namespace kb-cloud \
--set action=install \
--set versions.cloud=1.0.76 \
--wait --timeout=30m
Switch Identity Provider
# Switch from Logto to Casdoor
helm upgrade installer deploy/installer \
--namespace kb-cloud \
--set action=switch_logto_to_casdoor \
--wait --timeout=30m
# Restore from Casdoor to Logto if switch logto to casdoor failed
helm upgrade installer deploy/installer \
--namespace kb-cloud \
--set action=restore_casdoor_to_logto \
--wait --timeout=30m
Uninstall
# Uninstall KubeBlocks Cloud components
helm upgrade installer deploy/installer \
--namespace kb-cloud \
--set action=uninstall \
--wait --timeout=30m
# Then uninstall the installer itself
helm uninstall installer --namespace kb-cloud
View Deployment History
# View helm release history
helm history installer -n kb-cloud
# Rollback to previous version if needed
helm rollback installer -n kb-cloud
Deployment Examples
GCP (Google Cloud Platform)
If you want to deploy KubeBlocks Cloud on GCP, you can use the following command:
helm install installer deploy/installer \
--namespace kb-cloud \
--create-namespace \
--set action=install \
--set fqdn.domain=mytest.kubeblocks.com \
--wait --timeout=30m
After all the components are installed, you can access the KubeBlocks Cloud:
-
Get the ingress IP address:
kubectl get ingress -n kb-cloud -
Add the following line to
/etc/hosts(replace the IP address with the real ingress external IP):1.2.3.4 mytest.kubeblocks.com auth.mytest.kubeblocks.com -
Access the KubeBlocks Cloud admin console: http://mytest.kubeblocks.com/admin
-
Access the KubeBlocks Cloud user console: http://mytest.kubeblocks.com/console
K3d
First, you need to install K3d. You can follow the instructions here.
Then, create a K3d cluster, mapping the host port 80 to the container port 80:
k3d cluster create --port 80:80@loadbalancer --agents 2
Deploy KubeBlocks Cloud on the K3d cluster:
helm install installer deploy/installer \
--namespace kb-cloud \
--create-namespace \
--set action=install \
--set kubernetesProvider=k3d \
--wait --timeout=30m
The installer will set the ingress class name to traefik.
After all the components are installed, you can access the KubeBlocks Cloud:
-
Add the following line to
/etc/hosts:127.0.0.1 mytest.kubeblocks.com auth.mytest.kubeblocks.com -
Access the KubeBlocks Cloud admin console: http://mytest.kubeblocks.com/admin
-
Access the KubeBlocks Cloud user console: http://mytest.kubeblocks.com/console
Troubleshooting
Check Job Status
# List all jobs with their status
kubectl get jobs -n kb-cloud -l app.kubernetes.io/name=kb-cloud-installer
# Describe a specific job
kubectl describe job <job-name> -n kb-cloud
# View job logs
kubectl logs -n kb-cloud job/<job-name>
Job Already Exists Error
If you see an error like:
ERROR: Job 'kb-cloud-installer-install' already exists in namespace 'kb-cloud'.
This means a job with the same action already exists. The error message will provide detailed instructions on how to resolve it.
Check the existing job status:
# Check job status
kubectl get job kb-cloud-installer-install -n kb-cloud
# View job details
kubectl describe job kb-cloud-installer-install -n kb-cloud
# Check job logs
kubectl logs -n kb-cloud job/kb-cloud-installer-install
If the job is completed or failed, delete it:
kubectl delete job kb-cloud-installer-install -n kb-cloud
Then retry the helm command:
helm upgrade installer deploy/installer \
--namespace kb-cloud \
--set action=install \
--wait --timeout=30m
Note: Replace install with your actual action name (e.g., switch_logto_to_casdoor, uninstall).
Job Failed
If a job fails, check the logs to identify the issue:
# Example: check install job logs
kubectl logs -n kb-cloud job/kb-cloud-installer-install
After fixing the issue, delete the failed job and retry:
# Delete the failed job
kubectl delete job kb-cloud-installer-install -n kb-cloud
# Retry the operation
helm upgrade installer deploy/installer \
--namespace kb-cloud \
--set action=install \
--wait --timeout=30m
Clean Up Old Jobs
Jobs are automatically deleted 5 minutes after completion. If you want to manually clean up:
# Delete all completed jobs
kubectl delete jobs -n kb-cloud -l app.kubernetes.io/name=kb-cloud-installer
Deploy kb-cloud-installer with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has kb-cloud-installer on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartkb-cloud-installer is pinned at v2.1.35 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply