TS:k8s里kubelet无法启动报错code=exited, status=255-2022.11.23(已解决)

TS:k8s里kubelet无法启动报错code=exited, status=255-2022.11.23(已解决)

![image.png](https://img-blog.csdnimg.cn/img_convert/35a95c44e22a79b0852a0474eafc2a68.png#averageHue=#585d75&clientId=u42db68f5-b3d7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=806&id=uc1aa0c4d&margin=[object Object]&name=image.png&originHeight=1007&originWidth=668&originalType=binary&ratio=1&rotation=0&showTitle=false&size=588560&status=done&style=stroke&taskId=u117711e5-1997-452f-b21a-b8ec36167eb&title=&width=534.4)

故障环境

k8s version:v1.20
CONTAINER-RUNTIME:docker://20.10.7

1、报错现象

自己k8s集群的kubelet服务怎么一直是activating装态呢?启动不了……

Process: 9249 ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS (code=exited, status=255)

![image.png](https://img-blog.csdnimg.cn/img_convert/e7ad2b041586fe66b8ca8faa5dc455f9.png#averageHue=#4a4436&clientId=u72a05d18-383f-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=412&id=u90acd647&margin=[object Object]&name=image.png&originHeight=515&originWidth=2247&originalType=binary&ratio=1&rotation=0&showTitle=false&size=714957&status=done&style=stroke&taskId=u4c399919-6322-4d56-889d-543569f0494&title=&width=1797.6)![image.png](https://img-blog.csdnimg.cn/img_convert/27ba468032ba2aae7528d90b2305ee71.png#averageHue=#4b4330&clientId=u72a05d18-383f-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=99&id=ued777cc8&margin=[object Object]&name=image.png&originHeight=124&originWidth=1263&originalType=binary&ratio=1&rotation=0&showTitle=false&size=80443&status=done&style=stroke&taskId=u7724e55b-58e7-4956-af3b-7384033e8aa&title=&width=1010.4)

2、解决办法

哎,自己的swap分区怎么被启用了呢……
![image.png](https://img-blog.csdnimg.cn/img_convert/19669a8d5a282b683ff903089594cdc2.png#averageHue=#484033&clientId=u72a05d18-383f-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=334&id=u32bee57d&margin=[object Object]&name=image.png&originHeight=417&originWidth=1217&originalType=binary&ratio=1&rotation=0&showTitle=false&size=242498&status=done&style=stroke&taskId=u596410b9-ed4f-41ac-98d7-afd5b4092d4&title=&width=973.6)

3、观察效果

关闭swap后,再次测试:

sed -ri 's/.*swap.*/#&/' /etc/fstab
swapoff -a

![image.png](https://img-blog.csdnimg.cn/img_convert/7aa87dc7e9bf91840ef9aae0a3b007ec.png#averageHue=#474032&clientId=u72a05d18-383f-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=690&id=u15d7f78a&margin=[object Object]&name=image.png&originHeight=863&originWidth=1252&originalType=binary&ratio=1&rotation=0&showTitle=false&size=557968&status=done&style=stroke&taskId=u1b6c02aa-ea3a-41d0-a521-f7f40c17668&title=&width=1001.6)
关闭3个节点的swap后,这个kublet服务就马上启动了。(也是无语呀……)
![image.png](https://img-blog.csdnimg.cn/img_convert/bd6f822b3b56ba5d24ef0bf996560f62.png#averageHue=#494336&clientId=u72a05d18-383f-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=626&id=u904c3603&margin=[object Object]&name=image.png&originHeight=783&originWidth=2442&originalType=binary&ratio=1&rotation=0&showTitle=false&size=985950&status=done&style=stroke&taskId=u968009f6-3803-4986-94a0-e3895fc3ef6&title=&width=1953.6)

你可能感兴趣的:(k8s,kubernetes,kubelet,linux)