Stand with Ukraine flag
Pricing Try it now
Trendz Analytics
Installation > On-premises > Kubernetes
Getting Started Documentation Guides
How To Activate Trendz
On this page

Installing ThingsBoard Trendz Analytics on Kubernetes

This guide describes how to setup Trendz Analytics cluster with Kubernetes and Minikube.

Prerequisites

  • ThingsBoard version 4.3.0 or newer. In case you have ThingsBoard version 4.2.1 or older, you could connect Trendz to ThingsBoard following the next guide.
  • Active Trendz Analytics addon. To find out how to activate it, please follow the next guide.

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.

Configure your cluster by designating a node for the Trendz instance and labeling it with a custom label. Utilize affinity settings to instruct Kubernetes to deploy the Trendz instance on the specified node. Ensure that the node meets specific CPU and RAM requirements, with the typical usage being around 4 CPU and 8GB RAM. While you can set your own limits, we advise adhering to or exceeding the recommended specifications mentioned earlier.

Installation Steps

Step 1. Clone Trendz Kubernetes scripts

1
2
git clone https://github.com/thingsboard/trendz-k8s.git --depth 1
cd trendz-k8s

Step 2. Configure Trendz database

Set up an external Postgresql database instance with an empty database named “trendz.” This instance can be hosted on services like RDS (AWS) or as your stateful deployment. Ensure you have the following information:

  • URL (Example: jdbc:postgresql://trendz-db-service:5432/trendz)
  • Username (Example: postgres)
  • Password (Example: postgres)

Now we can configure the Trendz database by editing the trendz-secret.yml file:

1
nano trendz-secret.yml
1
2
3
4
  SPRING_DATASOURCE_URL: jdbc:postgresql://trendz-db-service:5432/trendz
  SPRING_DATASOURCE_USERNAME: postgres
  SPRING_DATASOURCE_PASSWORD: postgres

Step 3. Running

1
2
3
4
5
6
7
8
kubectl apply -f trendz-namespace.yml
kubectl apply -f trendz-app-config.yml
kubectl apply -f trendz-app-db-config.yml
kubectl apply -f trendz-app-pvc.yml
kubectl apply -f trendz-app-deployment.yml
kubectl apply -f trendz-python-executor-config.yml
kubectl apply -f trendz-python-executor-deployment.yml

Step 4. Check the logs

Now check the logs and be sure that the instance is started successfully. There should be a next line:

1
2
3
kubectl logs -f [trendz-pod-name]

Started TrendzApplication in 5.654 seconds (JVM running for 6.229)

Where:

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

Step 5. Set up a load balancer

The last thing is to set up a load balancer to route requests to the Trendz instance. Just update your current load balancer config using reference from the trendz-ingress.yml file.

Do not apply this file, it is just an example. Different environments have different requirements for these configurations, so you need to adjust these settings to your environment.

Step 6. Sync ThingsBoard With Trendz

The final step is to verify that ThingsBoard is synchronized with Trendz. To do this:

  • Log in to ThingsBoard as a Sysadmin.
  • Open the Trendz Settings page.

If you see the message “Synchronization completed successfully”, the synchronization has been completed automatically and no further action is required.

If you see an error message, follow these steps:

  • Make sure that Trendz is running.
  • Enter the correct Trendz internal URL. It must be accessible from the ThingsBoard service.
  • Enter the correct ThingsBoard internal URL. It must be accessible from the Trendz service.
  • Click Save configuration.
  • Click Retry discovery.

Once the message “Synchronization completed successfully” appears, the synchronization is complete.

Authentication

You can access Trendz UI by default at http://localhost:8888

Trendz uses ThingsBoard as an authentication service, so for first authentication, you need to use Tenant Administrator credentials from your ThingsBoard.

Topology Discovery

After the first login to Trendz, you need to discover topology to allow Trendz to know about assets, devices, their profiles and relations:

  • Click the Discover Topology button to start topology discovery process.
  • Wait until your topology will be discovered.
  • Click the Finish button to close topology discovery page and unlock the main Trendz functionality.

You could read more about how Trendz uses this topology here.

Next steps

  • Getting started guide - These guide provide quick overview of main Trendz features.

  • Metric Explorer - Learn how to explore and create new metrics with Trendz Metric Explorer.

  • Anomaly Detection - Learn how to identify anomalies in the data.

  • Calculated Fields - Learn about Calculated fields and how to use them.

  • States - Learn how to define and analyse states for assets based on raw telemetry.

  • Prediction - Learn how to make forecasts and predict telemetry behavior.

  • Filters - Learn how filter dataset during analysis.

  • Available Visualizations - Learn about visualization widgets available in Trendz and how to configure them.

  • Share and embed Visualizations - Learn how to add Trendz visualizations on ThingsBoard dashboard or 3rd party web pages.

  • AI Assistant - Learn how to utilize Trendz AI capabilities.