You need a certificate for mqtt:
-
In mqtt-envars.yml you need to replace the MQTT_SSL_PEM_CERT variable with your domain crt file.
-
In mqtt-envars.yml you need to replace the MQTT_SSL_PEM_KEY variable with your domain key file.
-
In mqtt-envars.yml you need to replace the MQTT_SSL_PEM_KEY_PASSWORD variable with your domain key password if you have, if you dont just leave it "".
kubectl create namespace thingsboard
kubectl config set-context $(kubectl config current-context) --namespace=thingsboard
kubectl apply -f storage.yml
kubectl apply -f ./configmap/kafka-config.yml && helm upgrade --install tb-kafka oci://registry-1.docker.io/bitnamicharts/kafka -f ./values/kafka-values.yaml --namespace thingsboard --create-namespace
helm upgrade --install tb-redis oci://registry-1.docker.io/bitnamicharts/redis -f ./values/redis-values.yaml --namespace tb-redis --create-namespace
- Wait until pods are running successfully.
helm upgrade --install tb-postgres oci://registry-1.docker.io/bitnamicharts/postgresql -f ./values/postgres-values.yaml --namespace tb-postgres --create-namespace
kubectl config set-context $(kubectl config current-context) --namespace=thingsboard
- Wait until the PostgreSQL pod is running successfully.
kubectl apply -f ./configmap/tb-node-db-configmap.yml
kubectl apply -f ./configmap/tb-cache-configmap.yml
kubectl apply -f ./configmap/tb-node-configmap.yml
To set up the database, execute the following commands:
- Without demo data:
kubectl apply -f database-setup.yml && kubectl wait --for=condition=Ready pod/tb-db-setup --timeout=120s && kubectl exec tb-db-setup -- sh -c "export INSTALL_TB=true; export LOAD_DEMO='false'; start-tb-node.sh; touch /tmp/install-finished;"
- With demo data:
kubectl apply -f database-setup.yml && kubectl wait --for=condition=Ready pod/tb-db-setup --timeout=120s && kubectl exec tb-db-setup -- sh -c "export INSTALL_TB=true; export LOAD_DEMO='true'; start-tb-node.sh; touch /tmp/install-finished;"
- If you get any timeout error ust execute the same command when the pod is running
After the database setup is complete, delete the tb-db-setup pod:
kubectl delete pod tb-db-setup
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm upgrade --install ingress-nginx ingress-nginx/ingress-nginx -f ./values/ingress.yaml --namespace thingsboard
Finally, deploy ThingsBoard components by applying the following files in sequence:
kubectl apply -f mqtt-envars.yml
kubectl apply -f ./configmap/tb-transport-configmap.yml
kubectl apply -f thingsboard.yml
kubectl apply -f tb-node.yml
kubectl apply -f routes.yml
Wait for 15 minutes to ensure resources are initialized and you're ready to go