
三台设备:1台master节点2台slave节点OS:一:前期环境准备1)所有节点安装apt-transport-httpsroot@srv1:~echo"br_netfilter"/......
三台设备:
1台master节点
2台slave节点
OS:
一:前期环境准备
1)所有节点安装apt-transport-https
root@srv1:~echo"br_netfilter"/etc//@srv1:~sysctl--system
3)取消并注释fstab中的swap
root@srv1:~/dev/disk/by-uuid/aa1f65c9-2728-4763-9f2b-d6d0bc1ee92enoneswapsw00swapoff-a
4)在所有节点上安装Kubeadm,Kubelet,Kubectl
root@srv1:~chmod644/etc/apt//@srv1:~aptupdate;aptinstallkubeadmkubeletkubectl-y
5)所有节点安装
root@srv1:~echo"deb$(lsb_release-cs)stable"/etc/apt//@srv1:~containerdconfigdefault/etc/containerd/@srv1:~sed-i'spoint=""sed-i'ssandbox_image="/google_containers/
二:配置Master节点
1)初始化k8s并指定APIServer及pod所用的网络ID
root@srv1:~echo"exportKUBECONFIG=/etc/kubernetes/".bashrcroot@srv1:~/google_containers//google_containers//google_containers//google_containers//google_containers//google_containers//google_containers/
3)配置PodFlannelNetwork
crictlpullrancher/mirrored-flannelcni-flannel:@srv1:~
5)确认Master节点所有的namespaces
root@srv1:~:6443--\--discovery-token-ca-cert-hashsha256:8c83889acbef5a54b410e8d2513b6eca01ee7eef1244737bacec81168fc5d553[preflight]Runningpre-flightchecks[preflight]Readingconfigurationfromthecluster[preflight]FYI:Youcanlookatthisconfigfilewith'kubectl-nkube-systemgetcmkubeadm-config-oyaml'[kubelet-start]Writingkubeletconfigurationtofile"/var/lib/kubelet/"[kubelet-start]Writingkubeletenvironmentfilewithflagstofile"/var/lib/kubelet/"[kubelet-start]Startingthekubelet[kubelet-start]WaitingforthekubelettoperformtheTLSBootstrapThisnodehasjoinedthecluster:*Certificatesigningrequestwassenttoapiserverandaresponsewasreceived.*'kubectlgetnodes'onthecontrol-planetoseethisnodejointhecluster
root@srv3:~