From 04ca9d51ba483fd285020b07941845df7fa49e82 Mon Sep 17 00:00:00 2001 From: Maru Newby Date: Tue, 5 Jan 2016 19:05:35 +0000 Subject: [PATCH] Fix dind compatibility with centos/rhel Kubelet's cgroup manipulation of the dind daemon is not compatible with centos/rhel. This change disables the offending cgroup manipulation when the kubelet is running with dind. --- pkg/cmd/server/kubernetes/node_config.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/server/kubernetes/node_config.go b/pkg/cmd/server/kubernetes/node_config.go index 8c1e645ffcea..ffa5ca205528 100644 --- a/pkg/cmd/server/kubernetes/node_config.go +++ b/pkg/cmd/server/kubernetes/node_config.go @@ -176,12 +176,17 @@ func BuildKubernetesNodeConfig(options configapi.NodeConfig) (*NodeConfig, error // docker-in-docker (dind) deployments are used for testing // networking plugins. Running openshift under dind won't work // with the real oom adjuster due to the state of the cgroups path - // in a dind container that uses systemd for init. + // in a dind container that uses systemd for init. Similarly, + // cgroup manipulation of the nested docker daemon doesn't work + // properly under centos/rhel and should be disabled by setting + // the name of the container to an empty string. // - // TODO(marun) Make dind cgroups compatible with openshift + // This workaround should become unnecessary once user namespaces if value := cmdutil.Env("OPENSHIFT_DIND", ""); value == "true" { glog.Warningf("Using FakeOOMAdjuster for docker-in-docker compatibility") cfg.OOMAdjuster = oom.NewFakeOOMAdjuster() + glog.Warningf("Disabling cgroup manipulation of nested docker daemon for docker-in-docker compatibility") + cfg.DockerDaemonContainer = "" } // Setup auth