Abstract: This article will be from KubeEdge architecture design concept, KubeEdge code catalog overview, KubeEdge cluster deployment three aspects with you to understand KubeEdge.

KubeEdge, Kube+Edge, as its name implies, relies on K8s’ container orchestration and scheduling capabilities to achieve cloud-side collaboration, computing subsidence and smooth access of massive devices. This article will take you to know KubeEdge from three aspects: KubeEdge architecture design concept, KubeEdge code catalog overview, KubeEdge cluster deployment.

KubeEdge architecture design concept

1. Kubernetes architecture

Here is a classic K8s architecture, K8s I believe we have known more, it is mainly divided into control surface and data surface, and now K8s ecology has been very popular, about application management and container management has formed a set of standards, here are some of its advantages:

Only the API Server can access etCD

Components access cluster state through API Server

The API is declarative in design

API objects are complementary and composable to each other

Use event listening in preference to polling

2. Advantages and pain points of constructing edge computing based on Kubernetes

The core advantages mainly include four aspects:

Containerized application packaging: Now has become a trend of application delivery, can I put my application package to the container, I pack only once, can run in various places, this we IOT if applied to the field, we have a lot of traditional IOT embedded devices, it’s really a lot of strong hardware and software related, if in a hardware, may be software is about to change, If MY container is packaged and the device supports container Runtime, I can run the container on any IOT device.

General application Abstract definition: K8s API, including Development and POD, has formed a set of standards in the industry, which are relatively understood and recognized by everyone. In fact, we build this platform based on these applications, which is easier for everyone to accept.

Loose coupling architecture: it has good scalability. For example, we can define some apis through CRD based on K8s. For example, we can define some apis for devices in IOT through device management CRD. There are also some extensibility, for example, its CIA can dock with various runtime, we have some edge nodes which have very limited resources, we can dock with some lightweight runtime.

The key pain points are:

1) Limited resources

Gateway device, 128MB memory

A K8s cluster requires at least 1 GB of memory

2) Poor network

The edge is on a private network and has no public IP address

Cloud edge spans the public network, with limited bandwidth and high latency

K8s’ List-Watch requires a data center network

3) How can the edge be autonomous offline

The network is unstable and can go offline at any time

Edge services can work offline

Edges offline can fail back up

4) Equipment access and management

Lack of edge device abstraction

The edge device access protocol support is missing

3. KubeEdge architecture and core concept

We this architecture is mainly points cloud, side, side of three parts, the cloud is above our control surface, the edge of the edge is our node, terminal is run by some of our end side equipment, cloud on the left is a K8s master, there is no change the native K8s control surfaces, we added a component are called CloudCore, Its components on the Cloud will mainly take some things on the K8s control surface, do some processing through EdgeController and DeviceController, and then through the Cloud Hub below, Cloud Hub mainly communicates with the side end. There’s an EdgeHub on the side that communicates with the Cloud Hub and then pulls the data down.

On the edge, you can manage applications and devices. On the left side of application management, you can run a Edged device. On the right side, you can run DeviceTwin and EventBus, respectively, for application and device management. For example, when we distribute the elements of our application or device from the cloud, do we first store it in a database, and then put it into the edge edge or device, so that when the cloud network is disconnected or the edge node is restarted, the edge edge that I used can take the application source data out of the database, In this way, services can be restored in case of a fault.

Core Concepts:

1) Reliable cloud side coordination

Bidirectional multiplexing message channels that support edge nodes on private networks

Websocket + message encapsulation, greatly reduce communication pressure, high latency can still work normally

Cloud – side message verification, do not lose data when the network is unstable

2) Edge offline autonomy

Node metadata is persisted to achieve node-level offline autonomy

No list-watch is required for node fault recovery, reducing network pressure and fast ready

3) Extremely lightweight edges

Restructured Kubelet function module, extremely lightweight (~ 70MB memory footprint)

Supports CRI integration of Containerd and CRI-O to optimize runtime resource consumption

4) Edge device management

The cloud manages edge devices through the Kubernetes API

4. KubeEdge Community Ecology

KubeEdgeDedicated to KubernetesThe ability to expand to the edge

The industry’s first edge container platform project

Apache 2.0 protocol

It was donated to CNCF Foundation in March 2019

In September 2020, it will be upgraded to an incubator level hosting project

K8s IoT Edge WG reference architecture

Built based on Kubernetes, 100% compatible with K8s API

Nine feature versions. The latest version is V1.4.0

3100+ Star, 810+ Fork, **500+** contributors

At present, two SIG of Device/IoT and MEC have been established

Enterprises participating in community contribution include: China Unicom, ARM, China Mobile, Xiyun, China Telecom, Speed Cloud, JD.com, SEL Lab of Zhejiang University, EMQ, InfoBlox, Inovex, Midokura, etc

KubeEdge code directory overview

ADOPTERS are some of the ADOPTERS in our community. For example, if you use KubeEdge and want to become a participant or advisor, you can submit a PR document and write to the ADOPTER. The following is the code directory. Cloud, edge, Mappers, and OWNERS are the matiners for our project. They are responsible for checking code. If you are contributing to our community, we can add you to OWNERS, checking code and reviewing code for us.

KubeEdge cluster deployment

1KubeEdge Cluster deployment tool — keadm

This is a reference to K8s KubeEdge cluster, you can deploy a key KubeEdge cluster, in the deployment of KubeEdge cluster, to install a K8s master, the master with any K8s standards can be, this keadm is based on K8s deployment of KubeEdge system.

Subcommand parameters:

Init: Deploy cloud components

Join: Deploys edge components

Gettoken: obtains edge startup credentials from the cloud

Reset: Resets the cloud and edge of the KubeEdge cluster

2. KubeEdge deployment — cloud

To install our cloud on the already installed master, use init:

Important parameters:

–kube-config: connect to K8s Master

–advertise-address: indicates the IP address issued to the edge certificate

3. KubeEdge Deployment — edge end

The edge uses our join command:

Important parameters:

–token: the credential used to access the cloud when the edge end is started

–cloudcore-ipport: indicates the cloud IP address accessed by the edge end

This article is shared from Huawei cloud community “KubeEdge Architecture Interpretation: Cloud native edge computing Platform”, original author: technology torch bearer.

Click to follow, the first time to learn about Huawei cloud fresh technology ~