当前位置:网站首页>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.
边栏推荐
- document.write()的用法-写入文本——修改样式、位置控制
- 基于STM32单片机设计的红外测温仪(带人脸检测)
- 【微信小程序】運行機制和更新機制
- Huawei device command
- Web开发小妙招:巧用ThreadLocal规避层层传值
- js 根据汉字首字母排序(省份排序) 或 根据英文首字母排序——za排序 & az排序
- 【mysql】游标的基本使用
- 967- letter combination of telephone number
- Statistical inference: maximum likelihood estimation, Bayesian estimation and variance deviation decomposition
- OSPF多区域配置
猜你喜欢

【微信小程序】运行机制和更新机制

ICML 2022 | Flowformer: 任务通用的线性复杂度Transformer

Detailed explanation of knowledge map construction process steps

监控界的最强王者,没有之一!

Laravel笔记-自定义登录中新增登录5次失败锁账户功能(提高系统安全性)

What is the problem with the SQL group by statement

3D face reconstruction: from basic knowledge to recognition / reconstruction methods!

Variable star --- article module (1)

全网最全的知识库管理工具综合评测和推荐:FlowUs、Baklib、简道云、ONES Wiki 、PingCode、Seed、MeBox、亿方云、智米云、搜阅云、天翎

Common English vocabulary that every programmer must master (recommended Collection)
随机推荐
Data Lake (VIII): Iceberg data storage format
全网最全的知识库管理工具综合评测和推荐:FlowUs、Baklib、简道云、ONES Wiki 、PingCode、Seed、MeBox、亿方云、智米云、搜阅云、天翎
el-table表格——sortable排序 & 出现小数、%时排序错乱
正则表达式收集
Interviewer: what is the internal implementation of ordered collection in redis?
Redis insert data garbled solution
Simple continuous viewing PTA
R语言可视化两个以上的分类(类别)变量之间的关系、使用vcd包中的Mosaic函数创建马赛克图( Mosaic plots)、分别可视化两个、三个、四个分类变量的关系的马赛克图
Aiko ai Frontier promotion (7.6)
【OpenCV 例程200篇】220.对图像进行马赛克处理
Application layer of tcp/ip protocol cluster
Reviewer dis's whole research direction is not just reviewing my manuscript. What should I do?
How to implement common frameworks
1500萬員工輕松管理,雲原生數據庫GaussDB讓HR辦公更高效
Pinduoduo lost the lawsuit, and the case of bargain price difference of 0.9% was sentenced; Wechat internal test, the same mobile phone number can register two account functions; 2022 fields Awards an
Mécanisme de fonctionnement et de mise à jour de [Widget Wechat]
The biggest pain point of traffic management - the resource utilization rate cannot go up
Dynamically switch data sources
KDD 2022 | realize unified conversational recommendation through knowledge enhanced prompt learning
【mysql】触发器