ThingsBoard Documentation

Documentation for using ThingsBoard IoT Platform.
Open documentation for releases before 1.3

Installing ThingsBoard using Kubernetes (on Google Cloud Platform)

This guide will help you to deploy ThingsBoard into a cluster on Google Cloud Platform using Kubernetes.

Installation steps

curl -L https://raw.githubusercontent.com/thingsboard/thingsboard/release-1.3/docker/k8s/common.yaml > common.yaml
curl -L https://raw.githubusercontent.com/thingsboard/thingsboard/release-1.3/docker/k8s/cassandra.yaml > cassandra.yaml
curl -L https://raw.githubusercontent.com/thingsboard/thingsboard/release-1.3/docker/k8s/zookeeper.yaml > zookeeper.yaml
curl -L https://raw.githubusercontent.com/thingsboard/thingsboard/release-1.3/docker/k8s/tb.yaml > tb.yaml
curl -L https://raw.githubusercontent.com/thingsboard/thingsboard/release-1.3/docker/k8s/cassandra-setup.yaml > cassandra-setup.yaml
gcloud container get-server-config
Fetching server config for us-east1-b
defaultClusterVersion: 1.6.4
defaultImageType: COS
validImageTypes:
- COS
- CONTAINER_VM
validMasterVersions:
- 1.7.1
- 1.6.7
- 1.6.4
validNodeVersions:
- 1.7.1
- 1.7.0
- 1.6.7
- 1.6.6
- 1.6.4
- 1.5.7
- 1.4.9

gcloud container clusters create YOUR_CLUSTER_NAME --cluster-version=VALID_MASTER_VERSION --node-labels=machinetype=tb --num-nodes=2
gcloud container node-pools create cassandra-pool --cluster=YOUR_CLUSTER_NAME --node-labels=machinetype=other --num-nodes=3 --disk-size=10
gcloud auth application-default login
kubectl create -f common.yaml
kubectl create -f cassandra.yaml
kubectl get pods -w -l app=cassandra
NAME             READY     STATUS    RESTARTS   AGE
cassandra-0      1/1       Running   0          5s
cassandra-1      1/1       Running   0          3s
kubectl create -f cassandra-setup.yaml
kubectl logs -f cassandra-setup
Adding group `thingsboard' (GID 102) ...
Done.
Unpacking thingsboard (1.3.0-1) ...
Setting up thingsboard (1.3.0-1) ...
9042/tcp open  unknown
Creating 'ThingsBoard' schema and system data...
plus demo data...
 ===================================================
 :: ThingsBoard ::       (v1.3.0)
 ===================================================

log4j:WARN No appenders could be found for logger (hsqldb.db.HSQLDB5D8345905E.ENGINE).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Starting ThingsBoard Installation...
Installing DataBase schema...
Installing SQL DataBase schema...
Loading system data...
Loading demo data...
Installation finished successfully!
ThingsBoard installed successfully!
kubectl create -f zookeeper.yaml
kubectl create -f tb.yaml
kubectl get pods -w -l app=tb
NAME      READY     STATUS    RESTARTS   AGE
tb-0      1/1       Running   0          5s
tb-1      1/1       Running   0          3s
kubectl logs -f tb-0
2016-12-13 13:44:52,407 [main] INFO  o.t.s.ThingsboardServerApplication - Started ThingsboardServerApplication in 113.64 seconds (JVM running for 118.624)
kubectl get services tb-service
NAME             CLUSTER-IP     EXTERNAL-IP    PORT(S)                                        AGE
tb-service      10.3.251.137   35.185.81.65   8080:31099/TCP,1883:32314/TCP,5683:30062/TCP   1m
http://EXTERNAL-IP:8080/
gcloud container clusters delete YOUR_CLUSTER_NAME

Advanced usage

common.yaml file

Common Kubernetes config file common.yaml contains next set of cloud resources:

cassandra.yaml file

Cassandra Kubernetes config file cassandra.yaml contains next set of cloud resources:

zookeeper.yaml file

Zookeeper Kubernetes config file zookeeper.yaml contains next set of cloud resources:

tb.yaml file

ThingsBoard Kubernetes config file tb.yaml contains next set of cloud resources:

cassandra-setup.yaml

ThingsBoard Kubernetes config file cassandra-setup.yaml contains next set of cloud resources: