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

[BUG]: 无法通过指定 label 收集 pod 容器中控制台日志 #1450

Open
cyshallchan opened this issue Apr 12, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@cyshallchan
Copy link
Contributor

我看了下你们是如何通过采集配置文件中的IncludeK8sLabel字段找到与之匹配的容器的具体实现,发现是先通过容器的详细信息(通过docker inspect [container-id]获取)中的Labels字段中的io.kubernetes.pod.namespaceio.kubernetes.pod.name字段找到与业务容器在同一个 pod 的 pause 容器,然后通过 pause 容器的详细信息中的Labels字段来确定目标容器信息的,但是我现在发现一个问题:并不是所有 pod 的 label 都会出现在对应的 pause 容器中的,因此对应容器的日志也就无法采集,请看下面:

采集配置文件:
image

待采集日志的 pod 的信息:
image

首先根据 pod 的名字到对应宿主机上找到相关容器:
image

接着检查 pause 容器中的 Labels信息:
image

可以看到clickhouse.radondb.com/app: chopclickhouse.radondb.com/chop: dev-version这两个 pod 中的 labels 并没有出现在 pause 容器中,同样也没有出现在对应的业务容器中:
image

我也在使用了containerd运行时的k8s集群中尝试了一遍,同样的应用,对应的 pause 容器中也没有clickhouse.radondb.com/app: chopclickhouse.radondb.com/chop: dev-version这两个 labels,同样业务容器中也没有。

iLogtail版本:v1.8.4
k8s版本:v1.21.14
宿主机系统版本:
image

@cyshallchan cyshallchan added the bug Something isn't working label Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant