kb-cloud-installer
by apecloud
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)uninstall: 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 --wait-for-jobs --timeout=30m
For single-node proof-of-concept environments, set the meta database replica count explicitly:
helm install installer deploy/installer \
--namespace kb-cloud \
--create-namespace \
--set action=install \
--set metaDB.kubeblocks.clusterConfig.replicas=1 \
--wait --wait-for-jobs --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
Casdoor Access
New installations default to casdoor.serviceType=NodePort. In subpath mode,
Console authentication uses the shared Ingress; Casdoor management is available
at http://<NODE-IP>:<NODE-PORT>, independently of Ingress TLS.
Query the port with kubectl -n kb-cloud get svc casdoor.
Set casdoor.serviceType to override the service type. casdoor.host overrides
the authentication address. Existing Casdoor releases retain their configuration.
MetaDB Initialization Permissions
With metaDB.initialize=true, the initialization account must be able to manage
the service databases and roles and grant any missing USAGE and CREATE
privileges on each service database's public schema. Being the database owner
does not necessarily make it the schema owner. A schema owner or superuser can grant these privileges;
another initialization account needs both privileges with GRANT OPTION.
The schema grant step verifies both effective privileges through the same
administrative connection, skipping redundant grants when both already exist.
PostgreSQL can report a warning without actually granting privileges, so a
successful psql exit alone is not sufficient. Missing
privileges stop initialization before Casdoor/Cloud installation. Ask the schema
owner or DBA to grant the service role the required privileges, or give the
initialization account both privileges with GRANT OPTION, then rerun the
installer. The installer does not elevate its own privileges or require changing
an external schema's owner.
Upgrade KubeBlocks Cloud
Keep metaDB.password unchanged when repeating an installation or upgrading.
With metaDB.password: "", the chart reuses the password stored in
kb-cloud-installer-config; it only generates a password when no stored password
exists. A different explicit password is rejected before deployment, because
password rotation requires coordinating all consumers, including the existing
Casdoor release. This lookup requires a cluster-connected Helm install/upgrade
(or --dry-run=server), not an offline helm template.
If the installer ConfigMap is deleted (for example, by uninstalling the installer release) while retaining the MetaDB or Casdoor, provide the original password explicitly on the next installation. Do not generate a new password for retained services.
# 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 --wait-for-jobs --timeout=30m
Uninstall
# Uninstall KubeBlocks Cloud components
helm upgrade installer deploy/installer \
--namespace kb-cloud \
--set action=uninstall \
--wait --wait-for-jobs --timeout=30m
# Then uninstall the installer itself
helm uninstall installer --namespace kb-cloud
Cloud's existing Helm post-delete hook removes its VM/VL template-created PVCs
on all supported Kubernetes versions (1.20+). External existingClaim volumes and
PVCs marked helm.sh/resource-policy: keep are retained. For retention settings,
upgrade prerequisites, and cleanup limits, see
Cloud chart uninstall.
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 --wait-for-jobs --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 -
Access the KubeBlocks Cloud admin console: http://mytest.kubeblocks.com/admin
-
Access the KubeBlocks Cloud user console: http://mytest.kubeblocks.com/console
fqdn.scheme sets the public URL scheme for Console, Casdoor, and apiserver
callback endpoints. When empty, it is https if tls.enabled=true with a domain,
otherwise http. tls.enabled controls whether the installer manages ingress TLS
certificates.
IP access uses HTTP and an ingress address instead of a domain. In this example,
880 is a user-selected port, not a default:
helm install installer deploy/installer --namespace kb-cloud --create-namespace \
--set-string fqdn.domain= --set casdoor.serviceType=NodePort \
--set ingress.host=192.0.2.10 --set ingress.httpPort=880 \
--set tls.enabled=false \
--wait --wait-for-jobs --timeout=30m
The installer does not install the ingress controller. Install ingress-nginx or Traefik with kbecli or Helm. A missing IngressClass does not fail installation; once that IngressClass exists, the Ingress is served.
When ingress.keepLegacyHosts=true and middlewares.traefik.io already exists,
the installer creates kubeblocks-cloud-legacy-redirect. If the CRD is absent,
apply deploy/installer/manifests/traefik-middleware.yaml
after Traefik is installed.
When installing the Installer chart directly, the selected ingress controller
must also expose HTTP on ingress.httpPort. For ingress-nginx, configure
controller.kind=DaemonSet, controller.hostNetwork=false,
controller.hostPort.enabled=true, controller.hostPort.ports.http=880,
controller.containerPort.https=null, and controller.service.enableHttps=false.
For KBE 2.2+ host routing, ingress.keepLegacyHosts=true renders redirect Ingresses
for old Console/Admin host-mode DNS names. API and Auth remain formal host
entries and are not rendered as legacy redirects. This compatibility path
requires nginx or traefik ingress. When automatic certificate generation is enabled, these
legacy Console/Admin hosts are covered by the generated ingress certificate. If
a TLS secret is provided manually, the secret must already include the legacy
host names.
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 --wait-for-jobs --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 -
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 --wait-for-jobs --timeout=30m
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 --wait-for-jobs --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.4.0-alpha.163 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