Ensure node e2e apiserver and test suite can open enough files

The apiserver and test suite in node e2e runs under the sshd daemon
that can limit the amount of files it can open. Set a higher limit
to address the issues.

Signed-off-by: Odin Ugedal <odin@uged.al>
This commit is contained in:
Odin Ugedal 2021-05-20 11:22:51 +02:00
parent c9fb3c8a1b
commit 1c8675fc02
No known key found for this signature in database
GPG Key ID: AFF9C8242CF7A7AF

View File

@ -40,6 +40,7 @@ import (
utilyaml "k8s.io/apimachinery/pkg/util/yaml" utilyaml "k8s.io/apimachinery/pkg/util/yaml"
clientset "k8s.io/client-go/kubernetes" clientset "k8s.io/client-go/kubernetes"
cliflag "k8s.io/component-base/cli/flag" cliflag "k8s.io/component-base/cli/flag"
"k8s.io/kubernetes/pkg/util/rlimit"
commontest "k8s.io/kubernetes/test/e2e/common" commontest "k8s.io/kubernetes/test/e2e/common"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
e2econfig "k8s.io/kubernetes/test/e2e/framework/config" e2econfig "k8s.io/kubernetes/test/e2e/framework/config"
@ -123,6 +124,12 @@ func TestMain(m *testing.M) {
const rootfs = "/rootfs" const rootfs = "/rootfs"
func TestE2eNode(t *testing.T) { func TestE2eNode(t *testing.T) {
// Make sure we are not limited by sshd when it comes to open files
if err := rlimit.SetNumFiles(1000000); err != nil {
klog.Infof("failed to set rlimit on max file handles: %v", err)
}
if *runServicesMode { if *runServicesMode {
// If run-services-mode is specified, only run services in current process. // If run-services-mode is specified, only run services in current process.
services.RunE2EServices(t) services.RunE2EServices(t)