时隔四年有开始重新鼓捣k8s了,重新安装后遇到的错误记录如下:
Error: Package: kubelet-1.14.0-0.x86_64 (kubernetes)
Requires: kubernetes-cni = 0.7.5
Available: kubernetes-cni-0.3.0.1-0.07a8a2.x86_64 (kubernetes)
kubernetes-cni = 0.3.0.1-0.07a8a2
Available: kubernetes-cni-0.5.1-0.x86_64 (kubernetes)
kubernetes-cni = 0.5.1-0
Available: kubernetes-cni-0.5.1-1.x86_64 (kubernetes)
kubernetes-cni = 0.5.1-1
Available: kubernetes-cni-0.6.0-0.x86_64 (kubernetes)
kubernetes-cni = 0.6.0-0
Available: kubernetes-cni-0.7.5-0.x86_64 (kubernetes)
kubernetes-cni = 0.7.5-0
Available: kubernetes-cni-0.8.6-0.x86_64 (kubernetes)
kubernetes-cni = 0.8.6-0
Available: kubernetes-cni-0.8.7-0.x86_64 (kubernetes)
kubernetes-cni = 0.8.7-0
Available: kubernetes-cni-1.1.1-0.x86_64 (kubernetes)
kubernetes-cni = 1.1.1-0
Installing: kubernetes-cni-1.2.0-0.x86_64 (kubernetes)
kubernetes-cni = 1.2.0-0
这个是由于kubernetes-cni版本的问题,推荐使用单独安装并安装前置依赖
--前置依赖
yum -y install yum-utils device-mapper-persistent-data lvm2
单独安装指定的版本的kubelet
yum -y install kubelet-1.14.0
kubeadm join 192.168.8.153:6443 --token p8z7us.fg1urcole799zbe4 \
> --discovery-token-ca-cert-hash sha256:6a11f8a33540785ea9de5cf003504493e69986c56d82f751650ed306e082ddb2
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR FileAvailable--etc-kubernetes-bootstrap-kubelet.conf]: /etc/kubernetes/bootstrap-kubelet.conf already exists
[ERROR FileAvailable--etc-kubernetes-pki-ca.crt]: /etc/kubernetes/pki/ca.crt already exists
从节点加入主节点报错是由于之前有高版本的配置文件存在,删除对应的文件后重新加入即可
rm -rf /etc/kubernetes/bootstrap-kubelet.conf
rm -rf /etc/kubernetes/pki/ca.cr