Skip to content

Commit 5d2b977

Browse files
authored
Merge pull request #1882 from kube-logging/configurable-pause-backport
feat: make fluentbit pause on chunks overlimit configurable
2 parents 72257f5 + 5af4684 commit 5d2b977

File tree

11 files changed

+37
-9
lines changed

11 files changed

+37
-9
lines changed

charts/logging-operator/crds/logging.banzaicloud.io_fluentbitagents.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,6 +1493,8 @@ spec:
14931493
items:
14941494
type: string
14951495
type: array
1496+
storage.pause_on_chunks_overlimit:
1497+
type: string
14961498
storage.type:
14971499
type: string
14981500
type: object

charts/logging-operator/crds/logging.banzaicloud.io_loggings.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2540,6 +2540,8 @@ spec:
25402540
items:
25412541
type: string
25422542
type: array
2543+
storage.pause_on_chunks_overlimit:
2544+
type: string
25432545
storage.type:
25442546
type: string
25452547
type: object
@@ -11960,6 +11962,8 @@ spec:
1196011962
items:
1196111963
type: string
1196211964
type: array
11965+
storage.pause_on_chunks_overlimit:
11966+
type: string
1196311967
storage.type:
1196411968
type: string
1196511969
type: object

charts/logging-operator/crds/logging.banzaicloud.io_nodeagents.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4055,6 +4055,8 @@ spec:
40554055
items:
40564056
type: string
40574057
type: array
4058+
storage.pause_on_chunks_overlimit:
4059+
type: string
40584060
storage.type:
40594061
type: string
40604062
type: object

config/crd/bases/logging.banzaicloud.io_fluentbitagents.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,6 +1493,8 @@ spec:
14931493
items:
14941494
type: string
14951495
type: array
1496+
storage.pause_on_chunks_overlimit:
1497+
type: string
14961498
storage.type:
14971499
type: string
14981500
type: object

config/crd/bases/logging.banzaicloud.io_loggings.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2540,6 +2540,8 @@ spec:
25402540
items:
25412541
type: string
25422542
type: array
2543+
storage.pause_on_chunks_overlimit:
2544+
type: string
25432545
storage.type:
25442546
type: string
25452547
type: object
@@ -11960,6 +11962,8 @@ spec:
1196011962
items:
1196111963
type: string
1196211964
type: array
11965+
storage.pause_on_chunks_overlimit:
11966+
type: string
1196311967
storage.type:
1196411968
type: string
1196511969
type: object

config/crd/bases/logging.banzaicloud.io_nodeagents.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4055,6 +4055,8 @@ spec:
40554055
items:
40564056
type: string
40574057
type: array
4058+
storage.pause_on_chunks_overlimit:
4059+
type: string
40584060
storage.type:
40594061
type: string
40604062
type: object

docs/configuration/crds/v1beta1/fluentbit_types.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,12 @@ When a monitored file reach it buffer capacity due to a very long line (Buffer_M
554554

555555
Default: Off
556556

557+
### storage.pause_on_chunks_overlimit (string, optional) {#inputtail-storage.pause_on_chunks_overlimit}
558+
559+
Specifies whether to pause or drop data when the buffer is full. This helps to make sure we apply backpressure on the input if enabled, see https://docs.fluentbit.io/manual/administration/backpressure
560+
561+
Default: on
562+
557563
### storage.type (string, optional) {#inputtail-storage.type}
558564

559565
Specify the buffering mechanism to use. It can be memory or filesystem.

pkg/resources/fluentbit/tenants.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ func (r *Reconciler) configureInputsForTenants(tenants []v1beta1.Tenant, input *
138138

139139
tenantValues["DB"] = fmt.Sprintf("/tail-db/tail-containers-state-%s.db", t.Name)
140140
tenantValues["Tag"] = fmt.Sprintf("kubernetes.%s.*", hashFromTenantName(t.Name))
141-
// This helps to make sure we apply backpressure on the input, see https://docs.fluentbit.io/manual/administration/backpressure
142-
tenantValues["storage.pause_on_chunks_overlimit"] = "on"
143141
input.Inputs = append(input.Inputs, fluentbitInputConfigWithTenant{
144142
Tenant: t.Name,
145143
Values: tenantValues,

pkg/resources/nodeagent/nodeagent.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,13 @@ func NodeAgentFluentbitDefaults(userDefined v1beta1.NodeAgentConfig) (*v1beta1.N
8585
LogLevel: "info",
8686
CoroStackSize: 24576,
8787
InputTail: v1beta1.InputTail{
88-
Path: "/var/log/containers/*.log",
89-
RefreshInterval: "5",
90-
SkipLongLines: "On",
91-
DB: util.StringPointer("/tail-db/tail-containers-state.db"),
92-
MemBufLimit: "5MB",
93-
Tag: "kubernetes.*",
88+
Path: "/var/log/containers/*.log",
89+
RefreshInterval: "5",
90+
SkipLongLines: "On",
91+
DB: util.StringPointer("/tail-db/tail-containers-state.db"),
92+
MemBufLimit: "5MB",
93+
Tag: "kubernetes.*",
94+
StoragePauseOnChunksOverlimit: "on",
9495
},
9596
Security: &v1beta1.Security{
9697
RoleBasedAccessControlCreate: util.BoolPointer(true),
@@ -208,7 +209,8 @@ var NodeAgentFluentbitWindowsDefaults = &v1beta1.NodeAgentConfig{
208209
KubeTagPrefix: "kubernetes.C.var.log.containers.",
209210
},
210211
InputTail: v1beta1.InputTail{
211-
Path: "C:\\var\\log\\containers\\*.log",
212+
Path: "C:\\var\\log\\containers\\*.log",
213+
StoragePauseOnChunksOverlimit: "on",
212214
},
213215
ContainersPath: "C:\\ProgramData\\docker",
214216
VarLogsPath: "C:\\var\\log",

pkg/sdk/logging/api/v1beta1/fluentbit_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,9 @@ type InputTail struct {
286286
DockerModeFlush string `json:"Docker_Mode_Flush,omitempty"`
287287
// Specify one or multiple parser definitions to apply to the content. Part of the new Multiline Core support in 1.8 (default: "")
288288
MultilineParser []string `json:"multiline.parser,omitempty"`
289+
// Specifies whether to pause or drop data when the buffer is full. (default:on)
290+
// This helps to make sure we apply backpressure on the input if enabled, see https://docs.fluentbit.io/manual/administration/backpressure
291+
StoragePauseOnChunksOverlimit string `json:"storage.pause_on_chunks_overlimit,omitempty"`
289292
}
290293

291294
// FilterKubernetes Fluent Bit Kubernetes Filter allows to enrich your log files with Kubernetes metadata.

0 commit comments

Comments
 (0)