flag controlled RLIMIT_NOFILE for kubelet.

This commit is contained in:
Dawn Chen
2015-09-22 14:41:18 -07:00
parent 843134885e
commit 38583307ca
3 changed files with 18 additions and 0 deletions

View File

@@ -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})
}