Stand with Ukraine flag
Pricing Try it now
PE MQTT Broker
Installation > Cluster on Minikube (Kubernetes)
Getting Started Documentation
Architecture API FAQ
On this page

Deploy TBMQ PE Cluster on Minikube with Kubernetes

This guide will help you set up TBMQ PE in cluster mode using Minikube.

Prerequisites

You need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. If you don’t have Minikube installed, please follow these instructions.

Clone TBMQ PE K8S repository

1
2
git clone -b release-2.2.0 https://github.com/thingsboard/tbmq-pe-k8s.git
cd tbmq-pe-k8s/minikube

Installation

To install TBMQ PE, execute the following command:

1
./k8s-install-tbmq.sh

Get the license key

Before proceeding, make sure you’ve selected your subscription plan or chosen to purchase a perpetual license. If you haven’t done this yet, please visit the Pricing page to compare available options and obtain your license key.

Note: Throughout this guide, we’ll refer to your license key as YOUR_LICENSE_KEY_HERE.

Configure the license key

Create a k8s secret with your license key:

1
2
export TBMQ_LICENSE_KEY=YOUR_LICENSE_KEY_HERE 
kubectl create -n thingsboard-mqtt-broker secret generic tbmq-license --from-literal=license-key=$TBMQ_LICENSE_KEY
Doc info icon

Don’t forget to replace YOUR_LICENSE_KEY_HERE with the value of your license key.

Running

Execute the following command to deploy TBMQ PE:

1
./k8s-deploy-tbmq.sh

After a while when all resources will be successfully started you can open http://{your-cluster-ip}:30001 in your browser (e.g. http://192.168.49.2:30001). You can check your cluster IP using the following command:

1
minikube ip

You should see TBMQ login page. Use the following default credentials for System Administrator:

Username:

Password:

1
sysadmin

On the first user log-in you will be asked to change the default password to the preferred one and then re-login using the new credentials.

Logs, delete statefulsets and services

In case of any issues, you can examine service logs for errors. For example, to see TBMQ node logs execute the following commands:

1) Get the list of the running tbmq pods:

1
kubectl get pods -l app=tbmq

2) Fetch logs of the tbmq pod:

1
kubectl logs -f TBMQ_POD_NAME

Where:

  • TBMQ_POD_NAME - tbmq pod name obtained from the list of the running tbmq pods.

Or use the next command to see the state of all the pods.

1
kubectl get pods

Use the next command to see the state of all the services.

1
kubectl get services

Use the next command to see the state of all the deployments.

1
kubectl get deployments

Use the next command to see the state of all the statefulsets.

1
kubectl get statefulsets

See kubectl Cheat Sheet command reference for more details.

Execute the following command to delete TBMQ nodes:

1
./k8s-delete-tbmq.sh

Execute the following command to delete all resources (including the databases):

1
./k8s-delete-all.sh

Upgrading

Review the release notes and upgrade instruction for detailed information on the latest changes.

If the documentation does not cover the specific upgrade instructions for your case, please contact us so we can provide further guidance.

Backup and restore (Optional)

While backing up your PostgreSQL database is highly recommended, it is optional before proceeding with the upgrade. For further guidance, follow the next instructions.

Upgrade from TBMQ CE to TBMQ PE (v2.2.0)

To upgrade your existing TBMQ Community Edition (CE) to TBMQ Professional Edition (PE), ensure you are running the latest TBMQ CE 2.2.0 version before starting the process. Merge your current configuration with the latest TBMQ PE K8S scripts. Do not forget to configure the license key.

Run the following commands, including the upgrade script to migrate PostgreSQL database data from CE to PE:

1
2
3
./k8s-delete-tbmq.sh
./k8s-upgrade-tbmq.sh --fromVersion=ce
./k8s-deploy-tbmq.sh

Next steps