当前位置:网站首页>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.
边栏推荐
- Xcode6 error: "no matching provisioning profiles found for application"
- Spiral square PTA
- The most comprehensive new database in the whole network, multidimensional table platform inventory note, flowus, airtable, seatable, Vig table Vika, flying Book Multidimensional table, heipayun, Zhix
- 2022菲尔兹奖揭晓!首位韩裔许埈珥上榜,四位80后得奖,乌克兰女数学家成史上唯二获奖女性
- SAP UI5 框架的 manifest.json
- 嵌入式开发的7大原罪
- 基于深度学习的参考帧生成
- 防火墙基础之外网服务器区部署和双机热备
- PG basics -- Logical Structure Management (transaction)
- Interviewer: what is the internal implementation of ordered collection in redis?
猜你喜欢
Swagger UI tutorial API document artifact
Spark SQL chasing Wife Series (initial understanding)
Redis insert data garbled solution
[200 opencv routines] 220 Mosaic the image
基于STM32单片机设计的红外测温仪(带人脸检测)
SAP UI5 框架的 manifest.json
[MySQL] trigger
Deployment of external server area and dual machine hot standby of firewall Foundation
No Yum source to install SPuG monitoring
KDD 2022 | 通过知识增强的提示学习实现统一的对话式推荐
随机推荐
审稿人dis整个研究方向已经不仅仅是在审我的稿子了怎么办?
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
How to implement common frameworks
Swagger UI tutorial API document artifact
js中,字符串和数组互转(一)——字符串转为数组的方法
Database - how to get familiar with hundreds of tables of the project -navicat these unique skills, have you got it? (exclusive experience)
【Redis设计与实现】第一部分 :Redis数据结构和对象 总结
什么是RDB和AOF
Notes - detailed steps of training, testing and verification of yolo-v4-tiny source code
Introduction to the use of SAP Fiori application index tool and SAP Fiori tools
正则表达式收集
快过年了,心也懒了
#yyds干货盘点#重新梳理箭头函数的this
What key progress has been made in deep learning in 2021?
Chris LATTNER, the father of llvm: why should we rebuild AI infrastructure software
Laravel notes - add the function of locking accounts after 5 login failures in user-defined login (improve system security)
【mysql】游标的基本使用
After working for 5 years, this experience is left when you reach P7. You have helped your friends get 10 offers
[MySQL] basic use of cursor
R language visualizes the relationship between more than two classification (category) variables, uses mosaic function in VCD package to create mosaic plots, and visualizes the relationship between tw