KubeEdge边缘端部署

KubeEdge边缘端部署

一.集群环境

主机名 角色 工作负载
cloud 云端 K8s,docker,cloudcore
edge 边缘端 docker,edgecore

二.系统配置

2.1网络参数配置

cat >> /etc/hosts << EOF
# GitHub Start
52.74.223.119 github.com
192.30.253.119 gist.github.com
54.169.195.247 api.github.com
185.199.111.153 assets-cdn.github.com
151.101.76.133 raw.githubusercontent.com
151.101.108.133 user-images.githubusercontent.com
151.101.76.133 gist.githubusercontent.com
151.101.76.133 cloud.githubusercontent.com
151.101.76.133 camo.githubusercontent.com
151.101.76.133 avatars0.githubusercontent.com
151.101.76.133 avatars1.githubusercontent.com
151.101.76.133 avatars2.githubusercontent.com
151.101.76.133 avatars3.githubusercontent.com
151.101.76.133 avatars4.githubusercontent.com
151.101.76.133 avatars5.githubusercontent.com
151.101.76.133 avatars6.githubusercontent.com
151.101.76.133 avatars7.githubusercontent.com
151.101.76.133 avatars8.githubusercontent.com
# GitHub End
EOF

2.2关闭防火墙并禁用开机启动

systemctl stop firewalld & systemctl disable firewalld

2.3永久禁用SELinux

sed -i 's/SELINUX=permissive/SELINUX=disabled/' /etc/sysconfig/selinux

2.4关闭swap分区

sed -ri 's/.*swap.*/#&/' /etc/fstab

2.5创建必要目录

mkdir /usr/lib/go
mkdir /opt/idcus
mkdir /opt/idcus/go
mkdir /opt/idcus/go/src
mkdir /opt/idcus/go/bin
mkdir /opt/idcus/go/pkg

2.6设置主机名

hostnamectl set-hostname cloud

reboot

三、安装docker

3.1添加阿里云docker仓库

yum -y install yum-utils
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum makecache

3.2安装docker

yum install docker-ce -y

3.3启动Docker服务并激活开机启动

systemctl start docker & systemctl enable docker

3.4测试docker

docker run hello-world

四、安装keadm

wget https://github.com/kubeedge/kubeedge/releases/download/v1.5.0/keadm-v1.5.0-linux-amd64.tar.gz

tar zxvf keadm-v1.5.0-linux-amd64.tar.gz 
cd keadm-v1.5.0-linux-amd64/keadm/
cp keadm /usr/local/sbin

五、加入cloud节点

keadm join --cloudcore-ipport=云端ip:10000 --token=获取的token
上一篇:Android 11无法mkdir()创建目录文件夹


下一篇:python中执行linux命令案列: