Kubeedge & Edgemesh & Sedna 配置

2023-05-16

Setting Of Kubeedge & EdgeMesh & Sedna Installation

准备安装环境(主节点和从节点均有)

Edge nod & Cloud node 两节点均需配置cgroups

wget https://raw.githubusercontent.com/ansjin/katacoda-scenarios/main/getting-started-with-kubeedge/assets/daemon.json

mv daemon.json /etc/docker/daemon.json

systemctl daemon-reload

service docker restart 

docker info | grep -i cgroup

kubeadm init --kubernetes-version=1.20.0  --pod-network-cidr=10.244.0.0/16

mkdir -p $HOME/.kube
cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
chown $(id -u):$(id -g) $HOME/.kube/config

kubectl cluster-info
kubectl get nodes

#去除主节点上的污点,以便sedna安装
kubectl taint nodes --all node-role.kubernetes.io/master-

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-7pRIXUw2-1640680683134)(Start With Kubeedge & Sedna Installation.assets/image-20211114100242495.png)]

这里如果coredns没有ready的话就apply flannel:

kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

下载所需版本的keadm,解压到当前文件,复制到local/bin下面

cp keadm-v1.7.2-linux-amd64/keadm/keadm /usr/local/bin/keadm

keadm init --advertise-address=158.39.201.145

检查cloudnode的状态是否running

cat /var/log/kubeedge/cloudcore.log

ln -s /etc/kubeedge/cloudcore.service /etc/systemd/system/cloudcore.service

sudo service cloudcore restart

获取本地tokken

keadm gettoken

Edge节点加入cloud node

keadm join --cloudcore-ipport=158.39.201.145:10000 --token=8f469f894ff8cf79ac451aa32861954b6a3d03adaed980c7d03f8e187dfe8c52.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NDA3MTAxNjV9.TRXiklCsGB-Ph4jtXt0O5YUkEsHMXpbvKPopAhpvaF0
kubectl get node #打印节点状态

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-AzBtoVDg-1640680683136)(Start With Kubeedge & Sedna Installation.assets/image-20211114101558992.png)]

加入成功,各节点ready

Enable KubeEdge Logs in Cloud Side

——————————————————————————————————————————————————————————

(PS 以下步骤不一定要做,初次安装可以跳过)

默认情况下,kubectl 不能访问边缘节点日志,所以需要在这里启动边缘节点访问权限

wget https://raw.githubusercontent.com/kubeedge/kubeedge/master/build/tools/certgen.sh --no-check-certificate

mv certgen.sh /etc/kubeedge/certgen.sh

chmod +x /etc/kubeedge/certgen.sh

设置 cloud core IP 环境变量

export CLOUDCOREIPS=158.39.201.145

#Generate Certificates
bash /etc/kubeedge/certgen.sh stream
iptables -t nat -A OUTPUT -p tcp --dport 10350 -j DNAT --to 158.39.201.145:10003

PS. IPtaleb 配置时侯有可能出现问题

kubectl get cm tunnelport -nkubeedge -oyaml
   
   apiVersion: v1
   kind: ConfigMap
   metadata:
     annotations:
       tunnelportrecord.kubeedge.io: '{"ipTunnelPort":{"192.168.1.16":10350, "192.168.1.17":10351},"port":{"10350":true, "10351":true}}'
     creationTimestamp: "2021-06-01T04:10:20Z"
   ...
If you are not sure if you have setting of iptables, and you want to clean all of them.
(If you set up iptables wrongly, it will block you out of your `kubectl logs` feature)
The following command can be used to clean up iptables:
```shell
iptables -F && iptables -t nat -F && iptables -t mangle -F && iptables -X
```

——————————————————————————————————————————————————————————-

修改Cloudcore.yaml配置

vi /etc/kubeedge/config/cloudcore.yaml

Modify /etc/kubeedge/config/cloudcore.yaml to allow:

{'cloudStream': {'enable': true}}},

(PS. 这里 true以后会导致集群不可用,原因不清楚,可以先不做修改)

{'dynamicController': {'enable': true}}

pkill cloudcore 
nohup cloudcore > cloudcore.log 2>&1 &
cat cloudcore.log

修改Edgecore.yaml

vi /etc/kubeedge/config/edgecore.yaml

Modify /etc/kubeedge/config/edgecore.yaml to allow:

{'edgeStream': {'enable': true}}},

{'edged': {'clusterDNS': '10.96.0.10'}},

{'edged': {'clusterDomain': 'cluster.local'}},

{‘metaManager’: {‘metaServer’: {‘enable’: true}}}

Avoid Kube-proxy(忽略kube-proxy的检查措施)

vi /etc/kubeedge/edgecore.service

Description=edgecore.service

[Service] Type=simple 
ExecStart=/root/cmd/ke/edgecore --logtostderr=false --log-file=/root/cmd/ke/edgecore.log 

Environment="CHECK_EDGECORE_ENVIRONMENT=false" 

[Install] 
WantedBy=multi-user.target

Restart Edgecore

systemctl restart edgecore.service 
systemctl daemon-reload

Restart pods on cloud side which are pending

kubectl -n kube-system delete pods --field-selector=status.phase=Pending

Support Metrics-server in Cloud

Edge_Mesh Deploy

自动安装:

手动工作

(1)开启 Local APIServer

在云端,开启 dynamicController 模块,并重启 cloudcore

$ vim /etc/kubeedge/config/cloudcore.yaml
modules:
  ..
  dynamicController:
    enable: true
..
# 如果 cloudcore 没有配置为 systemd 管理,则使用如下命令重启(cloudcore 默认没有配置为 systemd 管理)
$ pkill cloudcore ; nohup /usr/local/bin/cloudcore > /var/log/kubeedge/cloudcore.log 2>&1 &

# 如果 cloudcore 配置为 systemd 管理,则使用如下命令重启
$ systemctl restart cloudcore
# OR
$ nohup /usr/local/bin/cloudcore > /var/log/kubeedge/cloudcore.log 2>&1 &

(1)在边缘节点,打开 metaServer 模块(如果你的 KubeEdge < 1.8.0,还需关闭 edgeMesh 模块)

$ vim /etc/kubeedge/config/edgecore.yaml
modules:
  ..
  edgeMesh:
    enable: false
  ..
  metaManager:
    metaServer:
      enable: true
..

(2)配置 clusterDNS,clusterDomain

在边缘节点,配置 clusterDNS 和 clusterDomain,并重启 edgecore

$ vim /etc/kubeedge/config/edgecore.yaml
modules:
  ..
  edged:
    # EdgeMesh 的 DNS 模块暂时不支持解析外网域名,如果你希望在 Pod 内部解析外网域名
    # 可以将 clusterDNS 配置成 "169.254.96.16,8.8.8.8"
    clusterDNS: "169.254.96.16"
    clusterDomain: "cluster.local"
..
$ systemctl restart edgecore

提示

clusterDNS 设置的值 ‘169.254.96.16’ 来自于 build/agent/kubernetes/edgemesh-agent/05-configmap.yaml 中的 commonConfig.dummyDeviceIP,如需修改请保持两者一致

(3)验证

在边缘节点,测试 Local APIServer 是否开启

$ curl 127.0.0.1:10550/api/v1/services
{"apiVersion":"v1","items":[{"apiVersion":"v1","kind":"Service","metadata":{"creationTimestamp":"2021-04-14T06:30:05Z","labels":{"component":"apiserver","provider":"kubernetes"},"name":"kubernetes","namespace":"default","resourceVersion":"147","selfLink":"default/services/kubernetes","uid":"55eeebea-08cf-4d1a-8b04-e85f8ae112a9"},"spec":{"clusterIP":"10.96.0.1","ports":[{"name":"https","port":443,"protocol":"TCP","targetPort":6443}],"sessionAffinity":"None","type":"ClusterIP"},"status":{"loadBalancer":{}}},{"apiVersion":"v1","kind":"Service","metadata":{"annotations":{"prometheus.io/port":"9153","prometheus.io/scrape":"true"},"creationTimestamp":"2021-04-14T06:30:07Z","labels":{"k8s-app":"kube-dns","kubernetes.io/cluster-service":"true","kubernetes.io/name":"KubeDNS"},"name":"kube-dns","namespace":"kube-system","resourceVersion":"203","selfLink":"kube-system/services/kube-dns","uid":"c221ac20-cbfa-406b-812a-c44b9d82d6dc"},"spec":{"clusterIP":"10.96.0.10","ports":[{"name":"dns","port":53,"protocol":"UDP","targetPort":53},{"name":"dns-tcp","port":53,"protocol":"TCP","targetPort":53},{"name":"metrics","port":9153,"protocol":"TCP","targetPort":9153}],"selector":{"k8s-app":"kube-dns"},"sessionAffinity":"None","type":"ClusterIP"},"status":{"loadBalancer":{}}}],"kind":"ServiceList","metadata":{"resourceVersion":"377360","selfLink":"/api/v1/services"}}

自动安装edgemesh

helm install edgemesh \
  --set server.nodeName=<your node name> \
  --set server.publicIP=<your node eip> \
https://raw.githubusercontent.com/kubeedge/edgemesh/main/build/helm/edgemesh.tgz

server.nodeName 指定 edgemesh-server 部署的节点,server.publicIP 指定节点的公网 IP。其中 server.publicIP 是可以省略的,因为 edgemesh-server 会自动探测并配置节点的公网 IP,但不保证正确。

测试样例:

https://edgemesh.netlify.app/zh/guide/test-case.html#http

Sedna 安装:

Deploy Sedna¶

Currently GM is deployed as a deployment, and LC is deployed as a daemonset.

Run the one liner:

curl https://raw.githubusercontent.com/kubeedge/sedna/main/scripts/installation/install.sh | SEDNA_ACTION=create bash -

It requires the network to access github since it will download the sedna crd yamls. If you have unstable network to access github or existing sedna source, you can try the way:

# SEDNA_ROOT is the sedna git source directory or cached directory
export SEDNA_ROOT=/opt/sedna
curl https://raw.githubusercontent.com/kubeedge/sedna/main/scripts/installation/install.sh | SEDNA_ACTION=create bash -

Debug¶

  1. Check the GM status:
kubectl get deploy -n sedna gm
  1. Check the LC status:
kubectl get ds lc -n sedna
  1. Check the pod status:
kubectl get pod -n sedna

Uninstall Sedna¶

curl https://raw.githubusercontent.com/kubeedge/sedna/main/scripts/installation/install.sh | SEDNA_ACTION=delete bash -

PreviousNext

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Kubeedge & Edgemesh & Sedna 配置 的相关文章

  • 数组名取址&a+1和a+1

    第一天 xff0c 取址数组名 amp a C语言中的指针很重要 xff0c 关于指针的使用 xff0c 牛逼的那是真牛逼 xff0c 不行的那是真不行 xff0c 为了加深印象 xff0c 争取做到每日一练 xff01 如有错误 xff0
  • 无人机仿真SLAM_gazebo&promethues

    无人机仿真 总体概述系统要求 PX4固件简介无人机固件整体框图无人机软件框图无人机硬件模型 Mavlink模块位置估计与姿态估计模块安装与编译二次开发 机载计算机程序控制模块估计模块仿真模块SLAM模块SLAM效果演示 总体概述 无人机仿真
  • Android面试专题 (十一):显式Intent & 隐式Intent

    面试官 xff1a 来 xff0c 说一下Android中的显式Intent 和 隐式Intent吧 xff01 嗯 xff0c 乍一听觉得这么简单你让我说什么呢 xff1f 但是 xff0c 没办法 xff0c 面试往往面的就是基础不是嘛
  • AUTOSAR_DCM&DEM(UDS&OBD)

    1 术语与缩写 术语 DCM Diagnostic Communication Manager DEM Diagnostic Event Manager UDS Unified diagnostic services OBD On Boar
  • AUTOSAR E2E & SecOC Comparison

    AUTOSAR E2E amp SecOC Comparison 前面已经介绍过了E2E 和 SecOC CMAC 了 xff0c 既然2者都可以进行数据完整性保护 xff0c 那么2者有什么区别呢 下面基于我的经验所总结 欢迎补充 xff
  • 使用SP Racing F3飞控&ROSflight软件包的无人机自主飞行系统

    搭建四旋翼系统 机架 xff1a XR215 Plus 328 分线板 xff1a XR215 Plus PDB 飞控 xff1a SP Racing F3 标准版 xff08 Acro xff09 86 电机 xff1a 银燕RS2205
  • Kubeedge & Edgemesh & Sedna 配置

    Setting Of Kubeedge amp EdgeMesh amp Sedna Installation 准备安装环境 xff08 主节点和从节点均有 xff09 Edge nod amp Cloud node 两节点均需配置cgro
  • ardupilot & px4 书写自己的app & drivers (二)

    新建任务列表任务 打印时间 任务列表 const AP Scheduler span class hljs tag Task span Copter span class hljs tag scheduler tasks span span
  • shell:重启&&关机

    文章目录 shutdownhaltpoweroffrebootinitsync shutdown 关机重启命令 shutdown h 10十分钟后关机shutdown h 0马上关机shutdown h now马上关机shutdown c取
  • 数组名a+1和&a+1的区别

    C C 43 43 里面的数组名字会退化为指针 xff0c 所以数组名a实际指的是数组的第一个元素的地址 而数组名作为指针来讲有特殊性 xff0c 它正在它所指向的内存区域中 xff0c amp a的值和a的数值是相同的 xff08 可以输
  • 传感模块:MATEKSYS Optical Flow & LIDAR 3901-L0X

    传感模块 xff1a MATEKSYS Optical Flow amp LIDAR 3901 L0X 1 模块介绍2 规格参数3 使用方法Step1 接线方式Step2 安装方式Step3 使用范围 4 存在问题 思考 4 1 MATEK
  • TCP Server&Client socket实现(Ubuntu16.04)

    TCP Server amp Client socket实现 xff08 Ubuntu16 04 xff09 1 测试 xff1a 2 TCP Server3 TCP Client 1 测试 xff1a 2 TCP Server span
  • cv::imread(cv::String const&, int)’未定义的引用

    在 Makefile文件的195 行 LIBRARIES 43 61 opencv core opencv highgui opencv imgproc 后面添加 xff1a opencv imgcodecs opencv videoio修
  • c语言中&与&&区别

    c语言中 amp 与 amp amp 的区别 amp xff1a 按照位与操作 xff0c 例如 xff1a 0010 amp 1101 xff0c 结果为0000 amp 是java中的位逻辑运算 xff1a eg xff1a 2 amp
  • Docker数据卷&&自定义Docker镜像

    目录 宿主机与容器之间的文件拷贝 引言 xff1a 利用MySQL镜像安装MySQL服务 从容器中拷贝文件到宿主机 从宿主机拷贝文件到容器 数据卷 数据卷容器 Dockerfile自定义镜像 自定义tomcat8 xff08 熟悉几乎所有的
  • UART&RS232&RS485的区别

    UART RS232 RS485在串口通信中 xff0c 主要区别是电平的不同 xff0c 其中UART通常使用TTL电平 TTL TTL全名是晶体管 晶体管逻辑集成电路 Transistor Transistor Logic 输入高电平最
  • Flask-SQLAlchemy 中的 relationship & backref

    今天重看 Flask 时 xff0c 发现对backref仍然没有理解透彻 查阅文档后发现 xff0c 以前试图孤立地理解backref是问题之源 xff0c backref是与relationship配合使用的 一对多关系 db rela
  • linux中断&poll&selcet按键处理机制

    在上一篇linux按键中断处理中 xff0c 我们采用按键中断处理获取按键 xff0c 在read函数中阻塞读取 xff0c 当按键发生时 xff0c read自动解除阻塞 xff0c 实现应用层读取到相应的按键值 在上一节中如果没有按键到
  • Cmake入门&运行保存C/C++文件

    Cmake入门 amp 运行保存C C 43 43 文件 在ubuntu创建 保存 运行c 43 43 文件CMake入门创建文件编译 参考 最近在学习Intel realsense T265双目视觉 xff0c 其中一步需要创建源文件ma
  • C++ 文件的读写(fin && fout)

    如何让键盘输入字符保存在 txt文件中 如何让我们自己在键盘上输入的字符不仅仅在屏幕上显示 xff0c 而且还能保存在特定路径的文件中 xff0c 这让简单枯燥的控制台命令程序变得略有趣 首先 xff0c 先看看cin和cout对象 xff

随机推荐