Change cgroup driver from cgroupfs to systemd

The minikube iso is using systemd, so change the container runtime
to use the same cgroup manager instead of the default (cgroupfs).

Avoids kubeadm init message:
    [WARNING IsDockerSystemdCheck]:
        detected "cgroupfs" as the Docker cgroup driver.
        The recommended driver is "systemd".

Also change the configuration for the containerd and cri-o runtimes.
pull/6651/head
Anders F Björklund 2020-02-15 12:32:25 +01:00
parent dba9ce14ad
commit 3398013249
4 changed files with 18 additions and 2 deletions

View File

@ -31,7 +31,7 @@ oom_score = 0
enable_selinux = false
sandbox_image = "k8s.gcr.io/pause:3.1"
stats_collect_period = 10
systemd_cgroup = false
systemd_cgroup = true
enable_tls_streaming = false
max_container_log_line_size = 16384
[plugins.cri.containerd]

View File

@ -120,7 +120,7 @@ seccomp_profile = ""
apparmor_profile = "crio-default-1.16.1"
# Cgroup management implementation used for the runtime.
cgroup_manager = "cgroupfs"
cgroup_manager = "systemd"
# List of default capabilities for containers. If it is empty or commented out,
# only the capabilities defined in the containers json file by the user/kube

View File

@ -0,0 +1,10 @@
{
"exec-opts": [
"native.cgroupdriver=systemd"
],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2"
}

View File

@ -34,6 +34,12 @@ define DOCKER_BIN_INSTALL_TARGET_CMDS
$(INSTALL) -D -m 0755 \
$(@D)/docker-proxy \
$(TARGET_DIR)/bin/docker-proxy
# https://kubernetes.io/docs/setup/production-environment/container-runtimes/#docker
$(INSTALL) -Dm644 \
$(DOCKER_BIN_PKGDIR)/daemon.json \
$(TARGET_DIR)/etc/docker/daemon.json
endef
define DOCKER_BIN_INSTALL_INIT_SYSTEMD