Skip to content

Commit c4df1e5

Browse files
authored
Merge pull request #1750 from kube-logging/fluentbit-max-worker-conn
fluentbit: net.max_worker_connections
2 parents b5032b4 + b93ee65 commit c4df1e5

File tree

11 files changed

+36
-0
lines changed

11 files changed

+36
-0
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
@@ -1653,6 +1653,8 @@ spec:
16531653
keepaliveMaxRecycle:
16541654
format: int32
16551655
type: integer
1656+
maxWorkerConnections:
1657+
type: integer
16561658
sourceAddress:
16571659
type: string
16581660
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
@@ -2670,6 +2670,8 @@ spec:
26702670
keepaliveMaxRecycle:
26712671
format: int32
26722672
type: integer
2673+
maxWorkerConnections:
2674+
type: integer
26732675
sourceAddress:
26742676
type: string
26752677
type: object
@@ -11206,6 +11208,8 @@ spec:
1120611208
keepaliveMaxRecycle:
1120711209
format: int32
1120811210
type: integer
11211+
maxWorkerConnections:
11212+
type: integer
1120911213
sourceAddress:
1121011214
type: string
1121111215
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
@@ -4066,6 +4066,8 @@ spec:
40664066
keepaliveMaxRecycle:
40674067
format: int32
40684068
type: integer
4069+
maxWorkerConnections:
4070+
type: integer
40694071
sourceAddress:
40704072
type: string
40714073
type: object

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1653,6 +1653,8 @@ spec:
16531653
keepaliveMaxRecycle:
16541654
format: int32
16551655
type: integer
1656+
maxWorkerConnections:
1657+
type: integer
16561658
sourceAddress:
16571659
type: string
16581660
type: object

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2670,6 +2670,8 @@ spec:
26702670
keepaliveMaxRecycle:
26712671
format: int32
26722672
type: integer
2673+
maxWorkerConnections:
2674+
type: integer
26732675
sourceAddress:
26742676
type: string
26752677
type: object
@@ -11206,6 +11208,8 @@ spec:
1120611208
keepaliveMaxRecycle:
1120711209
format: int32
1120811210
type: integer
11211+
maxWorkerConnections:
11212+
type: integer
1120911213
sourceAddress:
1121011214
type: string
1121111215
type: object

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4066,6 +4066,8 @@ spec:
40664066
keepaliveMaxRecycle:
40674067
format: int32
40684068
type: integer
4069+
maxWorkerConnections:
4070+
type: integer
40694071
sourceAddress:
40704072
type: string
40714073
type: object

config/samples/syslog-ng-simple.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ metadata:
55
spec:
66
controlNamespace: default
77
fluentbit: {}
8+
# network:
9+
# maxWorkerConnections: 2
10+
# syslogng_output:
11+
# Workers: 5
812
syslogNG:
913
globalOptions:
1014
log_level: trace

docs/configuration/crds/v1beta1/fluentbit_types.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,12 @@ How many times a TCP keepalive connection can be used before being recycled
313313

314314
Default: 0, disabled
315315

316+
### maxWorkerConnections (int, optional) {#fluentbitnetwork-maxworkerconnections}
317+
318+
Set maximum number of TCP connections that can be established per worker.
319+
320+
Default: 0, unlimited
321+
316322
### sourceAddress (string, optional) {#fluentbitnetwork-sourceaddress}
317323

318324
Specify network address (interface) to use for connection and data traffic.

pkg/resources/fluentbit/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ var fluentbitNetworkTemplate = `
185185
{{- if .Network.SourceAddress }}
186186
net.source_address {{ .Network.SourceAddress }}
187187
{{- end }}
188+
{{- if .Network.MaxWorkerConnections }}
189+
net.max_worker_connections {{ .Network.MaxWorkerConnections }}
190+
{{- end }}
188191
{{- end }}
189192
`
190193

pkg/resources/fluentbit/configsecret.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ type FluentbitNetwork struct {
125125
KeepaliveMaxRecycleSet bool
126126
KeepaliveMaxRecycle uint32
127127
SourceAddress string
128+
MaxWorkerConnections int
128129
}
129130

130131
// https://docs.fluentbit.io/manual/pipeline/outputs/tcp-and-tls
@@ -187,6 +188,10 @@ func newFluentbitNetwork(network v1beta1.FluentbitNetwork) (result FluentbitNetw
187188
if network.SourceAddress != "" {
188189
result.SourceAddress = network.SourceAddress
189190
}
191+
192+
if network.MaxWorkerConnections != 0 {
193+
result.MaxWorkerConnections = network.MaxWorkerConnections
194+
}
190195
return
191196
}
192197

0 commit comments

Comments
 (0)