Giter Site home page Giter Site logo

容器内日志如何采集 about loggie HOT 8 CLOSED

loggie-io avatar loggie-io commented on June 13, 2024
容器内日志如何采集

from loggie.

Comments (8)

liguozhong avatar liguozhong commented on June 13, 2024

是不是 pod 一定得制定 volumes,同时必须value 类型是 emptyDir 和 hostPath 这两类的其中一种才能采集到 容器内的日志。
如果 pod 完全不配置 volumes: 这种pod容器内的日志可以采集到吗

      volumes:
      - emptyDir: {}
        name: log     
      volumes:
      - hostPath:
          path: /data/log
          type: ""

from loggie.

liguozhong avatar liguozhong commented on June 13, 2024

源码看起来,pod如果没有配置 volumes 就无法使用采集容器内的日志的。是这样吗? 是受限的的pod,需要pod 有配置 volumes 才可以采集是吧?

image

from loggie.

liguozhong avatar liguozhong commented on June 13, 2024

函数看球来也是一定要判断,empty和 hostpath才可以

image

from loggie.

liguozhong avatar liguozhong commented on June 13, 2024

比如下面的测试 demo pod,什么volume 都没有配置,能不能使用 loggie 采集到 容器内的日志。

apiVersion: apps/v1
kind: Deployment
metadata:
  name: ebiz-deployment
  labels:
    app: ebiz-app
spec:
  replicas: 3
  selector:
    matchLabels:
      app: ebiz-app
  template:
    metadata:
      labels:
        app: ebiz-app
    spec:
      containers:
        - name: ebiz
          image: docker.io/xdatcloud/demo:latest

from loggie.

ethfoo avatar ethfoo commented on June 13, 2024

pod没有挂载volume的情况下,我们内部版本支持从docker rootfs采集日志,但是需要挂载docker sock,下个小版本,我们考虑使用更好的方案去支持一下。

from loggie.

liguozhong avatar liguozhong commented on June 13, 2024

另外我们有一些用pvc 挂在的pod,这种日志能采集得了吗?

          volumeMounts:
            - mountPath: /cassandra_data
              name: cassandra-data

  volumeClaimTemplates:
    - apiVersion: v1
      kind: PersistentVolumeClaim
      metadata:
        annotations:
          volume.beta.kubernetes.io/storage-class: fast
        name: cassandra-data
      spec:
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: 50Gi
        storageClassName: fast
        volumeMode: Filesystem
      status:
        phase: Pending

from loggie.

liguozhong avatar liguozhong commented on June 13, 2024

👍,期待做好。
这个容器内日志采集,确实是一个非常**特色的场景,**内现在完全不按 12 因素来执行,这个采集如果能统一有个解决方案就好了。

from loggie.

ethfoo avatar ethfoo commented on June 13, 2024

Fixed by: #208

from loggie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.