Browse Source

devstack: use cgroupfs driver for both docker and k8s on Cent OS

This is required for resource limiting for non-image functions as we use
the cgroup paths setup by the cgroupfs driver.

Change-Id: I91c50d5ee70a5973f720fd13c6c6214c7361fb7a
changes/89/573089/3
Hunt Xu 3 years ago
parent
commit
2045799772
2 changed files with 15 additions and 20 deletions
  1. +2
    -20
      tools/gate/kubeadm/playbook/roles/docker/tasks/centos.yml
  2. +13
    -0
      tools/gate/kubeadm/playbook/roles/k8s_cli/tasks/centos.yml

+ 2
- 20
tools/gate/kubeadm/playbook/roles/docker/tasks/centos.yml View File

@ -20,25 +20,7 @@
docker-ce-17.03.2.ce-1.el7.centos \
docker-ce-selinux-17.03.2.ce-1.el7.centos
- name: Ensure docker.service.d directory
file:
path: /etc/systemd/system/docker.service.d
recurse: yes
state: directory
- name: Change docker cgroup driver
copy:
content: |
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd --exec-opt native.cgroupdriver=systemd
dest: /etc/systemd/system/docker.service.d/10-docker-kubeadm.conf
mode: 0644
group: root
owner: root
- name: Restart docker service
- name: Start docker service
systemd:
name: docker
daemon_reload: yes
state: restarted
state: started

+ 13
- 0
tools/gate/kubeadm/playbook/roles/k8s_cli/tasks/centos.yml View File

@ -21,3 +21,16 @@
- kubelet-1.9.3
- kubectl-1.9.3
- kubeadm-1.9.3
# On CentOS 7, the kubeadm package adds a configuration file that overrides
# kubelet's cgroup driver to systemd, we want to use the default driver
# cgroupfs to get the same cgroup paths for resource limiting.
#
# $ rpm -qf /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
# kubeadm-1.9.3-0.x86_64
#
- name: Change kubelet cgroup driver
replace:
path: /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
regexp: '(KUBELET_CGROUP_ARGS=)[^"]+'
replace: '\1'

Loading…
Cancel
Save