Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log-pilot不支持containerd引擎 #349

Open
xjdszp opened this issue May 18, 2022 · 9 comments
Open

log-pilot不支持containerd引擎 #349

xjdszp opened this issue May 18, 2022 · 9 comments

Comments

@xjdszp
Copy link

xjdszp commented May 18, 2022

log-pilot不支持containerd引擎,现在k8s集群的版本高时,无法采集containerd容器引擎的日志

@lvelvis
Copy link

lvelvis commented Dec 29, 2022

https://hub.docker.com/r/williamguozi/log-pilot-filebeat ,可以用这个试试

@bogeit
Copy link

bogeit commented Mar 9, 2023

https://hub.docker.com/r/williamguozi/log-pilot-filebeat ,可以用这个试试
@lvelvis 厉害了,这个实测可以支持containerd runtime,有一点要注意,因为换了容器运行时,在要收集stdout日志时,需要把filebeat配置模板 filebeat.tpl里面这几行去掉,才会正常收集服务stdout输出的日志:

  {{if .Stdout}}
  docker-json: true
  {{end}}

@lvelvis
Copy link

lvelvis commented Mar 17, 2023

https://hub.docker.com/r/williamguozi/log-pilot-filebeat ,可以用这个试试
@lvelvis 厉害了,容器运行时,有有要要要的日记:

  {{if .Stdout}}
  docker-json: true
  {{end}}

支持es7吗

可以的,一般不建议直接入到ES,可以用kafka或者redis中转下,再用logstash清洗过滤入库

@wuchenyanghaoshuai
Copy link

我记得output是kafka的时候,会自动创建topic的,但是我用了上面的image,不知道为啥不会自动创建topic了

@wolgod
Copy link

wolgod commented Jul 5, 2023

https://hub.docker.com/r/williamguozi/log-pilot-filebeat ,可以用这个试试

源码地址能发下吗

@zhajingwen
Copy link

filebeat.tpl
是要进入到容器里面修改吗?然后子啊commit生成新的镜像?

@zhajingwen
Copy link

zhajingwen commented Aug 30, 2023

用该配置文件(yml)部署在kind搭建的K8s上

apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: log-pilot-filebeat
spec:
  selector:
    matchLabels:
      app: log-pilot-filebeat
  template:
    metadata:
      labels:
        app: log-pilot-filebeat
    spec:
      containers:
        - name: log-pilot-filebeat
          image: williamguozi/log-pilot-filebeat:containerd
          volumeMounts:
            - name: containerd-sock
              mountPath: /var/run/containerd/containerd.sock
            - name: localtime
              mountPath: /etc/localtime
            - name: rootfs
              mountPath: /host
              readOnly: true
          securityContext:
            capabilities:
              add:
                - SYS_ADMIN
          env:
            - name: PILOT_LOG_PREFIX
              value: "bitget"
            - name: LOGGING_OUTPUT
              value: "elasticsearch"
            - name: ELASTICSEARCH_HOSTS
              value: "http://elasticsearch:9200"
      volumes:
        - name: containerd-sock
          hostPath:
            path: /run/containerd/containerd.sock
        - name: localtime
          hostPath:
            path: /etc/localtime
        - name: rootfs
          hostPath:
            path: /
          readOnly: true

报如下错误,该咋整?

time="2023-08-30T03:19:00Z" level=info msg="logs: eda28d6da7a090b25e7ea201d6a5c05ec2d89115dde90264d623e69c61624868 = &{spider /host/var/log/pods/default_spiders-8696457598-p88pk_7e87573f-2be6-4bd8-8749-ea2a707aece5/cmc-tg  nonex map[time_format:%Y-%m-%dT%H:%M:%S.%NZ] *.log map[index:spider topic:spider]  false true map[] map[]}"

false true map[] map这意思是map错误?

image
bign并且K8s 查看并未采集到日志

This was referenced Aug 30, 2023
@zhajingwen
Copy link

zhajingwen commented Aug 30, 2023

已经基于williamguozi/log-pilot-filebeat:containerd再次构建,以此来适配捕获stdout日志输出;详细流程

@yidaimi
Copy link

yidaimi commented Jan 10, 2024

换了容器运行时,在要收集stdout日志时,需要把filebeat配置模板 filebeat.tpl里面这几行去掉,才会正常收集服务stdout输出的日志:

  {{if .Stdout}}

我也遇到相同问题了,但是按照你后面贴的详细流程,还是收不到日志。。。请问这是怎么解决的?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants