fluent / fluent/fluent-operator

Update of a Lua function is not reflected right away

Open
#870 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
682
Forks
328
Avg merge
2d 23h
Merged PRs (30d)
13

Description

### 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:
```yaml
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_

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the ClusterFilter references the ConfigMap and how the Fluent Bit DaemonSet receives the Lua script. Reproduce the change to my_function_a, then compare it with renaming the function to my_function_b. Done means an updated ConfigMap takes effect without renaming the Lua function.

Written by the indexing model from the issue text.

Assessment

Tech stack
kubernetes, lua
Domain
devops, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.