Skip to content

Commit

Permalink
cleanup: set fluentbit buffer size to 0 using the plugin defaults, av…
Browse files Browse the repository at this point in the history
…oid showing a warning

Signed-off-by: Peter Wilcsinszky <[email protected]>
  • Loading branch information
pepov committed Jul 16, 2024
1 parent 34e0338 commit 5672c84
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs/configuration/crds/v1beta1/fluentbit_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -577,9 +577,9 @@ Default: On

### Buffer_Size (string, optional) {#filterkubernetes-buffer_size}

Set the buffer size for HTTP client when reading responses from Kubernetes API server. The value must be according to the Unit Size specification. A value of 0 results in no limit, and the buffer will expand as-needed. Note that if pod specifications exceed the buffer limit, the API response will be discarded when retrieving metadata, and some kubernetes metadata will fail to be injected to the logs. If this value is empty we will set it "0".
Set the buffer size for HTTP client when reading responses from Kubernetes API server. The value must be according to the Unit Size specification. A value of 0 results in no limit, and the buffer will expand as-needed. Note that if pod specifications exceed the buffer limit, the API response will be discarded when retrieving metadata, and some kubernetes metadata will fail to be injected to the logs. If this value is empty we will set it "0". (default:"0")

Default: "0"
Default: 0

### Cache_Use_Docker_Id (string, optional) {#filterkubernetes-cache_use_docker_id}

Expand Down
6 changes: 0 additions & 6 deletions pkg/resources/fluentbit/configsecret.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,6 @@ func (r *Reconciler) configSecret() (runtime.Object, reconciler.DesiredState, er
disableKubernetesFilter := r.fluentbitSpec.DisableKubernetesFilter != nil && *r.fluentbitSpec.DisableKubernetesFilter

if !disableKubernetesFilter {
if r.fluentbitSpec.FilterKubernetes.BufferSize == "" {
r.logger.Info("Notice: If the Buffer_Size value is empty we will set it 0. For more information: https://github.com/fluent/fluent-bit/issues/2111")
r.fluentbitSpec.FilterKubernetes.BufferSize = "0"
} else if r.fluentbitSpec.FilterKubernetes.BufferSize != "0" {
r.logger.Info("Notice: If the kubernetes filter buffer_size parameter is underestimated it can cause log loss. For more information: https://github.com/fluent/fluent-bit/issues/2111")
}
if r.fluentbitSpec.FilterKubernetes.K8SLoggingExclude == "" {
r.fluentbitSpec.FilterKubernetes.K8SLoggingExclude = "On"
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/logging/api/v1beta1/fluentbit_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ type FilterKubernetes struct {
// Match filtered records (default:kube.*)
Match string `json:"Match,omitempty" plugin:"default:kubernetes.*"`
// Set the buffer size for HTTP client when reading responses from Kubernetes API server. The value must be according to the Unit Size specification. A value of 0 results in no limit, and the buffer will expand as-needed. Note that if pod specifications exceed the buffer limit, the API response will be discarded when retrieving metadata, and some kubernetes metadata will fail to be injected to the logs. If this value is empty we will set it "0". (default:"0")
BufferSize string `json:"Buffer_Size,omitempty"`
BufferSize string `json:"Buffer_Size,omitempty" plugin:"default:0"`
// API Server end-point.
KubeURL string `json:"Kube_URL,omitempty" plugin:"default:https://kubernetes.default.svc:443"`
// CA certificate file (default:/var/run/secrets/kubernetes.io/serviceaccount/ca.crt)
Expand Down

0 comments on commit 5672c84

Please sign in to comment.