Skip to content
Stand with Ukraine flag

Cluster setup using Minikube

This guide walks you through setting up ThingsBoard Professional Edition in cluster mode using Kubernetes and Minikube with microservices architecture. Docker container images are available on Docker Hub.

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

Verify that you can pull the images from Docker Hub:

Terminal window
docker pull thingsboard/tb-pe-node:4.3.1.1PE
docker pull thingsboard/tb-pe-web-report:4.3.1.1PE
docker pull thingsboard/tb-pe-web-ui:4.3.1.1PE
docker pull thingsboard/tb-pe-js-executor:4.3.1.1PE
docker pull thingsboard/tb-pe-http-transport:4.3.1.1PE
docker pull thingsboard/tb-pe-mqtt-transport:4.3.1.1PE
docker pull thingsboard/tb-pe-coap-transport:4.3.1.1PE
docker pull thingsboard/tb-pe-lwm2m-transport:4.3.1.1PE
docker pull thingsboard/tb-pe-snmp-transport:4.3.1.1PE

Step 1. Clone ThingsBoard PE Kubernetes scripts

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

Step 2. Obtain and configure the license key

Section titled “Step 2. Obtain and configure the license key”

We assume you have already chosen your subscription plan or decided to purchase a perpetual license. If not, navigate to the pricing page to select the best license option for your case. See How to get a pay-as-you-go subscription or How to get a perpetual license for details.

Edit the ThingsBoard node configuration:

Terminal window
nano tb-node.yml

Find the TB_LICENSE_SECRET environment variable and replace PUT_YOUR_LICENSE_SECRET_HERE with your actual license secret:

- name: TB_LICENSE_SECRET
value: "PUT_YOUR_LICENSE_SECRET_HERE"

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

Step 4. Configure Trendz Analytics (optional)

Section titled “Step 4. Configure Trendz Analytics (optional)”

You may optionally install Trendz Analytics.

Terminal window
docker pull thingsboard/trendz:1.15.1
docker pull thingsboard/trendz-python-executor:1.15.1

Edit trendz/trendz-secret.yml and replace YOUR_RDS_ENDPOINT_URL and YOUR_RDS_PASSWORD, then apply:

Terminal window
kubectl apply -f ./trendz/trendz-secret.yml
kubectl apply -f ./trendz/trendz-create-db.yml

Check the logs:

Terminal window
kubectl logs job/trendz-create-db -n thingsboard
Terminal window
./k8s-deploy-trendz.sh

You should see Trendz installed successfully! in the console output.

  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

Pull the latest changes and run the upgrade:

Terminal window
git pull origin master
./k8s-upgrade-trendz.sh