Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions apis/fluentbit/v1alpha2/clusterfluentbitconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ type Service struct {
SchedulerBase *int32 `json:"schedulerBase,omitempty"`
// Set a maximum retry time in seconds for the scheduler. Supported in Fluent Bit >= 1.8.7
SchedulerCap *int32 `json:"schedulerCap,omitempty"`
// Set a default buffer size limit for multiline parsers. The value must be according to the Unit Size specification.
// +kubebuilder:validation:Pattern:="^\\d+(k|K|KB|kb|m|M|MB|mb|g|G|GB|gb)?$"
MultilineBufferLimit string `json:"multilineBufferLimit,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down Expand Up @@ -243,6 +246,9 @@ func (s *Service) Params() *params.KVs {
if s.SchedulerCap != nil {
m.Insert("scheduler.cap", fmt.Sprint(*s.SchedulerCap))
}
if s.MultilineBufferLimit != "" {
m.Insert("multiline_buffer_limit", s.MultilineBufferLimit)
}
return m
}

Expand Down
41 changes: 41 additions & 0 deletions apis/fluentbit/v1alpha2/clusterfluentbitconfig_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,47 @@ func TestRenderMainConfigK8sInYaml(t *testing.T) {
g.Expect(yamlConfig).To(Equal(expectedK8sYamlWithClusterFilterOutput))
}

func TestClusterFluentBitConfig_Service_MultilineBufferLimit(t *testing.T) {
g := NewGomegaWithT(t)
sl := plugins.NewSecretLoader(nil, "testnamespace")

cfbc := ClusterFluentBitConfig{
Spec: FluentBitConfigSpec{
Service: &Service{
Daemon: utils.ToPtr(false),
FlushSeconds: utils.ToPtr[float64](1),
MultilineBufferLimit: "5MB",
},
},
}

expectedClassic := `[Service]
Daemon false
Flush 1
multiline_buffer_limit 5MB
`
expectedYamlFmt := `service:
daemon: false
flush: 1
multiline_buffer_limit: 5MB
pipeline:
inputs:
outputs:
`

config, err := cfbc.RenderMainConfig(
sl, ClusterInputList{}, ClusterFilterList{}, ClusterOutputList{}, nil, nil, nil,
)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(config).To(Equal(expectedClassic))

yamlConfig, err := cfbc.RenderMainConfigInYaml(
sl, ClusterInputList{}, ClusterFilterList{}, ClusterOutputList{}, nil, nil, nil,
)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(yamlConfig).To(Equal(expectedYamlFmt))
}

func TestClusterFluentBitConfig_RenderMainConfig_WithParsersFiles(t *testing.T) {
g := NewGomegaWithT(t)
sl := plugins.NewSecretLoader(nil, "testnamespace")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,11 @@ spec:
- debug
- trace
type: string
multilineBufferLimit:
description: Set a default buffer size limit for multiline parsers.
The value must be according to the Unit Size specification.
pattern: ^\d+(k|K|KB|kb|m|M|MB|mb|g|G|GB|gb)?$
type: string
parsersFile:
description: Optional 'parsers' config file (can be multiple)
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,11 @@ spec:
- debug
- trace
type: string
multilineBufferLimit:
description: Set a default buffer size limit for multiline parsers.
The value must be according to the Unit Size specification.
pattern: ^\d+(k|K|KB|kb|m|M|MB|mb|g|G|GB|gb)?$
type: string
parsersFile:
description: Optional 'parsers' config file (can be multiple)
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,11 @@ spec:
- debug
- trace
type: string
multilineBufferLimit:
description: Set a default buffer size limit for multiline parsers.
The value must be according to the Unit Size specification.
pattern: ^\d+(k|K|KB|kb|m|M|MB|mb|g|G|GB|gb)?$
type: string
parsersFile:
description: Optional 'parsers' config file (can be multiple)
type: string
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_fluentbitconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,11 @@ spec:
- debug
- trace
type: string
multilineBufferLimit:
description: Set a default buffer size limit for multiline parsers.
The value must be according to the Unit Size specification.
pattern: ^\d+(k|K|KB|kb|m|M|MB|mb|g|G|GB|gb)?$
type: string
parsersFile:
description: Optional 'parsers' config file (can be multiple)
type: string
Expand Down
1 change: 1 addition & 0 deletions docs/fluentbit.md
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,7 @@ ParserSpec defines the desired state of ClusterParser
| hotReload | If true enable reloading via HTTP | *bool |
| schedulerBase | Set a base for exponential backoff in the scheduler. Supported in Fluent Bit >= 1.8.7 | *int32 |
| schedulerCap | Set a maximum retry time in seconds for the scheduler. Supported in Fluent Bit >= 1.8.7 | *int32 |
| multilineBufferLimit | Set a default buffer size limit for multiline parsers. The value must be according to the Unit Size specification. | string |

[Back to TOC](#table-of-contents)
# Storage
Expand Down
10 changes: 10 additions & 0 deletions manifests/setup/fluent-operator-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1830,6 +1830,11 @@ spec:
- debug
- trace
type: string
multilineBufferLimit:
description: Set a default buffer size limit for multiline parsers.
The value must be according to the Unit Size specification.
pattern: ^\d+(k|K|KB|kb|m|M|MB|mb|g|G|GB|gb)?$
type: string
parsersFile:
description: Optional 'parsers' config file (can be multiple)
type: string
Expand Down Expand Up @@ -17082,6 +17087,11 @@ spec:
- debug
- trace
type: string
multilineBufferLimit:
description: Set a default buffer size limit for multiline parsers.
The value must be according to the Unit Size specification.
pattern: ^\d+(k|K|KB|kb|m|M|MB|mb|g|G|GB|gb)?$
type: string
parsersFile:
description: Optional 'parsers' config file (can be multiple)
type: string
Expand Down
10 changes: 10 additions & 0 deletions manifests/setup/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1830,6 +1830,11 @@ spec:
- debug
- trace
type: string
multilineBufferLimit:
description: Set a default buffer size limit for multiline parsers.
The value must be according to the Unit Size specification.
pattern: ^\d+(k|K|KB|kb|m|M|MB|mb|g|G|GB|gb)?$
type: string
parsersFile:
description: Optional 'parsers' config file (can be multiple)
type: string
Expand Down Expand Up @@ -17082,6 +17087,11 @@ spec:
- debug
- trace
type: string
multilineBufferLimit:
description: Set a default buffer size limit for multiline parsers.
The value must be according to the Unit Size specification.
pattern: ^\d+(k|K|KB|kb|m|M|MB|mb|g|G|GB|gb)?$
type: string
parsersFile:
description: Optional 'parsers' config file (can be multiple)
type: string
Expand Down
Loading