Minikube
This guide covers setting up TBMQ in cluster mode using Minikube.
Prerequisites
Section titled “Prerequisites”- A running Kubernetes cluster with
kubectlconfigured to communicate with it. If you don’t have Minikube installed, follow these instructions.
Clone TBMQ K8S repository
Section titled Clone TBMQ K8S repositorygit clone -b release-2.3.0 https://github.com/thingsboard/tbmq-pe-k8s.gitcd tbmq-pe-k8s/minikubeInstallation
Section titled “Installation”Run the installation script:
./k8s-install-tbmq.shGet the license key
Section titled Get the license keyBefore proceeding, ensure you have an active TBMQ license. If you don't have one yet, visit the Pricing page, choose a pay-as-you-go subscription or a perpetual license, and use the calculator to size your deployment — session and throughput limits, production and development instances, and any add-ons — to obtain your license key.
Configure the license key
Section titled Configure the license keyCreate a Kubernetes secret with your license key:
export TBMQ_LICENSE_KEY=YOUR_LICENSE_KEY_HEREkubectl create -n thingsboard-mqtt-broker secret generic tbmq-license --from-literal=license-key=$TBMQ_LICENSE_KEYRunning
Section titled “Running”Deploy TBMQ:
./k8s-deploy-tbmq.shOnce all resources have started, open http://{your-cluster-ip}:30001 in your browser (e.g. http://192.168.49.2:30001).
Check your cluster IP with:
minikube ipYou should see the TBMQ login page. Use the default System Administrator credentials:
Username:
Password:
sysadminOn first login, you are prompted to change the default password and re-login with the new credentials.
Logs, delete statefulsets and services
Section titled “Logs, delete statefulsets and services”To view TBMQ node logs:
-
List running TBMQ pods:
Terminal window kubectl get pods -l app=tbmq -
Fetch logs for a specific pod:
Terminal window kubectl logs -f TBMQ_POD_NAMEWhere
TBMQ_POD_NAMEis the pod name from the list above.
To check the state of all pods, services, deployments, and statefulsets:
kubectl get podskubectl get serviceskubectl get deploymentskubectl get statefulsetsSee the kubectl Cheat Sheet for more details.
To delete TBMQ nodes:
./k8s-delete-tbmq.shTo delete all resources including databases:
./k8s-delete-all.shUpgrading
Section titled “Upgrading”- Check the version-specific notes below for any preparation your target version requires.
- Back up your database (optional but recommended).
- Run the upgrade commands.
For full version history and supported upgrade paths, see the upgrade instructions page. If the documentation does not cover your specific upgrade path, contact us for guidance.
If there are no version-specific notes for your upgrade path, skip directly to Run upgrade.
Backup and restore (optional)
Section titled “Backup and restore (optional)”Backing up your PostgreSQL database before upgrading is highly recommended but optional. For guidance, follow the backup and restore instructions.
Upgrade to 2.3.0
Section titled Upgrade to 2.3.0This is a standard upgrade from v2.2.0. No third-party component changes are required — the official images are already in use since v2.2.0.
Proceed with the upgrade.
Upgrade from TBMQ to TBMQ PE
Section titled Upgrade from TBMQ to TBMQ PECE-to-PE migration is supported for the same version only. If you are on an earlier CE version, upgrade TBMQ CE to the latest version first. For all supported paths, see the upgrade instructions.
Before upgrading, merge your current configuration with the latest TBMQ PE K8S scripts. Don't forget to configure the license key.
Run the following commands to stop TBMQ, migrate the database, and redeploy:
./k8s-delete-tbmq.sh./k8s-upgrade-tbmq.sh --fromVersion=ce./k8s-deploy-tbmq.shRun upgrade
Section titled “Run upgrade”Pull the latest changes from the release branch:
git pull origin release-2.3.0Note: Make sure any custom changes are not lost during the merge.
After pulling, run the upgrade script:
./k8s-upgrade-tbmq.sh