1.Kubelet日志查看:当apiserver不通时。
[root@node1 home]# journalctl -xu kubelet -- Logs begin at 四 2023-09-14 22:17:47 CST, end at 四 2023-09-14 22:55:11 CST. 9月 14 22:18:08 node1 systemd[1]: Started kubelet: The Kubernetes Node Agent. -- Subject: Unit kubelet.service has finished start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit kubelet.service has finished starting up. --
2.ImageInspectError :
这种就是网络原因或者存储问题导致镜像损坏,一般删除重新拉取就可以了
3.container has runAsNonRoot and image has non-numeric user (xxxx):
PodSecurityPolicy设置为runAsNonRoot,容器具有runAsNonRoot,并且映像具有非数字用户(appuser),无法验证用户是否为非root用户。
解决: 指定 securityContext: runAsUser: 1000,随便一个 id 号即可,只要不是 0 (0 代表 root)。
apiVersion: v1 kind: Pod metadata: name: helloworld spec: securityContext: runAsNonRoot: true runAsUser: 5000 runAsGroup: 5000 fsGroup: 5000
4.
ERROR: for myproj_py_web_1 Cannot start service web: OCI runtime create failed: container_linux.go:346: starting container process caused "exec: \"/code/entrypoint.sh\": stat /code/entrypoint.sh: no such file or directory": unknown
/var/lib/Kubelet/pod 下的数据目录已经损坏,删除对应的目录即可