Add runtime cgroup and put containerd and cri-containerd into it.
Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
parent
b27a4c1723
commit
95dfd3c039
@ -10,6 +10,27 @@
|
|||||||
- include: tasks/k8s.yaml # Contains tasks kubernetes component installation
|
- include: tasks/k8s.yaml # Contains tasks kubernetes component installation
|
||||||
- include: tasks/binaries.yaml # Contains tasks for pulling containerd and cri-containerd components
|
- include: tasks/binaries.yaml # Contains tasks for pulling containerd and cri-containerd components
|
||||||
|
|
||||||
|
- name: "Create a directory for containerd config"
|
||||||
|
file: path=/etc/containerd state=directory
|
||||||
|
|
||||||
|
- name: "Add containerd config file"
|
||||||
|
blockinfile:
|
||||||
|
path: /etc/containerd/config.toml
|
||||||
|
create: yes
|
||||||
|
block: |
|
||||||
|
[cgroup]
|
||||||
|
path = "/runtime"
|
||||||
|
|
||||||
|
- name: "Create a directory for cri-containerd config"
|
||||||
|
file: path=/etc/cri-containerd state=directory
|
||||||
|
|
||||||
|
- name: "Add cri-containerd config file"
|
||||||
|
blockinfile:
|
||||||
|
path: /etc/cri-containerd/config.toml
|
||||||
|
create: yes
|
||||||
|
block: |
|
||||||
|
cgroup_path = "/runtime"
|
||||||
|
|
||||||
- name: "Start Containerd"
|
- name: "Start Containerd"
|
||||||
systemd: name=containerd daemon_reload=yes state=started enabled=yes
|
systemd: name=containerd daemon_reload=yes state=started enabled=yes
|
||||||
|
|
||||||
@ -38,7 +59,7 @@
|
|||||||
- name: "Add runtime args in kubelet conf"
|
- name: "Add runtime args in kubelet conf"
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: "/etc/systemd/system/kubelet.service.d/10-kubeadm.conf"
|
dest: "/etc/systemd/system/kubelet.service.d/10-kubeadm.conf"
|
||||||
line: "Environment=\"KUBELET_EXTRA_ARGS= --container-runtime=remote --runtime-request-timeout=15m --container-runtime-endpoint=/var/run/cri-containerd.sock\""
|
line: "Environment=\"KUBELET_EXTRA_ARGS= --runtime-cgroups=/runtime --container-runtime=remote --runtime-request-timeout=15m --container-runtime-endpoint=/var/run/cri-containerd.sock\""
|
||||||
insertafter: '\[Service\]'
|
insertafter: '\[Service\]'
|
||||||
when: check_args.stdout == ""
|
when: check_args.stdout == ""
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
---
|
---
|
||||||
- name: "Get Containerd and CRI-Containerd"
|
- name: "Get Containerd and CRI-Containerd"
|
||||||
unarchive:
|
unarchive:
|
||||||
src: "https://storage.googleapis.com/cri-containerd-release/cri-containerd-{{ cri_containerd_release_version }}.tar.gz"
|
# TODO change to cri-containerd-release before official release.
|
||||||
|
src: "https://storage.googleapis.com/cri-containerd-staging/cri-containerd-{{ cri_containerd_release_version }}.tar.gz"
|
||||||
dest: "/"
|
dest: "/"
|
||||||
remote_src: yes
|
remote_src: yes
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
# TODO update official versions once they are available
|
# TODO update official versions once they are available
|
||||||
cri_containerd_release_version: 1.0.0-alpha.0
|
cri_containerd_release_version: 1.0.0-alpha.0-84-ge57cb68
|
||||||
cri_release_directory: /opt/cri-containerd/
|
cri_release_directory: /opt/cri-containerd/
|
||||||
local_bin_dir: /usr/local/bin/
|
local_bin_dir: /usr/local/bin/
|
||||||
local_sbin_dir: /usr/local/sbin/
|
local_sbin_dir: /usr/local/sbin/
|
||||||
|
Loading…
Reference in New Issue
Block a user