Giter VIP home page Giter VIP logo

examples's Introduction

KubeEdge

Go Report Card LICENSE Releases CII Best Practices

English | 简体中文

KubeEdge is built upon Kubernetes and extends native containerized application orchestration and device management to hosts at the Edge. It consists of cloud part and edge part, provides core infrastructure support for networking, application deployment and metadata synchronization between cloud and edge. It also supports MQTT which enables edge devices to access through edge nodes.

With KubeEdge it is easy to get and deploy existing complicated machine learning, image recognition, event processing and other high level applications to the Edge. With business logic running at the Edge, much larger volumes of data can be secured & processed locally where the data is produced. With data processed at the Edge, the responsiveness is increased dramatically and data privacy is protected.

KubeEdge is an incubation-level hosted project by the Cloud Native Computing Foundation (CNCF). KubeEdge incubation announcement by CNCF.

Advantages

  • Kubernetes-native support: Managing edge applications and edge devices in the cloud with fully compatible Kubernetes APIs.
  • Cloud-Edge Reliable Collaboration: Ensure reliable messages delivery without loss over unstable cloud-edge network.
  • Edge Autonomy: Ensure edge nodes run autonomously and the applications in edge run normally, when the cloud-edge network is unstable or edge is offline and restarted.
  • Edge Devices Management: Managing edge devices through Kubernetes native APIs implemented by CRD.
  • Extremely Lightweight Edge Agent: Extremely lightweight Edge Agent(EdgeCore) to run on resource constrained edge.

How It Works

KubeEdge consists of cloud part and edge part.

Architecture

In the Cloud

  • CloudHub: a web socket server responsible for watching changes at the cloud side, caching and sending messages to EdgeHub.
  • EdgeController: an extended kubernetes controller which manages edge nodes and pods metadata so that the data can be targeted to a specific edge node.
  • DeviceController: an extended kubernetes controller which manages devices so that the device metadata/status data can be synced between edge and cloud.

On the Edge

  • EdgeHub: a web socket client responsible for interacting with Cloud Service for the edge computing (like Edge Controller as in the KubeEdge Architecture). This includes syncing cloud-side resource updates to the edge, and reporting edge-side host and device status changes to the cloud.
  • Edged: an agent that runs on edge nodes and manages containerized applications.
  • EventBus: a MQTT client to interact with MQTT servers (mosquitto), offering publish and subscribe capabilities to other components.
  • ServiceBus: an HTTP client to interact with HTTP servers (REST), offering HTTP client capabilities to components of cloud to reach HTTP servers running at edge.
  • DeviceTwin: responsible for storing device status and syncing device status to the cloud. It also provides query interfaces for applications.
  • MetaManager: the message processor between edged and edgehub. It is also responsible for storing/retrieving metadata to/from a lightweight database (SQLite).

Kubernetes compatibility

Kubernetes 1.20 Kubernetes 1.21 Kubernetes 1.22 Kubernetes 1.23 Kubernetes 1.24 Kubernetes 1.25 Kubernetes 1.26 Kubernetes 1.27 Kubernetes 1.28 Kubernetes 1.29
KubeEdge 1.12 - - - - - - -
KubeEdge 1.13 + - - - - - -
KubeEdge 1.14 + + - - - - -
KubeEdge 1.15 + + + + - - -
KubeEdge 1.16 + + + + + - -
KubeEdge 1.17 + + + + + + -
KubeEdge HEAD (master) + + + + + + +

Key:

  • KubeEdge and the Kubernetes version are exactly compatible.
  • + KubeEdge has features or API objects that may not be present in the Kubernetes version.
  • - The Kubernetes version has features or API objects that KubeEdge can't use.

Guides

Get start with this doc.

See our documentation on kubeedge.io for more details.

To learn deeply about KubeEdge, try some examples on examples.

Roadmap

Meeting

Regular Community Meeting:

Resources:

Contact

If you need support, start with the troubleshooting guide, and work your way through the process that we've outlined.

If you have questions, feel free to reach out to us in the following ways:

Contributing

If you're interested in being a contributor and want to get involved in developing the KubeEdge code, please see CONTRIBUTING for details on submitting patches and the contribution workflow.

Security

Security Audit

A third party security audit of KubeEdge has been completed in July 2022. Additionally, the KubeEdge community completed an overall system security analysis of KubeEdge. The detailed reports are as follows.

Reporting security vulnerabilities

We encourage security researchers, industry organizations and users to proactively report suspected vulnerabilities to our security team ([email protected]), the team will help diagnose the severity of the issue and determine how to address the issue as soon as possible.

For further details please see Security Policy for our security process and how to report vulnerabilities.

License

KubeEdge is under the Apache 2.0 license. See the LICENSE file for details.

examples's People

Contributors

daixiang0 avatar edisonxiang avatar fisherxu avatar fujitatomoya avatar gy95 avatar kadisi avatar kevin-wangzefeng avatar kubeedge-bot avatar maurya-anuj avatar permentmemory avatar reselbob avatar rzr avatar sharmapulkit04 avatar shelley-baoyue avatar sids-b avatar sujithsimon22 avatar supriyasupu avatar yechenglin007 avatar zqzzq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

examples's Issues

Add kubeedge demo for KubeCon EU 2019

This demo is used for demo show case in KubeCon EU 2019.

This task should be close by the end of April.

Thoughts for demo cases?

Dedicated demos:

  • kubeedge + Raspberry Pi + tensorflow?

I think the demo should be easy to use and cooool :)

How kubeedge-web-demo can work?

I follow the instruction to setup kubeedge-web-demo, but pi-player-app can't receive any message from topic when I click play on web, so nothing can play.

I wonder it's any config apply to speaker? I'm confused about device and devicemodel...

the log of kubeedge-web-app

$ sudo ./kubeedge-web-app
2019/09/10 11:25:20 Get kubeConfig successfully
2019/09/10 11:25:20 Get crdClient successfully
2019/09/10 11:25:20.255 [I]  http server Running on http://:80
2019/09/10 11:25:25 PlayTrack: 1
2019/09/10 11:25:25 deviceStatus is &{{[{track {1 map[timestamp:1568 type:string]} {unknown map[timestamp:1568 type:string]}}]}}
2019/09/10 11:25:25 Track [ 1 ] will be played on speaker speaker-01

But nothing happen on pi-player-app...
the log of pi-player-app

$ ./pi-player-app 
Files read dirnames result: [1.mp3]
Loading track key: 1 value: 1.mp3
Get music list successfully
Create mqtt client successfully
Connect mqtt client successfully
Subscribe mqtt topic successfully

Enable certificate rotation in security demo

In the initial version of security-demo, certificate rotation was not possible due to keystore dependency in ghostunnel. The keystore is generated one-time during deployment and during rotation of certificate and keys, the updated keystore was not being created in the scripts.

Ghostunnel supports two formats of keystore, pkcs12 and single file containing certificate and key.
To generate a single file with certificate and key, spiffe-helper must be updated to generate the single file format given the same names of certificate and key in helper.conf.

温度传感器通过mqtt无法正常获取。

kubeedge-v1.1.0,温度传感器mqqt发送,不成功,请确认原因.
步骤1:
kubectl apply -f devicemodel.yaml

apiVersion: devices.kubeedge.io/v1alpha1
kind: Device
metadata:
name: temperature
labels:
description: 'temperature'
manufacturer: 'test'
spec:
deviceModelRef:
name: temperature-model
nodeSelector:
nodeSelectorTerms:
- matchExpressions:
- key: ''
operator: In
values:
- node-test001 # 节点名称
status:
twins:
- propertyName: temperature-status
desired:
metadata:
type: string
value: ''
步骤2:
kubectl apply -f device.yaml

apiVersion: devices.kubeedge.io/v1alpha1
kind: DeviceModel
metadata:
name: temperature-model
namespace: default
spec:
properties:
- name: temperature-status
description: Temperature collected from the edge device
type:
string:
accessMode: ReadOnly
defaultValue: ''

步骤3:修改并启动edgecore应用
修改edge.yaml

mqtt:
server: tcp://127.0.0.1:1883 # external mqtt broker url.
internal-server: tcp://127.0.0.1:1884 # internal mqtt broker url.
mode: 2 # 0: internal mqtt broker enable only. 1: internal and external mqtt broker enable. 2: external mqtt broker enable only.
qos: 0 # 0: QOSAtMostOnce, 1: QOSAtLeastOnce, 2: QOSExactlyOnce.
retain: false # if the flag set true, server will store the message and can be delivered to future subscribers.
session-queue-size: 100 # A size of how many sessions will be handled. default to 100.

edgehub:

步骤4:发送数据:
订阅topic:
mosquitto_sub -t "$hw/events/device/temperature/twin/update"

发送数据:
mosquitto_pub -h localhost -p 1883 -t "$hw/events/device/temperature/twin/update" -m "{"event_id":"","timestamp":1578400875814,"twin":{"temperature-status":{"last":{"actual":{"value":"27C","metadata":{"timestamp":1578400873775}},"optional":false,"metadata":{"type":"string"}},"current":{"actual":{"value":"27C","metadata":{"timestamp":1578400875814}},"optional":false,"metadata":{"type":"string"}}}}}"

步骤5:kubectl get device temperature -oyaml -w
一直无法正常获取到温度数据,请确认问题。

"Update rejected due to the device is not existed" on kubeedge-temperature-demo

I know an almost similar issue has been posted and some bug was fixed in the past. But I am facing almost the same problem right now.

I manually set the temperature value myself. I have hooked in to '$hw/#' topic and found the following log:

$hw/events/device/temperature/twin/update {"event_id":"","timestamp":0,"twin":{"temperature-status":{"actual":{"value":"10C"},"metadata":{"type":"Updated"}}}}
$hw/events/device/temperature/twin/update/result {"event_id":"","timestamp":1598546351511,"code":404,"reason":"Update rejected due to the device is not existed"}

If i try to get the temperature with kubectl get device temperature -ojson -w, what I get is:

{
"apiVersion": "devices.kubeedge.io/v1alpha1",
"kind": "Device",
"metadata": {
"annotations": {
"kubectl.kubernetes.io/last-applied-configuration": "{"apiVersion":"devices.kubeedge.io/v1alpha1","kind":"Device","metadata":{"annotations":{},"labels":{"description":"temperature","manufacturer":"test"},"name":"temperature","namespace":"default"},"spec":{"deviceModelRef":{"name":"temperature-model"},"nodeSelector":{"nodeSelectorTerms":[{"matchExpressions":[{"key":"","operator":"In","values":["kubedge-edge-1"]}]}]}},"status":{"twins":[{"desired":{"metadata":{"type":"string"},"value":""},"propertyName":"temperature-status"}]}}\n"
},
"creationTimestamp": "2020-08-27T16:03:21Z",
"generation": 2,
"labels": {
"description": "temperature",
"manufacturer": "test"
},
"name": "temperature",
"namespace": "default",
"resourceVersion": "34598",
"selfLink": "/apis/devices.kubeedge.io/v1alpha1/namespaces/default/devices/temperature",
"uid": "bdcaa728-c3ba-4168-9262-f03c6d21b3bf"
},
"spec": {
"deviceModelRef": {
"name": "temperature-model"
},
"nodeSelector": {
"nodeSelectorTerms": [
{
"matchExpressions": [
{
"key": "",
"operator": "In",
"values": [
"kubedge-edge-1"
]
}
]
}
]
}
},
"status": {
"twins": [
{
"desired": {
"metadata": {
"type": "string"
},
"value": ""
},
"propertyName": "temperature-status"
}
]
}
}

can anyone help me on how to make it work?

Bug with the raspberry pi example

The pod seems to be running fine and seems to be detecting changes in the led value after PR: #24. But now there is a problem with reading the gpio-number from the configmap. After running the code glog.Info(pinNumber) right before the call lightdriver.TurnOff(pinNumber) i read the output 0. So the light isn't turning on.

is there any necessity save static js to local

Hey,I jus setup a kubeedge cluster,wanna try some demo like kubeedge-counter-demo,but got some err

  1. because my network problem,it`s tooo slow load jquery-1.10.2.min.js

  2. from some unknown reasons, i got error
    image

For user especially for beginners,if it is necessity save all static file to local dir?
change file kubeedge-counter-demo/web-controller-app/views/layout.html like below

    <script src="/static/js/jquery-1.10.2.min.js"></script> 
    <script src="/static/js/html5shiv.js"></script>                              
    <script src="/static/js/respond.min.js"></script>

kubeedge-counter-demo device status not update when change the device crd resource

View the web app page current status is "ON" and query status is "ON",after execute kubectl apply -f kubeedge-counter-demo/crds/kubeedge-counter-instance.yaml for some config adjust the query status is "OFF" and execute "ON" not work the status is also "OFF".
I have check the web-controller-app container log but there also no error log.

/opt/kubeedge/deviceProfile.json: no such file or directory

when i run light_driver.go,by go run light_mapper.go,Error:
E0116 19:03:18.082379 8173 light_mapper.go:121] Error while reading from config map Error while reading from config map open /opt/kubeedge/deviceProfile.json: no such file or directory exit status 1

Desired property replicates for each field in CRD

Hello,

I was trying to change the led-mapper example to integrate device twins with my another application.
When I try to change multiple expected values in instance.yaml of device, the updated document is formed with only last desired value for all properties. Does instance CRD support only one desired field ?

What I mean,

My instance.yaml:

apiVersion: devices.kubeedge.io/v1alpha1
kind: Device
metadata:
name: my-app-instance-01
labels:
description: MYApp
model: my-app
spec:
deviceModelRef:
name: my-app
nodeSelector:
nodeSelectorTerms:
- matchExpressions:
- key: ''
operator: In
values:
- myedge01 #pls give your edge node name
status:
twins:
- propertyName: prop1
desired:
metadata:
type: string
value: 'value1'
- propertyName: prop2
desired:
metadata:
type: string
value: 'value2'
- propertyName: prop3
desired:
metadata:
type: string
value: 'value3'

The updated document published result in $hw/events.../twin/update/delta:
"delta": {
"prop1": "value3",
"prop2": "value3",
"prop3": "value3"
}

Thank you very much...

discuss about examples maintain issue

Now KubeEdge has many examples, while they are not updated as soon as the new version release, which results in some examples fail to run and new users are confused about those failures.

Due to some examples are complicated and need more expertise, could kubeedge/examples only store repo links of those examples? On one hand, the example owner has more expertise to maintain it, on the other hand, it would be good for KubeEdge maintainers to reduce the maintenance burden and get more time to focus on new wonderful features.

In this way, users can always get available examples and quickly know how to play with KubeEdge.

It is my idea, maybe not imperfect, WDYT?

@kubeedge/maintainers

Also, ping related examples writers @kadisi @edisonxiang @maurya-anuj @sujithsimon22 @m1093782566 @trilokgm @SupriyaSupu, if miss someone, please ping me and I will update ASAP :)

bluetooth-CC2650 containercannotrun

follow https://github.com/kubeedge/examples/tree/master/bluetooth-CC2650-demo

$ kubectl get pod -owide

NAME                                                  READY   STATUS               RESTARTS   AGE   IP               NODE          NOMINATED NODE   READINESS GATES
bluetooth-device-mapper-deployment-6f474d976d-s6w2z   0/1     ContainerCannotRun   0          36m   192.168.10.181   raspi-node2   <none>           <none>

$ kubectl describe pod

Name:         bluetooth-device-mapper-deployment-6f474d976d-s6w2z
Namespace:    default
Priority:     0
Node:         raspi-node2/192.168.10.181
Start Time:   Tue, 17 Nov 2020 19:06:11 +0900
Labels:       app=bluetooth-mapper
              pod-template-hash=6f474d976d
Annotations:  <none>
Status:       Running
IP:           192.168.10.181
IPs:
  IP:           192.168.10.181
Controlled By:  ReplicaSet/bluetooth-device-mapper-deployment-6f474d976d
Containers:
  bluetooth-mapper-container:
    Container ID:   docker://93da607165a851e5de631721c5daeea4f2ee857997b18df48e40e42db37e8448
    Image:          t*****/bluetooth_mapper:v1.0
    Image ID:       docker-pullable://tkzkno0323/bluetooth_mapper@sha256:0fd8fd5b0ae24d613babe2643a416b47180f1c4c52de901322dcb64ccfb407b7
    Port:           <none>
    Host Port:      <none>
    State:          Terminated
      Reason:       ContainerCannotRun
      Message:      OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"/kubeedge/main\": stat /kubeedge/main: no such file or directory": unknown
      Exit Code:    127
      Started:      Tue, 17 Nov 2020 19:06:12 +0900
      Finished:     Tue, 17 Nov 2020 19:06:12 +0900
    Last State:     Terminated
      Reason:       ContainerCannotRun
      Message:      OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"/kubeedge/main\": stat /kubeedge/main: no such file or directory": unknown
      Exit Code:    127
      Started:      Tue, 17 Nov 2020 19:06:12 +0900
      Finished:     Tue, 17 Nov 2020 19:06:12 +0900
    Ready:          False
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /opt/kubeedge/ from config-volume (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-jbtrj (ro)
Conditions:
  Type           Status
  Initialized    True 
  Ready          False 
  PodScheduled   True 
Volumes:
  config-volume:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      device-profile-config-raspi-node2
    Optional:  false
  default-token-jbtrj:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-jbtrj
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  bluetooth=true
Tolerations:     node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                 node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type    Reason     Age   From               Message
  ----    ------     ----  ----               -------
  Normal  Scheduled  38m   default-scheduler  Successfully assigned default/bluetooth-device-mapper-deployment-6f474d976d-s6w2z to raspi-node2

cloudcore : intel NUC ( ubuntu )
edgecore : raspberry pi 4 ( armv7l )

please help me ...

kubeedge-pi-counter: Update twin rejected due to the device counter is not existed

Kubeedge-pi-counter failed to update devicetwin:

[root@192 ~]# kubectl get device counter
NAME AGE
counter 23m

start kubeedge-pi-counter, it seems the update can not reach the devicetwin, the following are logs in edge:

Aug 11 23:44:36 192.168.122.208 edgecore[21332]: I0811 23:44:36.095300   21332 process.go:291] DeviceTwin receive msg
Aug 11 23:44:36 192.168.122.208 edgecore[21332]: I0811 23:44:36.095322   21332 process.go:204] classify the msg with the topic $hw/events/device/counter/twin/update
Aug 11 23:44:36 192.168.122.208 edgecore[21332]: I0811 23:44:36.095341   21332 process.go:220] $hw/events/device/ /twin/update
Aug 11 23:44:36 192.168.122.208 edgecore[21332]: I0811 23:44:36.095358   21332 process.go:230] Classify the msg to action TwinUpdate
Aug 11 23:44:36 192.168.122.208 edgecore[21332]: I0811 23:44:36.095366   21332 process.go:67] Send msg to the TwinModule module in twin
Aug 11 23:44:36 192.168.122.208 edgecore[21332]: I0811 23:44:36.095389   21332 twin.go:133] Twin Update EVENT
Aug 11 23:44:36 192.168.122.208 edgecore[21332]: E0811 23:44:36.095400   21332 dtcontext.go:82] GetMutex device counter not exist
Aug 11 23:44:36 192.168.122.208 edgecore[21332]: I0811 23:44:36.101554   21332 twin.go:159] Begin to update twin of the device counter
Aug 11 23:44:36 192.168.122.208 edgecore[21332]: I0811 23:44:36.101581   21332 twin.go:166] Begin to deal device twin of the device counter
Aug 11 23:44:36 192.168.122.208 edgecore[21332]: E0811 23:44:36.101594   21332 twin.go:171] Update twin rejected due to the device counter is not existed

validation failure list: spec.properties.type.int.accessMode in body should be one of [ReadOnly ReadWrite]

# kubectl apply -f bluetooth-CC2650-demo/sample-crds/CC2650-device-model.yaml 
The DeviceModel "cc2650-sensortag" is invalid: []: Invalid value: map[string]interface {}{"apiVersion":"devices.kubeedge.io/v1alpha1", "kind":"DeviceModel", "metadata":map[string]interface {}{"annotations":map[string]interface {}{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"devices.kubeedge.io/v1alpha1\",\"kind\":\"DeviceModel\",\"metadata\":{\"annotations\":{},\"name\":\"cc2650-sensortag\",\"namespace\":\"default\"},\"spec\":{\"properties\":[{\"description\":\"temperature in degree celsius\",\"name\":\"temperature\",\"type\":{\"int\":{\"accessMode\":\"Read\",\"maximum\":100,\"unit\":\"degree celsius\"}}},{\"description\":\"enable data collection of temperature sensor\",\"name\":\"temperature-enable\",\"type\":{\"string\":{\"accessMode\":\"ReadWrite\",\"defaultValue\":\"ON\"}}},{\"description\":\"initialize io-config with value 0\",\"name\":\"io-config-initialize\",\"type\":{\"int\":{\"accessMode\":\"ReadWrite\",\"defaultValue\":0}}},{\"description\":\"initialize io-data with value 0\",\"name\":\"io-data-initialize\",\"type\":{\"int\":{\"accessMode\":\"ReadWrite\",\"defaultValue\":0}}},{\"description\":\"register activation of io-config\",\"name\":\"io-config\",\"type\":{\"int\":{\"accessMode\":\"ReadWrite\",\"defaultValue\":1}}},{\"description\":\"data field to control io-control\",\"name\":\"io-data\",\"type\":{\"int\":{\"accessMode\":\"ReadWrite\",\"defaultValue\":0}}}],\"propertyVisitors\":[{\"bluetooth\":{\"characteristicUUID\":\"f000aa0104514000b000000000000000\",\"dataConverter\":{\"endIndex\":0,\"orderOfOperations\":[{\"operationType\":\"Multiply\",\"operationValue\":0.03125}],\"shiftRight\":2,\"startIndex\":1}},\"propertyName\":\"temperature\"},{\"bluetooth\":{\"characteristicUUID\":\"f000aa0204514000b000000000000000\",\"dataWrite\":{\"OFF\":[0],\"ON\":[1]}},\"propertyName\":\"temperature-enable\"},{\"bluetooth\":{\"characteristicUUID\":\"f000aa6604514000b000000000000000\"},\"propertyName\":\"io-config-initialize\"},{\"bluetooth\":{\"characteristicUUID\":\"f000aa6504514000b000000000000000\"},\"propertyName\":\"io-data-initialize\"},{\"bluetooth\":{\"characteristicUUID\":\"f000aa6604514000b000000000000000\"},\"propertyName\":\"io-config\"},{\"bluetooth\":{\"characteristicUUID\":\"f000aa6504514000b000000000000000\",\"dataWrite\":{\"Buzzer\":[4],\"BuzzerGreen\":[6],\"BuzzerRed\":[5],\"BuzzerRedGreen\":[7],\"Green\":[2],\"Red\":[1],\"RedGreen\":[3]}},\"propertyName\":\"io-data\"}]}}\n"}, "creationTimestamp":"2020-08-12T06:57:51Z", "generation":2, "name":"cc2650-sensortag", "namespace":"default", "resourceVersion":"4035873", "uid":"23b5a33b-dc69-11ea-8b40-fa163e94a3da"}, "spec":map[string]interface {}{"properties":[]interface {}{map[string]interface {}{"description":"temperature in degree celsius", "name":"temperature", "type":map[string]interface {}{"int":map[string]interface {}{"accessMode":"Read", "maximum":100, "unit":"degree celsius"}}}, map[string]interface {}{"description":"enable data collection of temperature sensor", "name":"temperature-enable", "type":map[string]interface {}{"string":map[string]interface {}{"accessMode":"ReadWrite", "defaultValue":"ON"}}}, map[string]interface {}{"description":"initialize io-config with value 0", "name":"io-config-initialize", "type":map[string]interface {}{"int":map[string]interface {}{"accessMode":"ReadWrite", "defaultValue":0}}}, map[string]interface {}{"description":"initialize io-data with value 0", "name":"io-data-initialize", "type":map[string]interface {}{"int":map[string]interface {}{"accessMode":"ReadWrite", "defaultValue":0}}}, map[string]interface {}{"description":"register activation of io-config", "name":"io-config", "type":map[string]interface {}{"int":map[string]interface {}{"accessMode":"ReadWrite", "defaultValue":1}}}, map[string]interface {}{"description":"data field to control io-control", "name":"io-data", "type":map[string]interface {}{"int":map[string]interface {}{"accessMode":"ReadWrite", "defaultValue":0}}}}, "propertyVisitors":[]interface {}{map[string]interface {}{"bluetooth":map[string]interface {}{"characteristicUUID":"f000aa0104514000b000000000000000", "dataConverter":map[string]interface {}{"endIndex":0, "orderOfOperations":[]interface {}{map[string]interface {}{"operationType":"Multiply", "operationValue":0.03125}}, "shiftRight":2, "startIndex":1}}, "propertyName":"temperature"}, map[string]interface {}{"bluetooth":map[string]interface {}{"characteristicUUID":"f000aa0204514000b000000000000000", "dataWrite":map[string]interface {}{"OFF":[]interface {}{0}, "ON":[]interface {}{1}}}, "propertyName":"temperature-enable"}, map[string]interface {}{"bluetooth":map[string]interface {}{"characteristicUUID":"f000aa6604514000b000000000000000"}, "propertyName":"io-config-initialize"}, map[string]interface {}{"bluetooth":map[string]interface {}{"characteristicUUID":"f000aa6504514000b000000000000000"}, "propertyName":"io-data-initialize"}, map[string]interface {}{"bluetooth":map[string]interface {}{"characteristicUUID":"f000aa6604514000b000000000000000"}, "propertyName":"io-config"}, map[string]interface {}{"bluetooth":map[string]interface {}{"characteristicUUID":"f000aa6504514000b000000000000000", "dataWrite":map[string]interface {}{"Buzzer":[]interface {}{4}, "BuzzerGreen":[]interface {}{6}, "BuzzerRed":[]interface {}{5}, "BuzzerRedGreen":[]interface {}{7}, "Green":[]interface {}{2}, "Red":[]interface {}{1}, "RedGreen":[]interface {}{3}}}, "propertyName":"io-data"}}}}: validation failure list:
spec.properties.type.int.accessMode in body should be one of [ReadOnly ReadWrite]

KubeEdge Counter Demo is not working properly

What happened:
KubeEdge Counter Demo is not working properly
What you expected to happen:
use [kubectl get pods -o wide] can get ke-edge1's IP and use [docker logs -f counter-container-id] can get count value.

Environment:

  • KubeEdge version(e.g. cloudcore/edgecore --version): v1.4.0
    CloudSide Environment:
  • Hardware configuration (e.g. lscpu):Intel(R) Xeon(R) Gold 6126 CPU @ 2.60GHz
  • OS (e.g. cat /etc/os-release):centos8
  • Kernel (e.g. uname -a):Linux ke-cloud 4.18.0-193.el8.x86_64 #1 SMP Fri May 8 10:59:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • Go version (e.g. go version): go version go1.14.4 linux/amd64
  • Others:

EdgeSide Environment:

  • edgecore version (e.g. edgecore --version):v1.4.0
  • Hardware configuration (e.g. lscpu):Intel(R) Xeon(R) Gold 6126 CPU @ 2.60GHz
  • OS (e.g. cat /etc/os-release):centos8
  • Kernel (e.g. uname -a):Linux ke-edge1 4.18.0-193.el8.x86_64 #1 SMP Fri May 8 10:59:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • Go version (e.g. go version): go version go1.14.4 linux/amd64
  • Others:

p1
p2
p3
p4
p5

couldn't find suitable file to run about security-demo

Hi, I have tried to run this example .But what do you mean by
image
since I could find nothing to run under /app-binaries/cloud/ folder
image.
could anyone help me to explain clearly how to test device application?thanks a lot.

Can't read temperature-status messages on kubeedge-temperature-demo

I have tweaked the demo to produce random numbers without actually needed a temperature sensor. I compiled and deployed it and it seems to be working.

I hooked mosquitto_sub to the '$hw/#' topic and what I get is the following:
$hw/events/device/temperature/twin/update {"event_id":"","timestamp":0,"twin":{"temperature-status":{"actual":{"value":"23C"},"metadata":{"type":"Updated"}}}}
$hw/events/device/temperature/twin/update/result {"event_id":"","timestamp":1584054162594,"code":400,"reason":"the value type is not allowed"}

I don't know what is going on or why the value is not allowed.

If i try to get the temperature with kubectl get device temperature -ojson -w, what I get is:

{
"apiVersion": "devices.kubeedge.io/v1alpha1",
"kind": "Device",
"metadata": {
"annotations": {
"kubectl.kubernetes.io/last-applied-configuration": "{"apiVersion":"devices.kubeedge.io/v1alpha1","kind":"Device","metadata":{"annotations":{},"labels":{"description":"temperature","manufacturer":"test"},"name":"temperature","namespace":"default"},"spec":{"deviceModelRef":{"name":"temperature-model"},"nodeSelector":{"nodeSelectorTerms":[{"matchExpressions":[{"key":"","operator":"In","values":["kube-edge.cassiopeia.local"]}]}]}},"status":{"twins":[{"desired":{"metadata":{"type":"string"},"value":""},"propertyName":"temperature-status"}]}}\n"
},
"creationTimestamp": "2020-03-07T21:51:24Z",
"generation": 61,
"labels": {
"description": "temperature",
"manufacturer": "test"
},
"name": "temperature",
"namespace": "default",
"resourceVersion": "3693803",
"selfLink": "/apis/devices.kubeedge.io/v1alpha1/namespaces/default/devices/temperature",
"uid": "aa9fd4b2-5a78-48ca-8e47-f8d11b131cbd"
},
"spec": {
"deviceModelRef": {
"name": "temperature-model"
},
"nodeSelector": {
"nodeSelectorTerms": [
{
"matchExpressions": [
{
"key": "",
"operator": "In",
"values": [
"kube-edge.cassiopeia.local"
]
}
]
}
]
}
},
"status": {
"twins": [
{
"desired": {
"metadata": {
"type": "string"
},
"value": ""
},
"propertyName": "temperature-status"
}
]
}
}
Could anyone help me trying to figure out how to make it work?

Thanks!

Question about the Raspberry pi example

I have followed the guide and now i have the deployments running but the pod keeps crashing. When i check the actual container the logs says:

I0613 14:02:34.782924 1 light_mapper.go:168] Changing the state of the device to online
I0613 14:02:34.784542 1 light_mapper.go:242] Watching on the device twin values for device: led-light-instance-01
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x66e450]

goroutine 1 [running]:
main.equateTwinValue(0x0, 0x0, 0x0, 0x400007d2f0)
/var/opt/godir/src/github.com/kubeedge/examples/led-raspberrypi/light_mapper.go:248 +0x198
main.main()
/var/opt/godir/src/github.com/kubeedge/examples/led-raspberrypi/light_mapper.go:280 +0x16c

kubeedge-counter-demo cannot run on kubeedge-1.4.0

it has no error on log,bug when i click on ,my edge side can not accept any message, it can not trigger code. is a question ,maybe a bug

token := cli.Subscribe(topic+"/document", 0, func(client mqtt.Client, msg mqtt.Message) {
fmt.Println("enter get msg",msg)
Update := &types.DeviceTwinDocument{}
err := json.Unmarshal(msg.Payload(), Update)
if err != nil {
fmt.Printf("Unmarshal error: %v\n", err)
}

	cmd := *Update.Twin["status"].CurrentState.Expected.Value

	if cmd == "ON" && cmd != current_status {
		ctr.TurnOn()
		fmt.Printf("turn on counter.\n")
	}

	if cmd == "OFF" && cmd != current_status {
		ctr.TurnOff()
		fmt.Printf("turn off counter.\n")
	}

	current_status = cmd
})

Upgrade all examples to go module

I am new to kubeedge and I see many examples are governed by dep. Dep is already deprecated and go module does well. Need some help?

demo: running analytics at edge with Apache Beam

We can demonstrate how can we perform analytics at the edge using a popular analytics framework , Apache Beam. Currently this analytics engine is not integrated with kube-edge. However , the analytics application used for the demo is deployed to the edge node via Huawei IEF cloud service. In this way , we have shown some level of integration . The idea is to build further on this and come up with some kind of analytics framework which can be a part of the edge platform.

package not available

I am trying to build the image for the web part of the counter example. But my go environment can't find the "github.com/kubeedge/kubeedge/cloud/pkg/devicecontroller/apis/devices/v1alpha1" package which is imported to one of the codes. can any body help me solve this problem?

Thanks in advance.

kubeedge-counter-demo Click counter is error

docker logs -f 708687d34153(kubeedge-counter-app Container id)
The error is as follows:
2021/01/08 02:14:43 ControlTrack: ON
2021/01/08 02:14:43 Failed to patch device status &{{[{status {ON map[timestamp:1610 type:string]} {0 map[timestamp:1610 type:string]}}]}} of device counter in namespace default
error:the server could not find the requested resource (patch devices.devices.kubeedge.io counter)

environment:
kubectl get node
NAME STATUS ROLES AGE VERSION
k8s-master Ready master 3h21m v1.19.2
k8s-node-1 Ready agent,edge 3h4m v1.19.3-kubeedge-v1.5.0

kubectl get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
kubeedge-counter-app-b685d8f99-x7z69 1/1 Running 2 3h3m 172.16.72.143 k8s-master
kubeedge-pi-counter-68c86dc747-9xlks 1/1 Running 3 3h2m 172.16.72.142 k8s-node-1

kubectl get pods -n kube-system
NAME READY STATUS RESTARTS AGE
coredns-6d56c8448f-844s9 1/1 Running 2 3h22m
coredns-6d56c8448f-hwcnb 1/1 Running 2 3h22m
etcd-k8s-master 1/1 Running 3 3h22m
kube-apiserver-k8s-master 1/1 Running 0 25m
kube-controller-manager-k8s-master 1/1 Running 5 3h22m
kube-proxy-lx2ww 1/1 Running 2 3h22m
kube-proxy-vmxwm 1/1 Running 3 3h5m
kube-scheduler-k8s-master 1/1 Running 4 3h22m

Use of Opensource Cloud for apache bean demo.

Currently apache beam demo uses IEF for application deployment as when the demo was uploaded cloud was not available for kubeedge. Since cloud is available from v0.2 of kubeedge, dependency of IEF for deploying applications no longer exists.

Apache Beam demo needs to be changed to use opensource cloud.

Build a sample application to run OpenCV on KubeEdge platform

OpenCV (Open source computer vision) is a library of programming functions mainly aimed at real-time computer vision. OpenCV runs on the mobile OS too.

To demonstrate KubeEdge platform, we need to build a sample application to run OpenCV on KubeEdge platform, ideally running inference on the edge and training on the cloud, showing cloud-edge collaboration.

Was `apachebeam` intended to use different mqtt topic?

At publisher side, message published with topic "test"

Meanwhile, at the subscriber side, it consumed message with topic "alert"

Program runs, but without any output, and occasionally publisher panics at

err = cli.Publish(&client.PublishOptions{
QoS: mqtt.QoS0,
TopicName: []byte("test"),
Message: bytes,
})
if err != nil {
panic(err)
}
}

The error is
https://github.com/yosssi/gmq/blob/b221999646da8ea48ff0796c2b0191aa510d062e/mqtt/client/client.go#L232-L242

Security Demo relies unnecessarilly on spiffe-helper

The Identity Management Using SPIRE for Kubeedge demo places the spiffe-helper between Ghostunnel and SPIRE agent in order to allow Ghostunnel to consume resources off of the SPIFFE Workload API. While this was necessary in the past, Ghostunnel has had first-class support for the SPIFFE Workload API since the middle of 2019.

The architecture of the demo can be simplified greatly by removing the spiffe-helper and configuring Ghostunnel to use the SPIFFE Workload API directly.

https://github.com/ghostunnel/ghostunnel/blob/master/docs/SPIFFE-WORKLOAD-API.md

Run RPI Temperature demo error, can not create the device model

Hello,
I am trying the RPI temperature demo.
When applying the device model (devicemodel.yaml), I got some errors.
Please need some supports on this error.
Thanks

error: unable to recognize "devicemodel.yaml": no matches for kind "DeviceModel" in version "devices.kubeedge.io/v1alpha2"

I am using the kubeedge 1.4.0, kubernetes v1.17.8

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.