Rewrite_tag not working as expected when we used Namespaced Custom Resource Definitions

オープン
#1,211 コメント 11 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
helm, kubernetes

調査の方向性

まず、示されている ClusterInput、namespaced な FluentBitConfig、Output を使って Helm デプロイメントを再現し、その後 fluent-bit-config Secret と rewrite_tag emitter のルーティングを調べます。app-1 のレコードが "without routes, dropping" エラーなしでルーティングされれば完了です。レポートではソースファイルやテストを名前で示しません。

索引モデルが issue の本文から書いたものです。

説明

Describe the issue

I have been diligently following the documentation to establish Namespaced Custom Resource Definitions (CRDs) within our environment. However, during the setup process, I encountered an error message that reads:

"Created task=0x7f86a808f6a0 id=0 without routes, dropping."

This error suggests that Fluent Bit, the logging aggregator we're using, encountered a task without a defined route for processing. Despite following the setup instructions provided in the documentation, I'm uncertain about the root cause of this issue.

Context:

  • Fluent Operator is deployed via Helm. Fluent Bit is integrated as our logging aggregator and configured using the following namespace label:
namespaceFluentBitCfgSelector:
  matchLabels:
    onboardedFluentbit: "true"

ClusterInput looks like

apiVersion: fluentbit.fluent.io/v1alpha2
 kind: ClusterInput
metadata:
  name: test
   labels:
    fluentbit.fluent.io/enabled: "true"
    fluentbit.fluent.io/component: logging
spec:
  tail:
     tag: kube.var.log.container.test
     path: "/var/log/containers/*.log"
     excludePath: ""
     parser: cri
     refreshIntervalSeconds: 10
     memBufLimit: 100MB
     skipLongLines: true
     db: /fluent-bit/tail/pos.db
     dbSync: Normal

Fluentbit config for namespace app-1 looks like

apiVersion: fluentbit.fluent.io/v1alpha2
kind: FluentBitConfig
metadata:
  name: test
  namespace: app-1
   labels:
     onboardedFluentbit: "true"
spec:
   outputSelector:
     matchLabels:
       fluentbit.fluent.io/enabled: "true"
       app.kubernetes.io/name: "test"

output Crds looks like

apiVersion: fluentbit.fluent.io/v1alpha2
kind: Output
metadata:
  name: stdout
  namespace: app-1
  labels:
      fluentbit.fluent.io/enabled: "true"
      app.kubernetes.io/name: "test"
spec:
  match: kube.var.log.container.test
  stdout:
    format: msgpack

config which is stored in secret named fluent-bit-config looks like

[Service]
    Http_Server    true
    Parsers_File    parsers.conf
[Input]
    Name    tail
    Path    /var/log/containers/*.log
    Refresh_Interval    10
    Skip_Long_Lines    true
    DB    /fluent-bit/tail/pos.db
    DB.Sync    Normal
    Mem_Buf_Limit    100MB
    Parser    cri
    Tag    kube.var.log.container.test
[Filter]
    Name    kubernetes
    Match    kube.*
    Kube_URL    https://kubernetes.default.svc:443
    Kube_CA_File    /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
    Kube_Token_File    /var/run/secrets/kubernetes.io/serviceaccount/token
    Labels    false
    Annotations    false
[Filter]
    Name    nest
    Match    kube.*
    Operation    lift
    Nested_under    kubernetes
    Add_prefix    kubernetes_
[Filter]
    Name    modify
    Match    kube.*
    Remove    stream
    Remove    kubernetes_pod_id
    Remove    kubernetes_host
    Remove    kubernetes_container_hash
[Filter]
    Name    nest
    Match    kube.*
    Operation    nest
    Wildcard    kubernetes_*
    Nest_under    kubernetes
    Remove_prefix    kubernetes_
[Filter]
    Name    rewrite_tag
    Match    kube.*
    Rule    $kubernetes['namespace_name'] ^(app-1)$ 5d24f63865268abd3e56d1e2b430162a.$TAG false
    Emitter_Name    re_emitted_5d24f63865268abd3e56d1e2b430162a
[Output]
    Name    stdout
    Match    5d24f63865268abd3e56d1e2b430162a.kube.var.log.container.test
    Format    msgpack

It got to do with rewrite_tag which is added after having namespaced crs.
it's probably not able to tell the dynamic matching works

Thanks

How did you install fluent operator?

Fluent Operator is deployed via Helm

Additional context

No response

主要言語
Go
スター
689
フォーク
333
平均マージ
2日 6時間
マージ済み PR(30日)
43

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

fluent/fluent-operator のほかの issue

fluent/fluent-operator の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。