Skip to content

Commit

Permalink
Merge pull request #1753 from kube-logging/release-4.6
Browse files Browse the repository at this point in the history
Release 4.6 back to master
  • Loading branch information
pepov authored Jun 3, 2024
2 parents e8d7192 + c4df1e5 commit ace8f63
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1739,6 +1739,8 @@ spec:
keepaliveMaxRecycle:
format: int32
type: integer
maxWorkerConnections:
type: integer
sourceAddress:
type: string
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2784,6 +2784,8 @@ spec:
keepaliveMaxRecycle:
format: int32
type: integer
maxWorkerConnections:
type: integer
sourceAddress:
type: string
type: object
Expand Down Expand Up @@ -11863,6 +11865,8 @@ spec:
keepaliveMaxRecycle:
format: int32
type: integer
maxWorkerConnections:
type: integer
sourceAddress:
type: string
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4335,6 +4335,8 @@ spec:
keepaliveMaxRecycle:
format: int32
type: integer
maxWorkerConnections:
type: integer
sourceAddress:
type: string
type: object
Expand Down
2 changes: 2 additions & 0 deletions config/crd/bases/logging.banzaicloud.io_fluentbitagents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1739,6 +1739,8 @@ spec:
keepaliveMaxRecycle:
format: int32
type: integer
maxWorkerConnections:
type: integer
sourceAddress:
type: string
type: object
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/logging.banzaicloud.io_loggings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2784,6 +2784,8 @@ spec:
keepaliveMaxRecycle:
format: int32
type: integer
maxWorkerConnections:
type: integer
sourceAddress:
type: string
type: object
Expand Down Expand Up @@ -11863,6 +11865,8 @@ spec:
keepaliveMaxRecycle:
format: int32
type: integer
maxWorkerConnections:
type: integer
sourceAddress:
type: string
type: object
Expand Down
2 changes: 2 additions & 0 deletions config/crd/bases/logging.banzaicloud.io_nodeagents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4335,6 +4335,8 @@ spec:
keepaliveMaxRecycle:
format: int32
type: integer
maxWorkerConnections:
type: integer
sourceAddress:
type: string
type: object
Expand Down
4 changes: 4 additions & 0 deletions config/samples/syslog-ng-simple.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ metadata:
spec:
controlNamespace: default
fluentbit: {}
# network:
# maxWorkerConnections: 2
# syslogng_output:
# Workers: 5
syslogNG:
globalOptions:
log_level: trace
Expand Down
6 changes: 6 additions & 0 deletions docs/configuration/crds/v1beta1/fluentbit_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,12 @@ How many times a TCP keepalive connection can be used before being recycled

Default: 0, disabled

### maxWorkerConnections (int, optional) {#fluentbitnetwork-maxworkerconnections}

Set maximum number of TCP connections that can be established per worker.

Default: 0, unlimited

### sourceAddress (string, optional) {#fluentbitnetwork-sourceaddress}

Specify network address (interface) to use for connection and data traffic.
Expand Down
3 changes: 3 additions & 0 deletions pkg/resources/fluentbit/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ var fluentbitNetworkTemplate = `
{{- if .Network.SourceAddress }}
net.source_address {{ .Network.SourceAddress }}
{{- end }}
{{- if .Network.MaxWorkerConnections }}
net.max_worker_connections {{ .Network.MaxWorkerConnections }}
{{- end }}
{{- end }}
`

Expand Down
5 changes: 5 additions & 0 deletions pkg/resources/fluentbit/configsecret.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ type FluentbitNetwork struct {
KeepaliveMaxRecycleSet bool
KeepaliveMaxRecycle uint32
SourceAddress string
MaxWorkerConnections int
}

// https://docs.fluentbit.io/manual/pipeline/outputs/tcp-and-tls
Expand Down Expand Up @@ -187,6 +188,10 @@ func newFluentbitNetwork(network v1beta1.FluentbitNetwork) (result FluentbitNetw
if network.SourceAddress != "" {
result.SourceAddress = network.SourceAddress
}

if network.MaxWorkerConnections != 0 {
result.MaxWorkerConnections = network.MaxWorkerConnections
}
return
}

Expand Down
2 changes: 2 additions & 0 deletions pkg/sdk/logging/api/v1beta1/fluentbit_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ type FluentbitNetwork struct {
KeepaliveMaxRecycle *uint32 `json:"keepaliveMaxRecycle,omitempty"`
// Specify network address (interface) to use for connection and data traffic. (default: disabled)
SourceAddress string `json:"sourceAddress,omitempty"`
// Set maximum number of TCP connections that can be established per worker. (default: 0, unlimited)
MaxWorkerConnections int `json:"maxWorkerConnections,omitempty"`
}

// GetPrometheusPortFromAnnotation gets the port value from annotation
Expand Down

0 comments on commit ace8f63

Please sign in to comment.