From 89c42bd3d5782a002bd48c6a3b89d1c5135a9252 Mon Sep 17 00:00:00 2001 From: pacoxu Date: Sat, 23 Jan 2021 08:26:02 +0800 Subject: [PATCH] check containerd as process name instead of docker-containerd Signed-off-by: pacoxu --- pkg/kubelet/cm/container_manager_linux.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/kubelet/cm/container_manager_linux.go b/pkg/kubelet/cm/container_manager_linux.go index cc0b4266968..7a57a54cc56 100644 --- a/pkg/kubelet/cm/container_manager_linux.go +++ b/pkg/kubelet/cm/container_manager_linux.go @@ -69,10 +69,10 @@ import ( ) const ( - dockerProcessName = "dockerd" + dockerProcessName = "dockerd" + // dockerd option --pidfile can specify path to use for daemon PID file, pid file path is default "/var/run/docker.pid" dockerPidFile = "/var/run/docker.pid" - containerdProcessName = "docker-containerd" - containerdPidFile = "/run/docker/libcontainerd/docker-containerd.pid" + containerdProcessName = "containerd" maxPidFileLength = 1 << 10 // 1KB ) @@ -841,6 +841,8 @@ func EnsureDockerInContainer(dockerAPIVersion *utilversion.Version, oomScoreAdj type process struct{ name, file string } dockerProcs := []process{{dockerProcessName, dockerPidFile}} if dockerAPIVersion.AtLeast(containerdAPIVersion) { + // By default containerd is started separately, so there is no pid file. + containerdPidFile := "" dockerProcs = append(dockerProcs, process{containerdProcessName, containerdPidFile}) } var errs []error