Skip to content

Cluster setup using Minikube

This guide walks you through setting up ThingsBoard Community Edition in cluster mode using Kubernetes and Minikube with microservices architecture.

For a simpler single-node installation, see Docker (Linux, macOS). For production cluster deployments, see Docker Compose (Cluster).

ThingsBoard microservices run on a Kubernetes cluster. You need:

  • Minikube installed
  • kubectl command-line tool configured to communicate with your cluster

By default the ingress addon is disabled in Minikube. Enable it:

Terminal window
minikube addons enable ingress

Step 1. Clone ThingsBoard CE Kubernetes scripts

Section titled “Step 1. Clone ThingsBoard CE Kubernetes scripts”
Terminal window
git clone -b release-4.3.1.3 https://github.com/thingsboard/thingsboard-ce-k8s.git --depth 1
cd thingsboard-ce-k8s/minikube

Edit the .env file to set the database type:

Terminal window
nano .env

Set the DATABASE variable to one of:

ValueDescription
postgresUse PostgreSQL for all data
hybridUse PostgreSQL for entities and Cassandra for time-series data
  1. Run the installation script:

    Terminal window
    ./k8s-install-tb.sh --loadDemo

    The --loadDemo flag loads sample tenant account, dashboards, and devices for evaluation and testing.

  2. Deploy third-party resources:

    Terminal window
    ./k8s-deploy-thirdparty.sh

    Type yes when prompted if you are running ThingsBoard in high-availability deployment type for the first time or don’t have a configured Redis cluster.

  3. Deploy ThingsBoard resources:

    Terminal window
    ./k8s-deploy-resources.sh

After all resources start, get the cluster IP:

Terminal window
minikube ip

Open http://{your-cluster-ip} in your browser. You should see the ThingsBoard login page. Use the following default credentials:

You can change passwords for each account in the account profile page.

See Getting Started for your next steps after login.

List running ThingsBoard node pods:

Terminal window
kubectl get pods -l app=tb-node

Stream logs of a specific pod:

Terminal window
kubectl logs -f TB_NODE_POD_NAME

Replace TB_NODE_POD_NAME with the pod name from the list above.

Other useful commands:

CommandDescription
kubectl get podsList all pods
kubectl get servicesList all services
kubectl get deploymentsList all deployments

See the kubectl Cheat Sheet for more commands.

Delete ThingsBoard microservices:

Terminal window
./k8s-delete-resources.sh

Delete third-party services:

Terminal window
./k8s-delete-thirdparty.sh

Delete all resources including database:

Terminal window
./k8s-delete-all.sh

Pull the latest changes from the repository:

Terminal window
git pull origin master

Then run the upgrade:

Terminal window
./k8s-delete-resources.sh
./k8s-upgrade-tb.sh
./k8s-deploy-resources.sh
  1. Upgrade to the latest CE version.

  2. Stop ThingsBoard resources:

    Terminal window
    ./k8s-delete-resources.sh
  3. Merge your configuration with the latest PE Minikube scripts. Configure the license key as described in the PE Minikube guide.

  4. Run the migration script:

    Terminal window
    ./k8s-upgrade-tb.sh --fromVersion=CE
  5. Deploy ThingsBoard resources:

    Terminal window
    ./k8s-deploy-resources.sh