当前位置:网站首页>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.
边栏推荐
- 快过年了,心也懒了
- 硬件开发笔记(十): 硬件开发基本流程,制作一个USB转RS232的模块(九):创建CH340G/MAX232封装库sop-16并关联原理图元器件
- How to turn a multi digit number into a digital list
- Distributed ID
- 过程化sql在定义变量上与c语言中的变量定义有什么区别
- PHP saves session data to MySQL database
- HMS core machine learning service creates a new "sound" state of simultaneous interpreting translation, and AI makes international exchanges smoother
- 什么是RDB和AOF
- Summary of different configurations of PHP Xdebug 3 and xdebug2
- js之遍历数组、字符串
猜你喜欢
Data Lake (VIII): Iceberg data storage format
OneNote in-depth evaluation: using resources, plug-ins, templates
【深度学习】PyTorch 1.12发布,正式支持苹果M1芯片GPU加速,修复众多Bug
New database, multidimensional table platform inventory note, flowus, airtable, seatable, Vig table Vika, Feishu multidimensional table, heipayun, Zhixin information, YuQue
MLP (multilayer perceptron neural network) is a multilayer fully connected neural network model.
KDD 2022 | realize unified conversational recommendation through knowledge enhanced prompt learning
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
Activiti global process monitors activitieventlistener to monitor different types of events, which is very convenient without configuring task monitoring in acitivit
[MySQL] basic use of cursor
Statistical inference: maximum likelihood estimation, Bayesian estimation and variance deviation decomposition
随机推荐
Three schemes of SVM to realize multi classification
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
Web开发小妙招:巧用ThreadLocal规避层层传值
c#使用oracle存储过程获取结果集实例
PG基础篇--逻辑结构管理(事务)
What is the difference between procedural SQL and C language in defining variables
js中,字符串和数组互转(二)——数组转为字符串的方法
如何实现常见框架
[wechat applet] operation mechanism and update mechanism
Entity alignment two of knowledge map
20220211 failure - maximum amount of data supported by mongodb
15 millions d'employés sont faciles à gérer et la base de données native du cloud gaussdb rend le Bureau des RH plus efficace
js之遍历数组、字符串
每个程序员必须掌握的常用英语词汇(建议收藏)
全网最全的知识库管理工具综合评测和推荐:FlowUs、Baklib、简道云、ONES Wiki 、PingCode、Seed、MeBox、亿方云、智米云、搜阅云、天翎
1500萬員工輕松管理,雲原生數據庫GaussDB讓HR辦公更高效
OAI 5G NR+USRP B210安装搭建
Pat 1085 perfect sequence (25 points) perfect sequence
3D人脸重建:从基础知识到识别/重建方法!
1_ Introduction to go language