如何从流利的日志记录中排除名称空间 [英] How to exclude namespace from fluent-bit logging

查看:97
本文介绍了如何从流利的日志记录中排除名称空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以排除某些特定的名称空间?我想排除某些命名空间,以使流利的位不会将在这些命名空间中创建的所有日志转发给ELK.

Is there a way to exclude certain namespaces in fluet-bit? I would like to exclude certain namespaces so that fluent bit doesn't forward all logs created in those namespaces to ELK.

除了将注释添加到该命名空间中的每个pod之外,还有其他方法吗?我知道您可以通过kubectl更新名称空间中的所有pod注释.

Is there a way to do it besides adding annotation to each pod in that namespace? Im aware that you can update all of the pods annotations in a namespace via kubectl.

kubectl注释pods --namespace = pks-system --all fluentbit.io/exclude='true'

kubectl annotate pods --namespace=pks-system --all fluentbit.io/exclude='true'

推荐答案

根据官方Fluent Bit文档,目前,它实际上是请求日志处理器跳过某些Pod日志的唯一方法.我对其进行了搜索,只发现了片段

According to official Fluent Bit documentation, for the moment it is actually the unique way of requesting that the log processor skips the logs from certain Pods. I searched through it and found nothing but this fragment.

除此之外,甚至还提出了功能请求他们的GitHub项目,所以现在我们希望它会在将来的版本中提供.

In addition to that, there is even a feature request raised on their GitHub project so for now we can hope it will be available in a future release.

文档中,只有以下示例一个separate Pod definition,但可以肯定的是您应该能够将其应用于Deployment定义中的Pod template,因此您不必使用提供的kubectl命令将其分别应用于每个Pod或特定命名空间中的每个Pod.

In documentation there is only example of a separate Pod definition but for sure you should be able to apply it to Pod template in Deployment definition so you don't have to apply it to each Pod separately or to every Pod in certain namespace using the kubectl command you provided.

这篇关于如何从流利的日志记录中排除名称空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆