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

Update of a Lua function is not reflected right away

Open gaeljw opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe.

I'm using FluentBit ClusterFilter with a Lua filter calling a method.

The setup is as follow:

apiVersion: fluentbit.fluent.io/v1alpha2
kind: ClusterFilter
metadata:
  name: lua-filter
  labels:
    fluentbit.fluent.io/enabled: "true"
    fluentbit.fluent.io/mode: "fluentbit-only"
spec:
  match: ...
  filters:
  - lua:
      call: my_function_a
      script:
        key: my_functions.lua
        name: fluent-bit-lua
---
apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    app.kubernetes.io/component: operator
    app.kubernetes.io/name: fluent-bit-lua
  name: fluent-bit-lua
  namespace: fluent
data:
  my_functions.lua: |
    function my_function_a(tag, timestamp, record)
      new_record = record
      -- Do something on new_record
      return 1, timestamp, new_record
    end

If I change the body of my_function_a (and apply the new ConfigMap), then I don't see the changes I made to the function being effective.

If I change the body and rename the function to my_function_b and also updates the ClusterFilter, then I see the changes being effectively taken into account: the new function is called.

Describe the solution you'd like

I don't know if this is related to the traditional issue with ConfigMap not always updated in pods? But I tried a restart of the FluentBit DaemonSet and it didn't help so I guess it's not the explanation.

I don't know if this actually an issue with FluentBit itself?

Or if anything can be done via the Operator?

Ideally, any change in the ConfigMap with Lua script should be reflected without having to rename functions.

Additional context

No response

gaeljw avatar Aug 09 '23 15:08 gaeljw

This issue is being closed due to inactivity. Please re-open if it is still relevant.

joshuabaird avatar Nov 11 '25 15:11 joshuabaird

It is still relevant

gaeljw avatar Nov 11 '25 16:11 gaeljw