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
3 changes: 3 additions & 0 deletions .github/actions/spelling/patterns.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ https?://\S+
# Version strings
v\d+\.\d+(\.\d+)?

# AsciiDoc source/listing blocks (---- delimited)
(?s)^----$.*?^----$

# AsciiDoc directives and macros
^include::.*$
^ifdef::.*$
Expand Down
7 changes: 7 additions & 0 deletions docs/features/raise_fd_limit.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
== Vector Collector: Raising File Descriptor Limits

The operator always sets `VECTOR_RAISE_FD_LIMIT=true` on the collector container so Vector raises its file descriptor soft limit to the hard limit at startup. This prevents "Too many open files" errors when Vector monitors a large number of log files concurrently.

Systems often default to restrictive file descriptor soft limits (e.g. 1024 on Linux), which can cause Vector to fail when processing many log sources simultaneously. Vector reads `VECTOR_RAISE_FD_LIMIT` natively and raises the soft limit without requiring manual sysadmin intervention. The hard limit remains the safety ceiling set by the OS/container runtime.

This behavior is not configurable. A collector tuning option may be added in the future if needed.
Comment thread
coderabbitai[bot] marked this conversation as resolved.
5 changes: 5 additions & 0 deletions docs/reference/operator/api_observability_v1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Type:: object
|networkPolicy|object| Define the Network Policy for the Collector
|nodeSelector|object| Define nodes for scheduling the pods.
|resources|object| The resource requirements for the collector
|terminationGracePeriodSeconds|int| TerminationGracePeriodSeconds defines the termination grace period for collector pods in seconds. If not specified, the default is 10 seconds.
Comment thread
vparfonov marked this conversation as resolved.
|tolerations|array| Define the tolerations the collector pods will accept
|======================

Expand Down Expand Up @@ -651,6 +652,10 @@ Type:: object

Type:: object

=== .spec.collector.terminationGracePeriodSeconds

Type:: int

=== .spec.collector.tolerations[]

Type:: array
Expand Down
1 change: 1 addition & 0 deletions internal/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ func (f *Factory) NewCollectorContainer(inputs internalobs.Inputs, outputs inter
{Name: "OPENSHIFT_CLUSTER_ID", Value: clusterID},
{Name: "POD_IP", ValueFrom: &v1.EnvVarSource{FieldRef: &v1.ObjectFieldSelector{APIVersion: "v1", FieldPath: "status.podIP"}}},
{Name: "POD_IPS", ValueFrom: &v1.EnvVarSource{FieldRef: &v1.ObjectFieldSelector{APIVersion: "v1", FieldPath: "status.podIPs"}}},
{Name: "VECTOR_RAISE_FD_LIMIT", Value: "true"},
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}
collector.Env = append(collector.Env, utils.GetProxyEnvVars()...)

Expand Down
4 changes: 4 additions & 0 deletions internal/collector/collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ var _ = Describe("Factory#Daemonset", func() {
Expect(collector.Env).To(IncludeEnvVar(v1.EnvVar{Name: "VECTOR_LOG", Value: logLevelDebug}))
})

It("should set VECTOR_RAISE_FD_LIMIT to true", func() {
Expect(collector.Env).To(IncludeEnvVar(v1.EnvVar{Name: "VECTOR_RAISE_FD_LIMIT", Value: "true"}))
})

Context("the volume mounts", func() {
It("should mount all output configmaps", func() {
Expect(collector.VolumeMounts).To(IncludeVolumeMount(
Expand Down
1 change: 1 addition & 0 deletions test/framework/functional/vector/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func (c *VectorCollector) DeployConfigMapForConfig(name, config, clfName, clfYam

func (c *VectorCollector) BuildCollectorContainer(b *runtime.ContainerBuilder, nodeName string) *runtime.ContainerBuilder {
return b.AddEnvVar("VECTOR_LOG", common.AdaptLogLevel()).
AddEnvVar("VECTOR_RAISE_FD_LIMIT", "true").
AddEnvVarFromFieldRef("POD_IP", "status.podIP").
AddEnvVar("NODE_NAME", nodeName).
AddEnvVar("VECTOR_INTERNAL_LOG_RATE_LIMIT", "0").
Expand Down
2 changes: 1 addition & 1 deletion test/functional/misc/disk_buffer_corruption_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func corruptBufferFile(framework *functional.CollectorFunctionalFramework, datFi

const chunkSize = 65536
for i := 0; i < len(corruptedB64); i += chunkSize {
end := min(i + chunkSize, len(corruptedB64))
end := min(i+chunkSize, len(corruptedB64))
chunk := corruptedB64[i:end]
appendCmd := fmt.Sprintf("echo -n '%s' >> '%s'", chunk, stagingFile)
_, err = framework.RunCommand(functional.ToolsContainerName, "bash", "-c", appendCmd)
Expand Down
34 changes: 34 additions & 0 deletions test/functional/misc/raise_fd_limit_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package misc

import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
obs "github.com/openshift/cluster-logging-operator/api/observability/v1"
"github.com/openshift/cluster-logging-operator/internal/constants"
"github.com/openshift/cluster-logging-operator/test/framework/functional"
testruntime "github.com/openshift/cluster-logging-operator/test/runtime/observability"
)

var _ = Describe("[Functional][Misc][RaiseFdLimit] Vector raise-fd-limit", func() {

var framework *functional.CollectorFunctionalFramework

BeforeEach(func() {
framework = functional.NewCollectorFunctionalFramework()
testruntime.NewClusterLogForwarderBuilder(framework.Forwarder).
FromInput(obs.InputTypeInfrastructure).
ToHttpOutput()
})

AfterEach(func() {
framework.Cleanup()
})

It("should start with VECTOR_RAISE_FD_LIMIT=true", func() {
Expect(framework.Deploy()).To(BeNil())

out, err := framework.RunCommand(constants.CollectorName, "sh", "-c", "echo $VECTOR_RAISE_FD_LIMIT")
Expect(err).To(BeNil())
Expect(out).To(ContainSubstring("true"))
})
})
2 changes: 1 addition & 1 deletion test/helpers/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ type OpenshiftMeta struct {
//+optional
Labels map[string]string `json:"labels,omitempty"`

//Sequence is increasing id used in conjunction with the timestamp to estblish a linear timeline
//Sequence is increasing id used in conjunction with the timestamp to establish a linear timeline
//of log records. This was added as a workaround for logstores that do not have nano-second precision.
Sequence OptionalInt `json:"sequence,omitempty"`
}
Expand Down
Loading