ToB企服应用市场:ToB评测及商务社交产业平台

标题: KubeEdge v1.17.0发布!数据处置处罚能力与易用性全面提拔 [打印本页]

作者: 北冰洋以北    时间: 2024-5-23 09:17
标题: KubeEdge v1.17.0发布!数据处置处罚能力与易用性全面提拔
本文分享自华为云社区《KubeEdge v1.17.0发布!数据处置处罚能力与易用性全面提拔》 ,作者: 云容器大未来。
KubeEdge社区v1.17.0 版本正式发布。新版本为边缘节点和设备带来了更多的新能力,同时一连在易用性上做了提拔。

KubeEdge v1.17.0 新增特性:
新特性概览

支持边缘 Pods 使用 InClusterConfig 访问 Kube-APIServer

Kubernetes 支持 Pods 使用 InClusterConfig 机制直接访问 Kube-APIServer,然而在边缘场景,边缘 Pods 和 Kube-APIServer 通常不在一个网络情况下,无法直接访问。在1.17.0 新版本中,通过开启 MetaServer 和 DynamicController 模块,边缘 Pods 同样可以使用 InClusterConfig 机制直接访问 Kube-APIServer。
该特性在本版本中作为 Alpha 特性发布,如果你需要使用,您需要开启边缘 List-Watch 开关并配置 requireAuthorization的featureGates。
  1. apiVersion: edgecore.config.kubeedge.io/v1alpha2
  2. kind: EdgeCore
  3. featureGates:
  4.   requireAuthorization: true
  5. modules:
  6.   ...
  7.   metaManager:
  8.     metaServer:
  9.       enable: true
复制代码
更多信息可参考:https://github.com/kubeedge/kubeedge/pull/5524
https://github.com/kubeedge/kubeedge/pull/5541
Mapper 支持流数据上报

1.17 版本中,针对当前 Mapper 只能处置处罚离散型的设备数据,无法处置处罚流数据的问题,为 Mapper-Framework 提供视频流数据处置处罚的能力。在新版本中,能够支持 KubeEdge 管理边缘摄像头设备,获取摄像头收罗的视频流,并将视频流保存为帧文件大概视频文件,增强 KubeEdge 边缘设备管理能力。
边缘摄像头设备管理

1.17 版本提供基于 Onvif 协议的内置 Mapper,实现 Onvif 设备驱动功能,能够根据用户配置文件中的定义连接摄像头设备,获取设备的鉴权文件与 RTSP 视频流,将 Onvif 摄像头设备纳管进 KubeEdge 集群。Onvif 设备的一个示例 device-instance 配置文件如下:
  1. apiVersion: devices.kubeedge.io/v1beta1
  2. kind: Device
  3. metadata:
  4.   name: onvif-device-01
  5.   namespace: default
  6. spec:
  7.   deviceModelRef:
  8.     name: onvif-model   # need to be the same as the model name defined in onvif-model.yaml
  9.   protocol:
  10.     protocolName: onvif
  11.     configData:
  12.       url: 192.168.168.64:80   # Replace it with the address of your own onvif camera
  13.       userName: admin          # Replace it with the username of your own onvif camera
  14.       password: /etc/secret/password   # Fill in the fields according to your secret.yaml
  15.   nodeName: edge-node          # Replace it with your edge node name
  16.   properties:
  17.     - name: getURI
  18.       visitors:
  19.         protocolName: onvif
  20.         configData:
  21.           url: 192.168.168.64:80
  22.           userName: admin
  23.           password: /etc/secret/password
  24.           dataType: string
复制代码
视频流数据处置处罚

新版本增强 Mapper-Framework 数据面能力,内置流数据处置处罚功能。用户能够在 device-instance 文件中进行配置,将边缘摄像头设备上报的视频流截取保存为视频片段文件以及视频帧文件,流数据处置处罚的 device-instance 文件示例如下:
  1. apiVersion: devices.kubeedge.io/v1beta1
  2. kind: Device
  3. metadata:
  4.   name: onvif-device-01
  5. ...
  6. properties:
  7.   - name: saveFrame                  # Convert video stream into frame
  8.     visitors:
  9.       protocolName: onvif
  10.       configData:
  11.         format: jpg                  # Frame file format
  12.         outputDir: /tmp/case/        # Directory for output frame files
  13.         frameCount: 30               # Number of output frames
  14.         frameInterval: 1000000       # Time interval between frames (The unit is nanoseconds)
  15.         dataType: stream
  16.   - name: saveVideo                  # Convert video streams into video clips
  17.     visitors:
  18.       protocolName: onvif
  19.       configData:
  20.         frameCount: 1000             # The number of frames the video clip contains
  21.         format: mp4                  # Video clip format
  22.         outputDir: /tmp/case/        # Directory for output video clip
  23.         videoNum: 2                  # Number of video clips
  24.         dataType: stream
复制代码
更多信息可参考:
https://github.com/kubeedge/kubeedge/pull/5448
https://github.com/kubeedge/kubeedge/pull/5514
https://github.com/kubeedge/mappers-go/pull/127
支持边缘子模块自启动

由于配置大概可规复的情况问题,例如进程启动次序等,导致 EdgeCore 启动失败。例如,当 containerd.socket 没有就绪时,Edged 启动 Kubelet 失败会导致 EdgeCore 直接退出。
在新版本中,我们改进了 Beehive 框架,支持边缘子模块重启。用户可以通过启动 moduleRestart featureGates,将 EdgeCore 的子模块设置为自动重启,而不是整个 EdgeCore 退出。
该特性在本版本中作为 Alpha 特性发布,如果你需要使用,您需要配置 moduleRestart 的 featureGates。
  1. apiVersion: edgecore.config.kubeedge.io/v1alpha2
  2. kind: EdgeCore
  3. featureGates:
  4.   moduleRestart: true
复制代码
更多信息可参考:
https://github.com/kubeedge/kubeedge/pull/5513
https://github.com/kubeedge/kubeedge/pull/5514
引入 keadm ctl 命令,支持在边缘查询和重启 pod

当边缘节点离线时,我们无法通过 kubectl 检察边缘节点上的 pod,在 1.17 中可以在边缘节点上通过 keadm ctl get/restart pod [flag] 对 pod 进行查询或重启。
如果需要使用该特性,您需要开启 metaserver 开关。
  1. [root@centos-2 bin]# keadm ctl get pod -h
  2. Get pods in edge node
  3. Usage:
  4.   keadm ctl get pod [flags]
  5. Flags:
  6.   -A, --all-namespaces     If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace
  7.   -h, --help               help for pod
  8.   -n, --namespace string   Specify a namespace (default "default")
  9.   -o, --output string      Output format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file, custom-columns, custom-columns-file, wide)
  10.   -l, --selector string    Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
复制代码
  1. [root@centos-2 bin]# keadm ctl restart pod -h
  2. Restart pods in edge node
  3. Usage:
  4.   keadm ctl restart pod [flags]
  5. Flags:
  6.   -h, --help               help for pod
  7.   -n, --namespace string   Specify a namespace (default "default")
复制代码
Demo 演示:
  1. [root@centos-2 bin]# alias kectl='keadm ctl'
  2. [root@centos-2 bin]# kectl get pod -owide -A
  3. NAMESPACE   NAME                                READY   STATUS    RESTARTS      AGE   IP               NODE       NOMINATED NODE   READINESS GATES
  4. default     nginx-deployment-58b54fbd94-f5q7p   1/1     Running   1 (20m ago)   22m   10.88.0.2        centos-2   <none>           <none>
  5. kubeedge    edge-eclipse-mosquitto-scvrk        1/1     Running   1 (16m ago)   28m   192.168.94.106   centos-2   <none>           <none>
  6. [root@centos-2 bin]# kectl restart pod -n kubeedge    edge-eclipse-mosquitto-scvrk
  7. 393cbcac4b484a4a28eee7dd2d63b33137a10a84d5f6eed6402b9a23efc6aef0
  8. af4059137ced56b365da7e1c43d3ea218e3090ab7644a105651ca4661ddf26f0
  9. [root@centos-2 bin]# kectl get pod -owide -A
  10. NAMESPACE   NAME                                READY   STATUS    RESTARTS      AGE   IP               NODE       NOMINATED NODE   READINESS GATES
  11. default     nginx-deployment-58b54fbd94-f5q7p   1/1     Running   1 (21m ago)   23m   10.88.0.2        centos-2   <none>           <none>
  12. kubeedge    edge-eclipse-mosquitto-scvrk        1/1     Running   2 (10s ago)   29m   192.168.94.106   centos-2   <none>           <none>
复制代码
更多信息可参考:
https://github.com/kubeedge/kubeedge/pull/5535
https://github.com/kubeedge/kubeedge/pull/5504
易用性提拔:基于 Keadm 的部署能力增强

  1. [root@centos-2 bin]# keadm --help|grep manifest
  2.   manifest    Checks and generate the manifests.
  3. example:
  4. [root@centos-1 keepalived]# keadm manifest --advertise-address=<cloud-ip> --profile version=v1.17.0
复制代码
  1. [root@centos-2 bin]# keadm  join -h|grep image-repository
  2.       --image-repository string          Use this key to decide which image repository to pull images from
  3. example:
  4. [root@centos-2 bin]# keadm join --cloudcore-ipport <cloud-ip>:10000 --kubeedge-version=1.17.0 --remote-runtime-endpoint=unix:///run/cri-dockerd.sock --image-repository my.harbor.cn/kubeedge --token xxxx
复制代码
  1. [root@centos-2 bin]# keadm  reset --help
  2. ...
  3. Available Commands:
  4.   cloud       Teardowns CloudCore component
  5.   edge        Teardowns EdgeCore component
  6. Flags:
  7.       --force                Reset the node without prompting for confirmation
  8.   -h, --help                 help for reset
  9.       --kube-config string   Use this key to set kube-config path, eg: $HOME/.kube/config (default "/root/.kube/config")
  10. [root@centos-2 bin]# keadm  reset cloud --help
  11. ...
  12. Flags:
  13.       --force                Reset the node without prompting for confirmation
  14.   -h, --help                 help for cloud
  15.       --kube-config string   Use this key to set kube-config path, eg: $HOME/.kube/config (default "/root/.kube/config")
  16. [root@centos-2 bin]# keadm  reset edge --help
  17. ...
  18. Flags:
  19.       --force   Reset the node without prompting for confirmation
  20.   -h, --help    help for edge
复制代码
更多信息可参考:
https://github.com/kubeedge/kubeedge/issues/5317
https://github.com/kubeedge/kubeedge/pull/5462
https://github.com/kubeedge/kubeedge/pull/5463
https://github.com/kubeedge/kubeedge/pull/5540
Mapper 框架添加 MySQL 数据库

在 1.17 的 Mapper-Framework 中,数据推送模块新增了 MySQL 数据库,如果用户想使用 MySQL 作为某个 property 的 PushMethod,可以在 device instance 的对应 property 下, 通过如下配置即可:
  1. apiVersion: devices.kubeedge.io/v1beta1
  2. kind: Device
  3. ...
  4. spec:
  5.   properties:
  6.     - name: xxx
  7.       ...
  8.       pushMethod:
  9.         dbMethod:
  10.           mysql:
  11.             mysqlClientConfig:
  12.               addr: 127.0.0.1:3306    #the url to connect to the mysql database.
  13.               database: kubeedge      #database name
  14.               userName: root          #user name
复制代码
更多信息可参考:https://github.com/kubeedge/kubeedge/pull/5376
升级 K8s 依赖到 v1.28

新版本将依赖的 Kubernetes 版本升级到 v1.28.6,您可以在云和边缘使用新版本的特性。更多信息可参考:https://github.com/kubeedge/kubeedge/pull/5412
版本升级注意事项

自 v1.17.0 起,我们推荐在使用 keadm 安装 KubeEdge 时使用 --kubeedge-version= 来指定具体版本,--profile version= 会渐渐废弃。
致谢

感谢 KubeEdge 社区技术引导委员会 (TSC)、各 SIG 成员对 v1.17 版本开发的支持与贡献,未来 KubeEdge 将一连在新场景探索与支持、稳固性、安全性、可扩展性等方面一连发展与演进!
相关链接

Release Notes:https://github.com/kubeedge/kubeedge/blob/master/CHANGELOG/CHANGELOG-1.17.md
 
点击关注,第一时间了解华为云奇怪技术~
 

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。




欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/) Powered by Discuz! X3.4