【问题标题】:pod logs not stored in EKS nodespod 日志未存储在 EKS 节点中
【发布时间】:2022-01-14 07:06:34
【问题描述】:

我正在尝试配置一个 fluend 以将日志发送到弹性搜索。配置后,在elasticsearch中看不到任何pod日志。

在调试正在发生的事情时,我看到路径var/log/pods 中的节点中没有日志:

cd var/logs/pods
ls -la
drwxr-xr-x. 34 root root 8192 Dec  9 12:26 .
drwxr-xr-x. 14 root root 4096 Dec  9 02:21 ..
drwxr-xr-x.  3 root root   21 Dec  7 03:14 pod1
drwxr-xr-x.  6 root root  119 Dec  7 11:17 pod2
cd pod1/containerName
ls -la
total 0
drwxr-xr-x. 2 root root  6 Dec  7 03:14 .
drwxr-xr-x. 3 root root 21 Dec  7 03:14 ..

但是执行kubectl logs pod1时可以看到日志

正如我在documentation 日志中看到的那样,应该在此路径中。您知道为什么节点中没有存储日志吗?

【问题讨论】:

    标签: kubernetes logging amazon-eks fluentd


    【解决方案1】:

    我发现了正在发生的事情。该问题与日志驱动程序有关。它被配置为将日志发送到日志:

    docker inspect -f '{{.HostConfig.LogConfig.Type}}' ID
    journald
    

    我已将其更改为json-file。现在正在写日志var/log/pods

    Here 有不同的日志记录配置选项

    【讨论】:

      猜你喜欢
      • 2022-12-12
      • 1970-01-01
      • 2019-04-01
      • 2023-01-15
      • 1970-01-01
      • 2021-10-06
      • 1970-01-01
      • 2020-01-01
      • 1970-01-01
      相关资源
      最近更新 更多