如何在 Kubernetes 上安装 IoT Edge(预览)How to install IoT Edge on Kubernetes (Preview)

IoT Edge 可与 Kubernetes 集成,将 Kubernetes 用作可复原的且高度可用的基础结构层。IoT Edge can integrate with Kubernetes using it as a resilient, highly available infrastructure layer. 下面是此支持在高级别 IoT Edge 解决方案中的适当位置:Here is where this support fits in a high level IoT Edge solution:

k8s 简介

提示

此集成的一个不错的心理模型是将 Kubernetes 视为除 Linux 和 Windows 外可供 IoT Edge 应用程序运行的另一个操作环境。A good mental model for this integration is to think of Kubernetes as another operating environment IoT Edge applications can run on in addition to Linux and Windows.

体系结构Architecture

在 Kubernetes 上,IoT Edge 为边缘工作负载部署提供自定义资源定义 (CRD)。On Kubernetes, IoT Edge provides Custom Resource Definition (CRD) for edge workload deployments. IoT Edge 代理承担 CRD 控制器 的角色,协调云托管的所需状态与本地群集状态。IoT Edge Agent assumes the role of a CRD controller that reconciles cloud-managed desired state with the local cluster state.

模块生存期由 Kubernetes 计划程序管理,该计划程序将维护模块的可用性及选择其位置。Module lifetime is managed by the Kubernetes scheduler, which maintains module availability and chooses their placement. IoT Edge 管理顶层运行的边缘应用程序平台,会持续将 IoT 中心内指定的所需状态与边缘群集上的状态相协调。IoT Edge manages the edge application platform running on top, continuously reconciling the desired state specified in IoT Hub with the state on the edge cluster. 应用程序模型仍是用户熟悉的基于 IoT Edge 模块和路由的模型。The application model is still the familiar model based on IoT Edge modules and routes. IoT Edge 代理控制器执行从 IoT Edge 的应用程序模型到 Kubernetes 本机构造(例如 Pod、部署、服务等)的自动转换。 The IoT Edge Agent controller performs automatic translation IoT Edge's application model to the Kubernetes native constructs like pods, deployments, services etc.

下面是概要性的体系结构示意图:Here is a high-level architecture diagram:

kubernetes 体系结构

边缘部署的每个组件划归到特定于设备的 Kubernetes 命名空间,因而可在多个边缘设备及其部署之间共享相同的群集资源。Every component of the edge deployment is scoped to a Kubernetes namespace specific to the device, making it possible to share the same cluster resources among multiple edge devices and their deployments.

备注

Kubernetes 上的 IoT Edge 以公共预览版提供。IoT Edge on Kubernetes is in public preview.

教程和参考Tutorials and references

有关详细信息(包括深度教程和参考),请参阅 IoT Edge on Kubernetes 预览版文档迷你站点Please see the IoT Edge on Kubernetes preview docs mini-site for more information, including in-depth tutorials and references.