v1.17.4-v1.18.20
kubelet无法启动可能的原因
failed to run Kubelet: misconfiguration: kubelet cgroup driver: "systemd" is different from docker cgroup driver: "cgroupfs"
解决办法:修改 Docker 的 cgroup driver
编辑 Docker 的配置文件 /etc/docker/daemon.json,添加 "exec-opts": ["native.cgroupdriver=systemd"]
重新启动 Docker
sudo systemctl daemon-reload
sudo systemctl restart docker
重启 kubelet 服务
sudo systemctl daemon-reload
sudo systemctl restart kubelet
升级master节点
升级 kubeadm
更新存储库:
sudo yum install -y kubeadm-1.18.20
检查当前升级计划:
sudo kubeadm upgrade plan
执行升级
udo kubeadm upgrade apply v1.18.20
升级 kubelet 和 kubectl
安装新版的 kubelet 和 kubectl:
yum install -y kubelet-1.18.20 kubectl-1.18.20
重启 kubelet:
sudo systemctl daemon-reload
sudo systemctl restart kubelet
验证 master 节点状态
kubectl get nodes
kubectl get pods --all-namespaces
升级 worker 节点
升级 kubeadm
升级 kubeadm:
yum install -y kubeadm-1.18.20
将节点标记为可升级:
sudo kubeadm upgrade node
升级 kubelet 和 kubectl
安装新版的 kubelet 和 kubectl:
安装新版的 kubelet 和 kubectl:
sudo yum install -y kubelet-1.18.20 kubectl-1.18.20
重启 kubelet:
sudo systemctl daemon-reload
sudo systemctl restart kubelet