Debugging 当Kubernetes吊舱以';快速回退';?

Debugging 当Kubernetes吊舱以';快速回退';?,debugging,logging,kubernetes,kibana,fluentd,Debugging,Logging,Kubernetes,Kibana,Fluentd,我正在运行一个pod,它向“terminationMessagePath”写入一条简单的消息,然后pod以“CrashLoopBackOff”退出。我希望能够通过Kibana进行调试,而不必登录到每个Kubernetes节点。我查询Kibana从属性reason&message获取容器最后状态值“CrashLoopBackOff”,但找不到条目 我可以在Kibana中看到pod的字段,但是我要查找的字段(下面的粗体yaml格式)是空的 fluentd中需要什么配置才能从Kubernetes吊舱获

我正在运行一个pod,它向“terminationMessagePath”写入一条简单的消息,然后pod以“CrashLoopBackOff”退出。我希望能够通过Kibana进行调试,而不必登录到每个Kubernetes节点。我查询Kibana从属性reason&message获取容器最后状态值“CrashLoopBackOff”,但找不到条目

我可以在Kibana中看到pod的字段,但是我要查找的字段(下面的粗体yaml格式)是空的

fluentd中需要什么配置才能从Kubernetes吊舱获取日志?或者需要从Kubernetes设置配置

$kubectl get pod_name_1-o=yaml

terminationMessagePath: /var/log/containers/dt.log
volumeMounts:
- mountPath: /var/log/containers
  name: data
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
  name: default-token-s0w2n
  readOnly: true
dnsPolicy: ClusterFirst
nodeName: dev-master-01
restartPolicy: Always
securityContext: {}
serviceAccount: default
serviceAccountName: default
terminationGracePeriodSeconds: 30
volumes:
- hostPath:
  path: /var/log/containers
  name: data
- name: default-token-s0w2n
secret:
  defaultMode: 420
  secretName: default-token-s0w2n
status:
conditions:
 - lastProbeTime: null
   lastTransitionTime: 2017-07-05T14:45:11Z
   status: "True"
   type: Initialized
 - lastProbeTime: null
   lastTransitionTime: 2017-07-05T17:00:22Z
   message: 'containers with unready status: [dt-termination-demo]'
   reason: ContainersNotReady
   status: "False"
   type: Ready
 - lastProbeTime: null
   lastTransitionTime: 2017-07-05T14:45:11Z
   status: "True"
   type: PodScheduled
   containerStatuses:
 - containerID: 
   docker://9649c26527cf0e1cd3bd67ba9c606c0b78e6b4f08bacf96175627ddc7d250772
   image: debian
   imageID: docker pullable://docker.io/debian@sha256:
            7d067f77d2ae5a23fe6920f8fbc2936c4b0d417e9d01b26372561860750815f0
   lastState:
   terminated:
   containerID: docker://
   9649c26527cf0e1cd3bd67ba9c606c0b78e6b4f08bacf96175627ddc7d250772              
   exitCode: 0
   finishedAt: 2017-07-05T17:00:22Z
   **message: |
    Sleep expired**
    reason: Completed
   startedAt: 2017-07-05T17:00:12Z
   name: dt-termination-demo
   ready: false
   restartCount: 30
   state:
     waiting:
     message: Back-off 5m0s restarting failed container=dt-termination-demo 
              pod=dt-termination-demo-2814930607-8kshj_
              default(8c247b15-6190-11e7-acb7-00505691210d)
     **reason: CrashLoopBackOff**
   hostIP: 192.21.19.128
   phase: Running
   podIP: 10.0.0.8
   startTime: 2017-07-05T14:45:11Z

当Fluentd部署为守护程序集时,它的目标是从节点和POD收集所有日志。作为完成此操作的指南,请检查以下Yaml文件和进一步的相关存储库:

如果您需要其他帮助,也可以加入我们的Slack channel:


edsiper,感谢您的回复。Fluentd确实从节点和Pod收集日志,但当Pod终止或因“CrashLoopBackOff”错误而崩溃时,它不会收集日志。在Kibana中,我可以看到关于带有“CrashLoopBackOff”的pod的信息,但在日志或消息中看不到实际的“CrashLoopBackOff”值。日志通常包含容器状态的最后状态和当前状态。包含容器状态信息的命令(kubectl get pod_name-o=yaml)