centos上安装kubernetes

1) ensure docker is running, if not, run: systemctl start docker

2) https://phoenixnap.com/kb/how-to-install-kubernetes-on-centos

   
#安装指定版本的k8s
yum install -y kubelet-1.19.0  kubeadm-1.19.0  kubectl-1.19.0
kubeadm init --pod-network-cidr=10.244.0.0/16

#==========================
# for flannel
#--------------------------
firewall-cmd --permanent --add-port=8285/udp
firewall-cmd --reload

#==========================
# success logs
#--------------------------
kubeadm join 10.0.2.12:6443 --token wbroqe.tz5rjwdiycxqjj5v
    --discovery-token-ca-cert-hash sha256:c9c8756f9550b7aa2af2863fe75b4479ce5d6fb7b5c989780fe90b72f68c5cc3
kubeadm join 10.12.198.166:6443 --token p6kier.tfjfos5krz4xbzog
    --discovery-token-ca-cert-hash sha256:c87ae0ab9f2a3254e06dbaea8d8bb8c78800dc49733cd5e1db574939177ffe9e


#=============参考资料
https://blog.csdn.net/weixin_40668374/article/details/108646914
https://blog.csdn.net/Alex_Sheng_Sea/article/details/107188845

原文地址:https://www.cnblogs.com/testzcy/p/14156747.html