mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
flag controlled RLIMIT_NOFILE for kubelet.
This commit is contained in:
@@ -20,6 +20,7 @@ package util
|
||||
|
||||
import (
|
||||
"os"
|
||||
"syscall"
|
||||
|
||||
"github.com/docker/libcontainer/cgroups/fs"
|
||||
"github.com/docker/libcontainer/configs"
|
||||
@@ -39,3 +40,7 @@ func RunInResourceContainer(containerName string) error {
|
||||
|
||||
return manager.Apply(os.Getpid())
|
||||
}
|
||||
|
||||
func ApplyRLimitForSelf(maxOpenFiles uint64) {
|
||||
syscall.Setrlimit(syscall.RLIMIT_NOFILE, &syscall.Rlimit{Max: maxOpenFiles, Cur: maxOpenFiles})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user