kube-flannel
kubectl create -f kube-flannel.yml # 查看node还是处于NoReay状态 kubectl get node # NAME STATUS ROLES AGE VERSION # k8s-master NotReady master 5h41m v1.17.2 # NAME STATUS ROLES AGE VERSION # k8s-master Ready master 5h59m v1.17.2 集群node1和node2加入节点执行
kubeadm join 192.168.124.183:6443 --token abcdef.0123456789abcdef \ --discovery-token-ca-cert-hash sha256:58056cdd9dfd9cc91da880adc63a2a7e9e7594eeda1bf7c2bcdceb0fbbf255ad检测集群是否安装完成
kubectl get node kubectl get pods --all-namespaces 问题虚拟机配置比较低,所以会出现一些错误,我们可以按照提示忽略【非生产环境】
[ERROR NumCPU CPU] 必须超过2个,把虚拟机的处理器设置一下即可。
[ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables] 解决:echo "1" > /proc/sys/net/bridge/bridge-nf-call-iptables
[ERROR DirAvailable--var-lib-etcd]: /var/lib/etcd is not empty 解决:清空/var/lib/etcd 目录
[ERROR FileContent--proc-sys-net-ipv4-ip_forward]: /proc/sys/net/ipv4/ip_forward contents are not set to 1 解决: echo '1' > /proc/sys/net/ipv4/ip_forward
https://blog.csdn.net/wangxinxinsj/article/details/90768030
https://blog.csdn.net/wangmiaoyan/article/details/101216496