Skip to content

[QUESTION]:DaemonSet采集容器文件的最小化挂载配置 #1800

@scheshan

Description

@scheshan

按照文档,要采集容器文件,部署DaemonSet的时候还要挂载根目录。

        - hostPath:
            path: /
            type: Directory
          name: root

这个路径太大了,我们准备按需要挂载。我们CRI是containerd,我把rootfs、挂载卷、标准输出的几个路径都单独挂载了

        volumeMounts:
            - mountPath: /var/run                       # for container runtime socket
              name: run
            - mountPath: /logtail_host/home/containerd                  # for log access on the node
              mountPropagation: HostToContainer
              name: containerd
              readOnly: true
            - mountPath: /logtail_host/home/kubelet                  # for log access on the node
              mountPropagation: HostToContainer
              name: kubelet
              readOnly: true
            - mountPath: /logtail_host/var/log                  # for log access on the node
              mountPropagation: HostToContainer
              name: varlog
              readOnly: true
            - mountPath: /home/ilogtail/ilogtail-2.0.4/checkpoint # for checkpoint between container restart
              name: checkpoint
    volumes:
        - hostPath:
            path: /var/run
            type: Directory
          name: run
        - hostPath:
            path: /home/containerd/
            type: Directory
          name: containerd
        - hostPath:
            path: /home/kubelet/
            type: Directory
          name: kubelet
        - hostPath:
            path: /var/log/
            type: Directory
          name: varlog
        - hostPath:
            path: /etc/ilogtail/checkpoint
            type: DirectoryOrCreate
          name: checkpoint

这样的效果是,如果容器日志文件没有挂载,就采集不到了。还需要啥额外的文件要挂载嘛

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions