当前位置:网站首页>Yyds dry inventory run kubeedge official example_ Counter demo counter
Yyds dry inventory run kubeedge official example_ Counter demo counter
2022-07-06 21:07:00 【Feng, crazy】
KubeEdge Counter Demo The counter is a pseudo device , Users do not need any additional physical devices to run this demo . The counter runs on the edge side , Users can from the cloud side in Web Control it in the process , Or from the cloud side Web Get counter value from , Schematic diagram is as follows :
Install first. kubeedge
Linux install kubeedge_ Successful test
kubeedge Edge node installation
# stay k8s-master On the implementation , Look at the node
[[email protected] crds]# kubectl get node
NAME STATUS ROLES AGE VERSION
k8s-master Ready master 3d23h v1.19.3
k8s-node01 Ready <none> 3d23h v1.19.3
k8s-node02 Ready <none> 3d22h v1.19.3
ke-edge1 Ready agent,edge 3d21h v1.19.3-kubeedge-v1.8.0
ke-edge2 Ready agent,edge 3d21h v1.19.3-kubeedge-v1.8.0
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
Make sure kubernetes apiserver The following configurations are enabled :
--insecuret-port=8080
--insecure-bind-address=0.0.0.0
- 1.
- 2.
Cloud operations stay k8s-master On the implementation
# Download sample code
git clone https://github.com/kubeedge/examples.git $GOPATH/src/github.com/kubeedge/examples
# Use the official example warehouse github It will be slow , Here you can use my acceleration warehouse
git clone https://gitee.com/iot-kubeedge/kubeedge-examples.git $GOPATH/src/github.com/kubeedge/examples
# establish device model
cd $GOPATH/src/github.com/kubeedge/examples/kubeedge-counter-demo/crds
# establish model
kubectl create -f kubeedge-counter-model.yaml
# establish device
cd $GOPATH/src/github.com/kubeedge/examples/kubeedge-counter-demo/crds
# Modify... According to your actual situation matchExpressions:
vim kubeedge-counter-instance.yaml
# Major changes
- key: 'kubernetes.io/hostname'
values:
- k8s-node-1 # Here is the node name
# function yaml
kubectl create -f kubeedge-counter-instance.yaml
kubectl create -f kubeedge-web-controller-app.yaml
# Deploy cloud applications
# Cloud Applications web-controller-app Used to control the end of the edge pi-counter-app application , The default listening port number of this program is 80, Change here to 8089
cd $GOPATH/src/github.com/kubeedge/examples/kubeedge-counter-demo/web-controller-app
vim main.go
beego.Run(":8089")
# Build a mirror image
make all
make docker
# Deploy web-controller-app
cd $GOPATH/src/github.com/kubeedge/examples/kubeedge-counter-demo/crds
kubectl apply -f kubeedge-web-controller-app.yaml
# Deploy edge applications
# On the edge pi-counter-app Applications are controlled by cloud applications , Mainly with mqtt Server communication , Simple counting function .
# Modify the code and build the image
# Need to put Makefile Medium GOARCH It is amended as follows amd64 To run the container . The default is arm Architecturally
cd $GOPATH/src/github.com/kubeedge/examples/kubeedge-counter-demo/counter-mapper
vim Makefile
GOARCH=amd64 go build -o pi-counter-app main.go
# Build a mirror image
make all
make docker
# Deploy Pi Counter App
cd $GOPATH/src/github.com/kubeedge/examples/kubeedge-counter-demo/crds
kubectl apply -f kubeedge-pi-counter-app.yaml
# explain : In order to prevent Pod Your deployment card is in `ContainerCreating`, This is directly through docker save、scp and docker load The command publishes the image to the edge
# Because there is no such image on the edge , You can only get it by hand , Or upload it to the private image warehouse first , Configure private warehouse address at the edge , You can download directly from the private warehouse
# Here, get the edge end manually
docker save -o kubeedge-pi-counter.tar kubeedge/kubeedge-pi-counter:v1.0.0
# To the edge
scp kubeedge-pi-counter.tar [email protected]:/data/
# Execute at the edge
docker load -i kubeedge-pi-counter.tar
# Check the container startup log at the edge , Did you report a mistake
docker logs -f counter-container-id
turn off counter.
turn on counter.
Counter value: 1
Counter value: 2
Counter value: 3
Counter value: 4
Counter value: 5
Counter value: 6
Counter value: 7
Counter value: 8
Counter value: 9
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
- 29.
- 30.
- 31.
- 32.
- 33.
- 34.
- 35.
- 36.
- 37.
- 38.
- 39.
- 40.
- 41.
- 42.
- 43.
- 44.
- 45.
- 46.
- 47.
- 48.
- 49.
- 50.
- 51.
- 52.
- 53.
- 54.
- 55.
- 56.
- 57.
- 58.
- 59.
- 60.
- 61.
- 62.
- 63.
- 64.
- 65.
- 66.
- 67.
- 68.
- 69.
- 70.
- 71.
- 72.
- 73.
- 74.
- 75.
- 76.
- 77.
- 78.
- 79.
边栏推荐
- 968 edit distance
- C language games - minesweeping
- Opencv learning example code 3.2.3 image binarization
- 967- letter combination of telephone number
- Chris LATTNER, the father of llvm: why should we rebuild AI infrastructure software
- Intel 48 core new Xeon run point exposure: unexpected results against AMD zen3 in 3D cache
- Le langage r visualise les relations entre plus de deux variables de classification (catégories), crée des plots Mosaiques en utilisant la fonction Mosaic dans le paquet VCD, et visualise les relation
- 【论文解读】用于白内障分级/分类的机器学习技术
- Word bag model and TF-IDF
- 基于深度学习的参考帧生成
猜你喜欢
What is the problem with the SQL group by statement
Mécanisme de fonctionnement et de mise à jour de [Widget Wechat]
Hardware development notes (10): basic process of hardware development, making a USB to RS232 module (9): create ch340g/max232 package library sop-16 and associate principle primitive devices
Chris LATTNER, the father of llvm: why should we rebuild AI infrastructure software
use. Net drives the OLED display of Jetson nano
What key progress has been made in deep learning in 2021?
Study notes of grain Mall - phase I: Project Introduction
3D face reconstruction: from basic knowledge to recognition / reconstruction methods!
Laravel notes - add the function of locking accounts after 5 login failures in user-defined login (improve system security)
Common English vocabulary that every programmer must master (recommended Collection)
随机推荐
7、数据权限注解
强化学习-学习笔记5 | AlphaGo
2022 fields Award Announced! The first Korean Xu Long'er was on the list, and four post-80s women won the prize. Ukrainian female mathematicians became the only two women to win the prize in history
【微信小程序】運行機制和更新機制
3D face reconstruction: from basic knowledge to recognition / reconstruction methods!
【滑动窗口】第九届蓝桥杯省赛B组:日志统计
审稿人dis整个研究方向已经不仅仅是在审我的稿子了怎么办?
Activiti global process monitors activitieventlistener to monitor different types of events, which is very convenient without configuring task monitoring in acitivit
1_ Introduction to go language
KDD 2022 | realize unified conversational recommendation through knowledge enhanced prompt learning
SAP UI5 框架的 manifest.json
硬件开发笔记(十): 硬件开发基本流程,制作一个USB转RS232的模块(九):创建CH340G/MAX232封装库sop-16并关联原理图元器件
The biggest pain point of traffic management - the resource utilization rate cannot go up
What key progress has been made in deep learning in 2021?
Is this the feeling of being spoiled by bytes?
Reinforcement learning - learning notes 5 | alphago
ICML 2022 | Flowformer: 任务通用的线性复杂度Transformer
愛可可AI前沿推介(7.6)
PHP online examination system version 4.0 source code computer + mobile terminal
PG basics -- Logical Structure Management (transaction)