Skip to content

Commit

Permalink
Docker: Set Cgroup driver by default to systemd (kubernetes-sigs#6563)
Browse files Browse the repository at this point in the history
* Set Docker Cgroup driver to systemd

* Add docker_cgroup_driver in Docker defaults
  • Loading branch information
bmelbourne authored and LuckySB committed Jan 15, 2021
1 parent 86ade8c commit ff23f8c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions inventory/sample/group_vars/all/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ docker_container_storage_setup: false
## Otherwise docker-storage-setup will be executed incorrectly.
# docker_container_storage_setup_devs: /dev/vdb

## Uncomment this if you want to change the Docker Cgroup driver (native.cgroupdriver)
## Valid options are systemd or cgroupfs, default is systemd
# docker_cgroup_driver: systemd

## Uncomment this if you have more than 3 nameservers, then we'll only use the first 3.
docker_dns_servers_strict: false

Expand Down
2 changes: 2 additions & 0 deletions roles/container-engine/docker/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ dockerproject_repo_key_info:
dockerproject_repo_info:
repos:

docker_cgroup_driver: systemd

docker_dns_servers_strict: true

docker_container_storage_setup: false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[Service]
Environment="DOCKER_OPTS={{ docker_options|default('') }} --iptables={{ docker_iptables_enabled | default('false') }} \
--exec-opt native.cgroupdriver={{ docker_cgroup_driver }} \
{% for i in docker_insecure_registries %}--insecure-registry={{ i }} {% endfor %} \
{% for i in docker_registry_mirrors %}--registry-mirror={{ i }} {% endfor %} \
{% if docker_version != "latest" and docker_version is version('17.05', '<') %}--graph={% else %}--data-root={% endif %}{{ docker_daemon_graph }} \
{% if ansible_os_family not in ["openSUSE Leap", "openSUSE Tumbleweed", "Suse"] %}{{ docker_log_opts }}{% endif %} \
{% if ansible_architecture == "aarch64" and ansible_os_family == "RedHat" %} \
--add-runtime docker-runc=/usr/libexec/docker/docker-runc-current \
--default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd \
--add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc \
--userland-proxy-path=/usr/libexec/docker/docker-proxy-current --signature-verification=false \
{% endif %}"

Expand Down

0 comments on commit ff23f8c

Please sign in to comment.