fluent-operator icon indicating copy to clipboard operation
fluent-operator copied to clipboard

bug: can't specify storage.path in the fluentbit config

Open idyakonov-dev opened this issue 2 months ago • 1 comments

Describe the issue

fluentbit can't work with filesystem based cache:

[2025/10/01 12:41:13] [error] [storage] instance 'systemd.0' requested filesystem storage but no filesystem path was defined.
[2025/10/01 12:41:13] [error] [storage] could not create storage for instance: systemd.0
[2025/10/01 12:41:13] [error] [engine] storage creation failed

It needs to specify storage.path: https://docs.fluentbit.io/manual/administration/buffering-and-storage#service-section-configuration

If this parameter isn't set, Input plugins can only use in-memory buffering.

But the source code cannot set this parameter. This option just does not exist:

  • https://github.com/fluent/fluent-operator/blob/master/apis/fluentbit/v1alpha2/plugins/input/tail_types.go#L103
  • https://github.com/fluent/fluent-operator/blob/master/apis/fluentbit/v1alpha2/plugins/input/systemd_types.go#L49

There are only 2 options: storage.type and storage.max_chunks_up.

To Reproduce

apiVersion: fluentbit.fluent.io/v1alpha2
kind: ClusterInput
metadata:
  name: containerd
spec:
  systemd:
    db: /fluent-bit/tail/systemd.db
    dbSync: Normal
    path: /var/log/journal
    storageType: filesystem
    stripUnderscores: "off"
    systemdFilter:
    - _SYSTEMD_UNIT=containerd.service
    - _SYSTEMD_UNIT=kubelet.service
    tag: service.*
---
apiVersion: fluentbit.fluent.io/v1alpha2
kind: ClusterInput
metadata:
  labels:
    fluentbit.fluent.io/component: logging
    fluentbit.fluent.io/enabled: "true"
  name: crio
spec:
  systemd:
    db: /fluent-bit/tail/systemd.db
    dbSync: Normal
    path: /var/log/journal
    storageType: filesystem
    stripUnderscores: "off"
    systemdFilter:
    - _SYSTEMD_UNIT=crio.service
    - _SYSTEMD_UNIT=kubelet.service
    tag: service.*
---
apiVersion: fluentbit.fluent.io/v1alpha2
kind: ClusterInput
metadata:
  labels:
    fluentbit.fluent.io/component: logging
    fluentbit.fluent.io/enabled: "true"
  name: tail
spec:
  tail:
    db: /fluent-bit/tail/pos.db
    dbSync: Normal
    memBufLimit: 100MB
    multilineParser: cri
    parser: cri
    path: /var/log/containers/*.log
    readFromHead: false
    refreshIntervalSeconds: 10
    skipLongLines: true
    storageType: filesystem
    tag: kube.*
---
apiVersion: fluentbit.fluent.io/v1alpha2
kind: FluentBit
metadata:
  name: fluent-bit
  namespace: collectors
spec:
  containerLogRealPath: /var/log/containers
  fluentBitConfigName: fluent-bit-config
  image: ghcr.io/fluent/fluent-operator/fluent-bit:v4.0
  labels:
    app: fluent-bit
  namespaceFluentBitCfgSelector: {}
  positionDB:
    ephemeral:
      volumeClaimTemplate:
        spec:
          resources:
            requests:
              storage: 10Gi
          accessModes:
          - ReadWriteOnce
          volumeMode: Filesystem

Expected behavior

It should be possible to specify the storage.path parameter or/and it should be equal to partition directory by default.

Your Environment

- Fluent Operator version: 3.4.0
- Container Runtime: crio
- Operating system: Bottlerocket OS

How did you install fluent operator?

helm upgrade -i fluentbit fluent/fluent-operator -f values.yaml -n collectors

Additional context

No response

idyakonov-dev avatar Oct 01 '25 12:10 idyakonov-dev

@idyakonov-dev Thanks for the report. Would you be willing to submit a pull request?

joshuabaird avatar Nov 11 '25 16:11 joshuabaird