Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Complete the README and the tutorial #8

Merged
merged 1 commit into from
Sep 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test: generate fmt vet manifests
source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); go test ./... -coverprofile cover.out

# Build manager binary
manager: generate fmt vet
build: generate fmt vet
go build -o bin/manager main.go

# Run against the configured Kubernetes cluster in ~/.kube/config
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ This repository contains three CRD/controllers, Device, DeviceService and Device

For details of the design, please see the [document](https://github.com/openyurtio/openyurt/blob/master/docs/proposals/20210310-edge-device-management.md).

## Architecture

Yurt-device-controller introduces an approach leverages existing edge computing platforms, like EdgeX Foundry, and uses Kubernetes custom resources to abstract edge devices.
Inspiring by the Unix philosophy, "Do one thing and do it well", we believe that Kubernetes should focus on managing computing resources while edge devices management can be done by adopting existing edge computing platforms.
Therefore, we define several generic custom resource definitions(CRD) that act as the mediator between OpenYurt and the edge platform.
Any existing edge platforms can be integrated into the OpenYurt by implementing custom controllers for these CRDs. These CRDS and corresponding controllers allow users to manage edge devices in a declarative way, which provides users with a Kubernetes-native experience and reduces the complexity of managing, operating and maintaining edge platform devices.

![yurt-device-controller-architecture](docs/img/yurt-device-controller-architecture.png)

The major Yurt-Device-Controller components consist of:

- **Device controller**: It can abstract device objects in the edge platform into device CRs and synchronize them to the cloud. With the support of device controller, users can influence the actual device on the edge platform through the operation of cloud device CR, such as creating a device, deleting a device, updating device attributes (such as setting the light on and off, etc.).
- **DeviceService controller**: It can abstract deviceService objects in the edge platform into deviceService CRs and synchronize them to the cloud. With the support of deviceService Controller, users can view deviceService information of edge platforms in the cloud, and create or delete deviceService CRs to affect the actual deviceService of edge platforms.
- **DeviceProfile controller**: It can abstract deviceProfile objects in the edge platform into deviceProfile CRs and synchronize them to the cloud. With the support of deviceProfile Controller, users can view deviceProfile information of edge platforms in the cloud, and create or delete deviceProfile CRs to affect the actual deviceService of edge platforms.

## Getting Start

To use the yurt-device-controller, you need to deploy the OpenYurt cluster in advance and meet the following two conditions:
Expand Down
Binary file added docs/img/yurt-device-controller-architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions docs/yurt-device-controller-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -479,3 +479,16 @@ The following operation uses `random-boolean-device` device, which is automatica
{"device":"random-boolean-device","origin":1632378327952106491,"readings":[{"origin":1632378327951971484,"device":"random-boolean-device","name":"Bool","value":"false","valueType":"Bool"}],"EncodedEvent":null}
```

## Make binary or image

1. User can build the binary for local testing, golang v1.15+ is required. The generated binary file is in path `~\yurt-device-controller\bin\manager` .
```bash
$ cd yurt-device-controller
$ make build
```
2. User can build image for local testing, golang v1.15+ and docker environment are required.
```bash
$ cd yurt-device-controller
$ make docker-build IMG=<ImageName:version>
```