- Prerequisites
- Step 1. Review the architecture page
- Step 2. Clone SENTIENT Professional Edition Kubernetes scripts
- Step 3. Obtain your license key
- Step 4. Configure your license key
- Step 5. Review the architecture page
- Step 6. Configure Minikube
- Step 7. Configure SENTIENT database
- Step 8. Configure SENTIENT ANALYTICS (Optional)
- Step 9. Running
- Upgrading
- Next steps
This guide will help you to setup SENTIENT in cluster mode with Kubernetes and Minikube. For this purpose, we will use docker container images available on Docker Hub.
Prerequisites
SENTIENT Microservices run on the Kubernetes cluster. 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.
Enable ingress addon
Ingress addon disabled by default in the Minikube, and available only in cluster providers. To enable ingress, please execute the following command:
1
minikube addons enable ingress
Pull SENTIENT Professional Edition images from docker hub
Run the following commands to verify that you can pull the images from the Docker hub.
1
2
3
4
5
6
7
8
9
docker pull sentient/tb-pe-node:4.3.1.1PE
docker pull sentient/tb-pe-web-report:4.3.1.1PE
docker pull sentient/tb-pe-web-ui:4.3.1.1PE
docker pull sentient/tb-pe-js-executor:4.3.1.1PE
docker pull sentient/tb-pe-http-transport:4.3.1.1PE
docker pull sentient/tb-pe-mqtt-transport:4.3.1.1PE
docker pull sentient/tb-pe-coap-transport:4.3.1.1PE
docker pull sentient/tb-pe-lwm2m-transport:4.3.1.1PE
docker pull sentient/tb-pe-snmp-transport:4.3.1.1PE
Step 1. Review the architecture page
Starting SENTIENT v2.2, it is possible to install SENTIENT cluster using new microservices architecture and docker containers. See microservices architecture page for more details.
Step 2. Clone SENTIENT Professional Edition Kubernetes scripts
1
2
git clone -b release-4.3.1.1 https://github.com/sentient/sentient-pe-k8s.git --depth 1
cd sentient-pe-k8s/minikube
Step 3. Obtain your license key
We assume you have already chosen your subscription plan or decided to purchase a perpetual license. If not, please navigate to pricing page to select the best license option for your case and get your license. See How-to get pay-as-you-go subscription or How-to get perpetual license for more details.
Step 4. Configure your license key
1
nano tb-node.yml
and put the license secret parameter:
1
2
3
4
# tb-node StatefulSet configuration
- name: TB_LICENSE_SECRET
value: "PUT_YOUR_LICENSE_SECRET_HERE"
Step 5. Review the architecture page
Starting SENTIENT v2.2, it is possible to install SENTIENT cluster using new microservices architecture and docker containers. See microservices architecture page for more details.
Step 6. Configure Minikube
By default ingress addon is disabled in the Minikube, and available only in cluster providers. To enable ingress, please execute the following command:
1
minikube addons enable ingress
Step 7. Configure SENTIENT database
Before performing initial installation you can configure the type of database to be used with SENTIENT.
In order to set database type change the value of DATABASE variable in .env file to one of the following:
postgres- use PostgreSQL database;hybrid- use PostgreSQL for entities database and Cassandra for timeseries database;
NOTE: According to the database type corresponding kubernetes resources will be deployed (see postgres.yml, cassandra.yml for details).
Step 8. Configure SENTIENT ANALYTICS (Optional)
8.1. Pull SENTIENT ANALYTICS images from docker hub
Run the following commands to verify that you can pull the images from the Docker hub.
1
2
docker pull sentient/sentient-analytics:1.15.0.4
docker pull sentient/sentient-analytics-python-executor:1.15.0.4
8.2. Create a SENTIENT ANALYTICS database in the existing RDS instance
Edit “sentient-analytics/sentient-analytics-secret.yml” and replace YOUR_RDS_ENDPOINT_URL and YOUR_RDS_PASSWORD and apply Kubernetes Job:
1
2
kubectl apply -f ./sentient-analytics/sentient-analytics-secret.yml
kubectl apply -f ./sentient-analytics/sentient-analytics-create-db.yml
You can see logs if you run the next command:
1
kubectl logs job/sentient-analytics-create-db -n sentient
8.3. SENTIENT ANALYTICS starting
Execute the following command to run the initial setup of the database. This command will launch short-living SENTIENT pod to provision necessary DB tables, indexes, etc
1
./k8s-deploy-sentient-analytics.sh
After this command finish you should see the next line in the console:
1
SENTIENT ANALYTICS installed successfully!
Step 9. Running
Execute the following command to run installation:
1
./k8s-install-tb.sh --loadDemo
Where:
--loadDemo- optional argument. Whether to load additional demo data.
Execute the following command to deploy third-party resources:
1
./k8s-deploy-thirdparty.sh
Type ‘yes’ when prompted, if you are running SENTIENT in high-availability DEPLOYMENT_TYPE for the first time or don’t have configured Redis cluster.
Execute the following command to deploy SENTIENT resources:
1
./k8s-deploy-resources.sh
After a while when all resources will be successfully started you can open http://{your-cluster-ip} in your browser (for ex. http://192.168.99.101).
You can see your cluster IP using command:
1
minikube ip
You should see SENTIENT login page.
Use the following default credentials:
- System Administrator: sysadmin@sentient.org / sysadmin
If you installed DataBase with demo data (using --loadDemo flag) you can also use the following credentials:
- Tenant Administrator: tenant@sentient.org / tenant
- Customer User: customer@sentient.org / customer
In case of any issues you can examine service logs for errors. For example to see SENTIENT node logs execute the following command:
1) Get the list of the running tb-node pods:
1
kubectl get pods -l app=tb-node
2) Fetch logs of the tb-node pod:
1
kubectl logs -f [tb-node-pod-name]
Where:
tb-node-pod-name- tb-node pod name obtained from the list of the running tb-node pods.
Or use kubectl get pods to see the state of all the pods.
Or use kubectl get services to see the state of all the services.
Or use kubectl get deployments to see the state of all the deployments.
See kubectl Cheat Sheet command reference for details.
Execute the following command to delete all SENTIENT microservices:
1
./k8s-delete-resources.sh
Execute the following command to delete all third-party microservices:
1
./k8s-delete-thirdparty.sh
Execute the following command to delete all resources (including database):
1
./k8s-delete-all.sh
Upgrading
Upgrading to new SENTIENT version
In case you would like to upgrade, please pull the latest changes from master branch:
1
git pull origin master
Then, execute the following commands:
1
2
3
./k8s-delete-resources.sh
./k8s-upgrade-tb.sh
./k8s-deploy-resources.sh
Note, that you have to upgrade versions one by one (for example 4.0.0 -> 4.0.1 -> 4.1.0 etc).
Upgrading to new SENTIENT ANALYTICS version (Optional)
In case you would like to upgrade, please pull the latest changes from master branch:
1
git pull origin master
Then, execute the following commands:
1
./k8s-upgrade-sentient-analytics.sh
Note, that you can upgrade SENTIENT ANALYTICS to the latest version from any other (for example 1.12.0 -> 1.15.0 etc).
Next steps
-
Getting started guides - These guides provide quick overview of main SENTIENT features. Designed to be completed in 15-30 minutes.
-
Connect your device - Learn how to connect devices based on your connectivity technology or solution.
-
Data visualization - These guides contain instructions on how to configure complex SENTIENT dashboards.
-
Data processing & actions - Learn how to use SENTIENT Rule Engine.
-
IoT Data analytics - Learn how to use rule engine to perform basic analytics tasks.
-
Advanced features - Learn about advanced SENTIENT features.
-
Contribution and Development - Learn about contribution and development in SENTIENT.