1、安装docker、kubelet、kubectl、kubeadm、socat安装相应版本的kubernets
2、将需要的镜像都加载到服务器上⾯:
3、在master上⾯copy cni⽂件到node节点上⾯:#mkdir -p /etc/cni/net.d在master上⾯copy:
#scp /etc/cni/net.d/10-flannel.conf 10.0.1.19:/etc/cni/net.d
4、加⼊cluster
⾸先k8s默认的cgroup-driver为cgroupfs,但是yum安装kubelet的时候⾃动修改为systemd,⽽docker通过docker info命令查看是cgroupfs,所以需要将k8s的修改为cgroupfs:
#vim /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
Environment=\"KUBELET_CGROUP_ARGS=--cgroup-driver=cgroupfs\"#systemctl enable docker#systemctl enable kubelet
#kubeadm join --token c04f89.b781cdb55d83c1ef 10.10.3.4:63 --discovery-token-ca-cert-hash
sha256:986e83a9cb948368ad0552b95232e31d3b76e2476b595bd1d905d5242ace29af --ignore-preflight-errors=Swap#kubectl label node km1 node-
因篇幅问题不能全部显示,请点此查看更多更全内容