mirror of https://github.com/k3s-io/k3s
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
parent
8ddcb222e9
commit
d6feca1885
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue