kubeedge分为云端(cloud)和边缘端(edge)
云端:docker,k8s集群,
边缘端(不要安装K8S):docker,
cloud端安装
(cloud端负责编译KubeEdge的相关组件与运行cloudcore)
准备需要的安装包
因为github上下载慢(只有几KB的速度)提前下载好以下文件
https://github.com/kubeedge/kubeedge/releases/download/v1.12.1/kubeedge-v1.12.1-linux-amd64.tar.gz
https://github.com/kubeedge/kubeedge/releases/download/v1.12.1/keadm-v1.12.1-linux-amd64.tar.gz
下载好的安装包上传到/etc/kubeedge
在/etc/kubeedge下操作
mkdir /etc/kubeedge/
cd /etc/kubeedge/
tar -zxvf keadm-v1.12.1-linux-amd64.tar.gz
cp keadm-v1.12.1-linux-amd64/keadm/keadm /usr/local/bin/keadm
设置云端(KubeEdge 主节点)
keadm init --advertise-address="IP" --profile version=v1.12.1 --kube-config=/root/.kube/config
输出:
Kubernetes version verification passed, KubeEdge installation will start...
CLOUDCORE started
=========CHART DETAILS=======
NAME: cloudcore
LAST DEPLOYED: Wed Oct 26 11:10:04 2022
NAMESPACE: kubeedge
STATUS: deployed
REVISION: 1
kubectl get all -n kubeedge
设置边缘端(KubeEdge 工作节点)
在云端运行将返回令牌,该令牌将在加入边缘节点时使用。
# keadm gettoken
27a37ef16159f7d3be8fae95d588b79b3adaaf92727b72659eb89758c66ffda2.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1OTAyMTYwNzd9.JBj8LLYWXwbbvHKffJBpPd5CyxqapRQYDIXtFZErgYE
加入边缘节点
在/etc/kubeedge下操作
mkdir /etc/kubeedge/
cd /etc/kubeedge/
tar -zxvf keadm-v1.12.1-linux-amd64.tar.gz
cp keadm-v1.12.1-linux-amd64/keadm/keadm /usr/local/bin/keadm
keadm join --cloudcore-ipport="cloud端IP":10000 --token=27a37ef16159f7d3be8fae95d588b79b3adaaf92727b72659eb89758c66ffda2.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1OTAyMTYwNzd9.JBj8LLYWXwbbvHKffJBpPd5CyxqapRQYDIXtFZErgYE --kubeedge-version=v1.10.1
边缘端在启动edgecore后,会与云端的cloudcore进行通信,K8s进而会将边缘端作为一个node纳入K8s的管控。
kubectl get node
[root@k8s-master-node1 kubeedge]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8s-master-node1 Ready control-plane,master,worker 40h v1.22.1
k8s-worker-node1 Ready worker 40h v1.22.1
node-1.novalocal Ready agent,edge 8s v1.22.6-kubeedge-v1.12.1
评论区