Centos7重启后k8s无法正常启动
重启了centos后,发现k8s没有正常启动
# kubectl get nodes
提示无法正常连接,查看k8s是否正常启动
# systemctl status kubelet
提示:Active: activating (auto-restart) (Result: exit-code)
查看相关日志
# journalctl -xefu kubelet
发现时swap没有关闭导致的
# swapoff -a # cp -p /etc/fstab /etc/fstab.bak$(date '+%Y%m%d%H%M%S') # sed -i "s/\/dev\/mapper\/centos-swap/\#\/dev\/mapper\/centos-swap/g" /etc/fstab # systemctl daemon-reload # systemctl restart kubelet