Set the kubelet cgroup to <executor-cgroup>/kubelet

In contrast to the docker and system containers (= cgroup path) this has no
undesired consequence, only that the kubelet itself will be in its own cgroup
below the executor cgroup.
pull/6/head
Dr. Stefan Schimanski 2015-08-19 20:30:43 +02:00
parent 8ddcb222e9
commit d6feca1885
1 changed files with 11 additions and 7 deletions

View File

@ -99,12 +99,6 @@ func NewKubeletExecutorServer() *KubeletExecutorServer {
k.Address = net.ParseIP(defaultBindingAddress())
k.ShutdownFD = -1 // indicates unspecified FD
// empty string for all containers (= cgroup paths) which stop the kubelet
// from taking any control over the cgroups of itself and other system processes.
k.SystemContainer = ""
k.ResourceContainer = ""
k.DockerDaemonContainer = ""
return k
}
@ -137,11 +131,21 @@ func (s *KubeletExecutorServer) Run(hks hyperkube.Interface, _ []string) error {
log.Info(err)
}
// derive the executor cgroup and use it as docker cgroup root
// derive the executor cgroup and use it as docker container cgroup root
mesosCgroup := findMesosCgroup(s.cgroupPrefix)
s.cgroupRoot = mesosCgroup
log.V(2).Infof("passing cgroup %q to the kubelet as cgroup root", s.CgroupRoot)
// empty string for the docker and system containers (= cgroup paths). This
// stops the kubelet taking any control over other system processes.
s.SystemContainer = ""
s.DockerDaemonContainer = ""
// We set kubelet container to its own cgroup below the executor cgroup.
// In contrast to the docker and system container, this has no other
// undesired side-effects.
s.ResourceContainer = mesosCgroup + "/kubelet"
// create apiserver client
var apiclient *client.Client
clientConfig, err := s.CreateAPIServerClientConfig()