kubernetes api服务器日志超时

时间:2017-10-12 15:28:53

标签: kubernetes

我在使用kubespray安装k8s时遇到了问题,问题出在api服务器上,启动时它抱怨一些超时错误并且出现故障。

长错误消息的底线是这样的:

logging error output: "k8s\x00\n\f\n\x02v1\x12\x06Status\x12b\n\x04\n\x00\x12\x00\x12\aFailure\x1a9Timeout: request did not complete within allowed duration\"\aTimeout*\n\n\x00\x12\x00\x1a\x00(\x002\x000\xf8\x03\x1a\x00\"\x00"

这也是健康检查的结果

-> curl localhost:8080/healthz
[+]ping ok
[+]poststarthook/generic-apiserver-start-informers ok
[+]poststarthook/start-apiextensions-informers ok
[+]poststarthook/start-apiextensions-controllers ok
[-]poststarthook/bootstrap-controller failed: reason withheld
[+]poststarthook/extensions/third-party-resources ok
[-]poststarthook/ca-registration failed: reason withheld
[+]poststarthook/start-kube-apiserver-informers ok
[+]poststarthook/start-kube-aggregator-informers ok
[+]poststarthook/apiservice-registration-controller ok
[+]poststarthook/apiservice-status-available-controller ok
[+]poststarthook/kube-apiserver-autoregistration ok
[-]autoregister-completion failed: reason withheld
healthz check failed

我已经更改了api服务器清单并设置了--v = 5,但我仍然没有看到任何有用的日志。

如何调试问题?

1 个答案:

答案 0 :(得分:1)

我最近遇到了同样的问题。健康检查日志与您相同。

Etcd本身还可以,etcdctl可以操作它,apiserver显示etcd也可以。

k8s apiserver日志仅显示etcd超时。

检查了etcd和apiserver之间的套接字后,我发现apiserver根本没有与etcd的连接。

因此,我使用了检查客户端证书文件,并发现其有效时间已到期。因此apiserver无法在etcd上建立ssl连接。但是apiserver没有显示正确的错误。

希望这对您有所帮助。