无法获取kubernetes'从节点

时间:2018-03-23 06:42:18

标签: docker kubernetes

我通过kubeadm设置kubernetes集群,pod网络是法兰绒,我可以获取在主服务器上运行的pod的日志。

$ kubectl get pod -o wide
NAME                     READY     STATUS    RESTARTS   AGE       IP            NODE
httpd-7448fc6b46-fgkp2   1/1       Running   0          1d        10.244.2.39   k8s-node2
httpd-7448fc6b46-njbh8   1/1       Running   0          1d        10.244.0.10   k8smaster
httpd-7448fc6b46-wq4zs   1/1       Running   0          1d        10.244.1.75   k8s-node1

$ kubectl logs httpd-7448fc6b46-njbh8
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.244.0.10. Set the 'ServerName' directive globally to suppress this message
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.244.0.10. Set the 'ServerName' directive globally to suppress this message
[Wed Mar 21 10:10:21.568990 2018] [mpm_event:notice] [pid 1:tid 139992519874432] AH00489: Apache/2.4.32 (Unix) configured -- resuming normal operations
[Wed Mar 21 10:10:21.569204 2018] [core:notice] [pid 1:tid 139992519874432] AH00094: Command line: 'httpd -D FOREGROUND'
10.244.0.1 - - [21/Mar/2018:10:21:02 +0000] "GET / HTTP/1.1" 200 45
10.244.0.1 - - [21/Mar/2018:10:22:53 +0000] "GET / HTTP/1.1" 200 45

但我无法获取在从属节点上运行的pod的日志,结果如下:

"Error from server: Get https://192.168.18.111:10250/containerLogs/default/httpd-7448fc6b46-6pf7w/httpd?follow=true: cannotconnect"

如何调试问题?任何想法?

1 个答案:

答案 0 :(得分:0)

问题已经解决,我的群集在防火墙后面,需要设置代理才能下载映像,所以我设置了docker的代理,但是当我设置时我没有绕过从节点代理,因此日志请求被docker中的代理设置误导。