当前位置:网站首页>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.
边栏推荐
- 20220211 failure - maximum amount of data supported by mongodb
- Chris LATTNER, the father of llvm: why should we rebuild AI infrastructure software
- Tips for web development: skillfully use ThreadLocal to avoid layer by layer value transmission
- KDD 2022 | realize unified conversational recommendation through knowledge enhanced prompt learning
- Reinforcement learning - learning notes 5 | alphago
- el-table表格——获取单击的是第几行和第几列 & 表格排序之el-table与sort-change、el-table-column与sort-method & 清除排序-clearSort
- HMS core machine learning service creates a new "sound" state of simultaneous interpreting translation, and AI makes international exchanges smoother
- Mécanisme de fonctionnement et de mise à jour de [Widget Wechat]
- Spark SQL chasing Wife Series (initial understanding)
- Minimum cut edge set of undirected graph
猜你喜欢

Statistical inference: maximum likelihood estimation, Bayesian estimation and variance deviation decomposition

每个程序员必须掌握的常用英语词汇(建议收藏)

【mysql】游标的基本使用

Laravel notes - add the function of locking accounts after 5 login failures in user-defined login (improve system security)

use. Net analysis Net talent challenge participation

Entity alignment two of knowledge map

use. Net drives the OLED display of Jetson nano

全网最全的新型数据库、多维表格平台盘点 Notion、FlowUs、Airtable、SeaTable、维格表 Vika、飞书多维表格、黑帕云、织信 Informat、语雀

【Redis设计与实现】第一部分 :Redis数据结构和对象 总结

愛可可AI前沿推介(7.6)
随机推荐
Tips for web development: skillfully use ThreadLocal to avoid layer by layer value transmission
数据湖(八):Iceberg数据存储格式
【滑动窗口】第九届蓝桥杯省赛B组:日志统计
Mtcnn face detection
Reference frame generation based on deep learning
js 根据汉字首字母排序(省份排序) 或 根据英文首字母排序——za排序 & az排序
Study notes of grain Mall - phase I: Project Introduction
拼多多败诉,砍价始终差0.9%一案宣判;微信内测同一手机号可注册两个账号功能;2022年度菲尔兹奖公布|极客头条
HMS Core 机器学习服务打造同传翻译新“声”态,AI让国际交流更顺畅
The biggest pain point of traffic management - the resource utilization rate cannot go up
js之遍历数组、字符串
document.write()的用法-写入文本——修改样式、位置控制
1_ Introduction to go language
What is the problem with the SQL group by statement
Performance test process and plan
Swagger UI教程 API 文档神器
硬件开发笔记(十): 硬件开发基本流程,制作一个USB转RS232的模块(九):创建CH340G/MAX232封装库sop-16并关联原理图元器件
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
PG基础篇--逻辑结构管理(事务)
字符串的使用方法之startwith()-以XX开头、endsWith()-以XX结尾、trim()-删除两端空格