To TDengine
Shifu can push data from your device to a TDengine database.
Create TelemetryService Yaml file
apiVersion: shifu.edgenesis.io/v1alpha1
kind: TelemetryService
metadata:
name: push-endpoint-1
namespace: devices
spec:
telemetryServiceEndpoint: http://telemetryservice.shifu-service.svc.cluster.local
serviceSettings:
SQLSetting:
serverAddress: 192.168.14.163:6041
secret: my-secret
dbName: shifu
dbTable: testTable2
dbtype: TDengine
telemetryServiceEndpointis telemetry service endpoint addressserverAddressis the database addressusernameis your database usernamesecretis the name of theSecretstored your database username and passworddbNameis the name of the databasedbTableis the table name of the databasedbTypeis the type of the database
Create the Secret
Create a Secret named the secret field above with the username field filled by your username and the password field filled by your password.
kubectl create secret generic my-secret --from-literal=username=your_username --from-literal=password=your_password -n devices
If you have multiple telemetry services, you can write them in one file and split them in one file using ---.
Edit Configmap Yaml file
# configmap.yaml
data:
telemetries: |
telemetries:
device_health1:
properties:
instruction: status
pushSettings:
telemetryCollectionService: push-endpoint-1 # Edit it to the name same with TelemetryService's name
Then edit the Configmap yaml file and make sure that the telemetryCollectionService value is the same as the name of the telemetry service you created in the previous step.
deploy deviceShifu again
Then you need to deploy deviceShifu again so that the telemetry will push raw data to the telemetry service and publish it to your TDengine database.
examples
Here is an example of how to use.
https://github.com/Edgenesis/shifu/tree/main/examples/tdengineTelemetryService/deployment