创立TelemetryService Yaml 文件
#telemetry_service.yaml
apiVersion: shifu.edgenesis.io/v1alpha1
kind: TelemetryService
metadata:
name: push-file-mp4
namespace: devices
spec:
telemetrySeriveEndpoint: http://telemetryservice.shifu-service.svc.cluster.local
serviceSettings:
MinIOSetting:
# MinIO服务应用的Secret,或者你能够指定AccessKey和SecretKey
Secret: minio-secret
# deviceShifu发送给TelemetryService的申请的超时工夫
RequestTimeoutMS: 2500
# 你要上传到的Bucket
Bucket: test-bucket
# 上传的文件后缀名
FileExtension: mp4
# MinIO服务的地址
ServerAddress: minio.data.svc.cluster.local:9000
创立Secret
在username
和password
域中填写在MinIO GUI中创立的AccessId和AccessKey,或者间接填写装置MinIO时指定的用户名和明码。
kubectl create secret generic minio-secret --from-literal=username=your_username --from-literal=password=your_password -n devices
备注
如果你有多个遥测服务,你能够把它们写在一个文件里,用—进行宰割。
编辑Configmap Yaml文件
# configmap.yaml
data:
telemetries: |
telemetrySettings:
# 每次遥测服务的间隔时间
telemetryUpdateIntervalInMilliseconds: 10000
# shifuDevice从edgeDevice取得文件内容的申请的超时工夫
telemetryTimeoutInMilliseconds: 2500
telemetries:
push-file:
properties:
# 拜访你的edgeDevice的这个办法,取得要发送给TelemetryService的数据
instruction: get_file_mp4
pushSettings:
# 将其批改为你刚创立TelemetryService的名字
telemetryCollectionService: push-file-mp4
再次部署deviceShifu
而后你须要再次部署deviceShifu,这样TelemetryService就会将采集到的文件内容存到MinIO中。 文件名会按{device-name}/{time(RFC3339)}.{file-extension}
的格局存入对应的Bucket内。
例子
上面是一个例子,帮忙你更好地理解如何应用它。如果你想测试能够在本地运行mockdevice.go而后批改edgedevice.yaml中的address,改为本人本地的IP即可。
https://github.com/Edgenesis/…
本文由边无际受权公布
发表回复