Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Kubernetes:kubectl在获取pod日志时返回404未找到_Kubernetes - Fatal编程技术网

Kubernetes:kubectl在获取pod日志时返回404未找到

Kubernetes:kubectl在获取pod日志时返回404未找到,kubernetes,Kubernetes,我正试图从我的pod中获取日志,但由于某种原因,它不起作用,尽管kubectl descripe pod运行良好,docker日志运行良好。我在单个节点上手动安装了Kubernetes 1.2.3 Debian 8 x64 $ kubectl logs -f web-backend-alzc1 --namespace=my-namespace --v=6 round_trippers.go:286] GET http://localhost:8080/api 200 OK in 0 mi

我正试图从我的pod中获取日志,但由于某种原因,它不起作用,尽管
kubectl descripe pod
运行良好,
docker日志
运行良好。我在单个节点上手动安装了Kubernetes 1.2.3 Debian 8 x64

  $ kubectl logs -f web-backend-alzc1 --namespace=my-namespace --v=6
  round_trippers.go:286] GET http://localhost:8080/api 200 OK in 0 milliseconds
  round_trippers.go:286] GET http://localhost:8080/apis 200 OK in 0 milliseconds
  round_trippers.go:286] GET http://localhost:8080/api/v1/namespaces/my-namespace/pods/web-backend-alzc1 200 OK in 1 milliseconds
  round_trippers.go:286] GET http://localhost:8080/api 200 OK in 0 milliseconds
  round_trippers.go:286] GET http://localhost:8080/apis 200 OK in 0 milliseconds
  round_trippers.go:286] GET http://localhost:8080/api/v1/namespaces/my-namespace/pods/web-backend-alzc1/log?follow=true 404 Not Found in 1 milliseconds
  helpers.go:172] server response object: [{
    "metadata": {},
    "status": "Failure",
    "message": "the server could not find the requested resource ( pods/log web-backend-alzc1)",
    "reason": "NotFound",
    "details": {
      "name": "web-backend-alzc1",
      "kind": "pods/log"
    },
    "code": 404
  }]
  helpers.go:107] Error from server: the server could not find the requested resource ( pods/log web-backend-alzc1)
我是否应该在RC方案中描述一些东西来启用此pod的日志

我尝试重新创建RC并查看journalctl,我看到以下消息:

  hyperkube[443]: I0510 12:14:13.754922     443 hairpin.go:51] Unable to find pair interface, setting up all interfaces: exec: "ethtool": executable file not found in $PATH
  hyperkube[443]: I0510 12:14:13.756866     443 provider.go:91] Refreshing cache for provider: *credentialprovider.defaultDockerConfigProvider
  hyperkube[435]: W0510 12:14:38.835863     435 request.go:344] Field selector: v1 - serviceaccounts - metadata.name - default: need to check if this is versioned correctly.

这是由于将
--enable debug handlers
标志设置为false导致的,这会阻止kubelet附加到容器并获取日志。在没有此标志的情况下重新启动kubelet(默认为
true
)应该可以解决此问题。

您是如何启动节点的?具体来说,您是否将
--启用调试处理程序
标志设置为false?这是一个常规EC2节点,我下载hyperkube和kubectl的二进制文件,通过systemd启动kubelet、代理、控制器、调度程序和apiserver。这个解决方案已经在不同的机器上运行了几个月了,只是我以前从未尝试过处理日志对不起,我的意思是你用什么命令启动kubelet?(您是否禁用了
--enable debug handlers
标志?)!我重新启动了kubelet,但没有这个标志,它现在正在工作!非常感谢。