如何重启 kubernetes 节点? [英] How to restart kubernetes nodes?
问题描述
节点状态报告为unknown
"conditions": [
{
"type": "Ready",
"status": "Unknown",
"lastHeartbeatTime": "2015-11-12T06:03:19Z",
"lastTransitionTime": "2015-11-12T06:04:03Z",
"reason": "Kubelet stopped posting node status."
}
whle kubectl get nodes
返回 NOTReady 状态.这意味着什么以及如何解决这个问题?
whle kubectl get nodes
return a NOTReady status. What does this imply and how to fix this?
推荐答案
获取节点
kubectl get nodes
结果:
NAME STATUS AGE
192.168.1.157 NotReady 42d
192.168.1.158 Ready 42d
192.168.1.159 Ready 42d
描述节点
这是192.168.1.157
节点上的NotReady.然后调试这个notready节点,可以阅读官方文档——Application Introspection and Debugging.
Describe node
Here is a NotReady on the node of 192.168.1.157
. Then debugging this notready node, and you can read offical documents - Application Introspection and Debugging.
kubectl describe node 192.168.1.157
部分结果:
Conditions:
Type Status LastHeartbeatTime LastTransitionTime Reason Message
---- ------ ----------------- ------------------ ------ -------
OutOfDisk Unknown Sat, 28 Dec 2016 12:56:01 +0000 Sat, 28 Dec 2016 12:56:41 +0000 NodeStatusUnknown Kubelet stopped posting node status.
Ready Unknown Sat, 28 Dec 2016 12:56:01 +0000 Sat, 28 Dec 2016 12:56:41 +0000 NodeStatusUnknown Kubelet stopped posting node status.
我的节点上有一个 OutOfDisk,然后 Kubelet 停止发布节点状态.所以,我必须释放一些磁盘空间,在我的 Ubuntu14.04 上使用 df
命令我可以检查内存的详细信息,并使用 docker 命令rmi image_id/image_name
在su
的作用下我可以删除无用的图像.
There is a OutOfDisk on my node, then Kubelet stopped posting node status.
So, I must free some disk space, using the command of df
on my Ubuntu14.04 I can check the details of memory, and using the command of docker rmi image_id/image_name
under the role of su
I can remove the useless images.
使用ssh登录192.168.1.157
,如ssh administrator@192.168.1.157
,并通过<切换到'su'代码>sudo su;
Login in 192.168.1.157
by using ssh, like ssh administrator@192.168.1.157
, and switch to the 'su' by sudo su
;
/etc/init.d/kubelet restart
结果:
stop: Unknown instance:
kubelet start/running, process 59261
再次获取节点
在主站上:
kubectl get nodes
结果:
NAME STATUS AGE
192.168.1.157 Ready 42d
192.168.1.158 Ready 42d
192.168.1.159 Ready 42d
好的,那个节点工作正常.
Ok, that node works fine.
这是一个参考:Kubernetes
这篇关于如何重启 kubernetes 节点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!