Replies: 6 comments
-
@donkeywon 是使用类似kubectl label pod POD_NAME KEY1=VALUE1 这样的方式加的label吗 |
Beta Was this translation helpful? Give feedback.
-
目前由于logtail不与apiserver通信因此获取不到,对于这个功能可能需要额外开发一个取label的插件,并在部署时增加相关权限。 |
Beta Was this translation helpful? Give feedback.
-
@linrunqi08 看operator的代码是get了整个pod信息,然后对label做了些修改再整个put进去 |
Beta Was this translation helpful? Give feedback.
-
@donkeywon 可以参考上面的回复,现在的实现是拿不到apiserver里的信息的。这个可以开发一个插件来针对这个场景,跟apiserver通信,然后把运行时添加的label信息补充上去。我们插件开发还是比较简单的,如果你有兴趣的话,欢迎参与开发 |
Beta Was this translation helpful? Give feedback.
-
@linrunqi08 好的 |
Beta Was this translation helpful? Give feedback.
-
@donkeywon 是否有兴趣参与一下呢?我们会提供支持的。 |
Beta Was this translation helpful? Give feedback.
-
使用ExternalK8sLabelTag功能获取pod的label时,发现有的label可以获取到值,有的label获取到的值是空字符串
获取到空字符串的label是pod运行时通过请求k8s的api动态打的label,可以获取到值的label是pod启动时就有的label
以下是采集配置的input部分
inputs:
- ContainerFile: true
ContainerInfo:
ExternalK8sLabelTag:
xxx: instance_name
xxx: engine
healthy: healthy
role: master_or_slave
IncludeK8sLabel:
xxx: xxx
K8sNamespaceRegex: xxx
FilePattern: xxx.log
LogPath: /xxx/xxx/xxx
Type: file_log
Beta Was this translation helpful? Give feedback.
All reactions