https://github.com/0giv/thingsboard-kubernetes
Open-source IoT Platform - This is how you can set up your thingsboard to kubernetes
https://github.com/0giv/thingsboard-kubernetes
iot iot-application kubernetes kubernetes-cluster kubernetes-deployment thingsboard thingsboard-iot thingsboard-kubernetes
Last synced: 8 months ago
JSON representation
Open-source IoT Platform - This is how you can set up your thingsboard to kubernetes
- Host: GitHub
- URL: https://github.com/0giv/thingsboard-kubernetes
- Owner: 0giv
- Created: 2025-02-08T21:20:37.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-02-08T21:21:50.000Z (8 months ago)
- Last Synced: 2025-02-08T22:24:27.300Z (8 months ago)
- Topics: iot, iot-application, kubernetes, kubernetes-cluster, kubernetes-deployment, thingsboard, thingsboard-iot, thingsboard-kubernetes
- Homepage:
- Size: 104 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Installation Guide for ThingsBoard
## Installation Steps
### Step 0: Prerequisites
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 "".
### Step 1: Create Namespace and Set default to thingsboard
```bash
kubectl create namespace thingsboardkubectl config set-context $(kubectl config current-context) --namespace=thingsboard
```
### Step 2: Deploy Third-party Dependencies```bash
kubectl apply -f storage.ymlkubectl 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.
### Step 3: Install PostgreSQL
```bash
helm upgrade --install tb-postgres oci://registry-1.docker.io/bitnamicharts/postgresql -f ./values/postgres-values.yaml --namespace tb-postgres --create-namespacekubectl config set-context $(kubectl config current-context) --namespace=thingsboard
```- Wait until the PostgreSQL pod is running successfully.
### Step 4: Configure ThingsBoard Components
#### 1 Database Configuration
```bash
kubectl apply -f ./configmap/tb-node-db-configmap.yml
```
#### 2 Cache Configuration
```bash
kubectl apply -f ./configmap/tb-cache-configmap.yml
```
#### 3 Node Configuration
```bash
kubectl apply -f ./configmap/tb-node-configmap.yml
```### Step 5: Set Up the Database
To set up the database, execute the following commands:
- Without demo data:
```bash
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:```bash
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 runningAfter the database setup is complete, delete the tb-db-setup pod:
```bash
kubectl delete pod tb-db-setup
```
### Step 6: Deploy Ingress If Needed```bash
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo updatehelm upgrade --install ingress-nginx ingress-nginx/ingress-nginx -f ./values/ingress.yaml --namespace thingsboard
```### Step 7: Deploy ThingsBoard Resources
Finally, deploy ThingsBoard components by applying the following files in sequence:
#### 0 MQTT Secret:
```bash
kubectl apply -f mqtt-envars.yml
```
#### 1 Transport ConfigMap:
```bash
kubectl apply -f ./configmap/tb-transport-configmap.yml
```
#### 2 Main ThingsBoard Deployment:
```bash
kubectl apply -f thingsboard.yml
```
#### 3 Node Deployment:
```bash
kubectl apply -f tb-node.yml
```
#### 4 Routes:
```bash
kubectl apply -f routes.yml
```Wait for 15 minutes to ensure resources are initialized and you're ready to go