Skip to content

Commit

Permalink
Switch vagrant test cluster runtime to use containerd directly
Browse files Browse the repository at this point in the history
Signed-off-by: Stan Wong <swong394@gmail.com>
  • Loading branch information
stanleywbwong committed Aug 12, 2021
1 parent 3248515 commit 33fabc9
Show file tree
Hide file tree
Showing 8 changed files with 111 additions and 82 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- name: docker status
- name: containerd status
service:
name: docker
name: containerd
state: started

- name: kubelet status
Expand Down
12 changes: 2 additions & 10 deletions test/e2e/infra/vagrant/playbook/roles/common/tasks/busybox.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
- name: Pull busybox:latest docker image (Ansible < '2.8.0')
docker_image:
name: busybox:latest
pull: yes
when: ansible_version.full is version_compare('2.8.0', '<')

- name: Pull busybox:latest docker image (Ansible >= '2.8.0')
docker_image:
name: busybox:latest
source: pull
when: ansible_version.full is version_compare('2.8.0', '>=')
ansible.builtin.command: ctr image pull docker.io/library/busybox:latest

63 changes: 63 additions & 0 deletions test/e2e/infra/vagrant/playbook/roles/common/tasks/containerd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
- name: Get ubuntu release
shell: lsb_release -cs
register: release
changed_when: False

- name: Add an apt signing key for Docker
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present

- name: Add apt repository for stable version
apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ release.stdout }} stable
state: present

- name: Loading required kernel modules on boot
template:
src: templates/containerd_modules.conf.j2
dest: /etc/modules-load.d/containerd.conf

- name: Load overlay kernel module
modprobe:
name: overlay
state: present

- name: Load br_netfilter kernel module
modprobe:
name: br_netfilter
state: present

- name: Configure sysctl
sysctl:
name: "{{ item.name }}"
value: "{{ item.value }}"
state: present
sysctl_file: /etc/sysctl.d/99-kubernetes-cri.conf
reload: yes
with_items:
- { name: net.bridge.bridge-nf-call-iptables, value: 1 }
- { name: net.ipv4.ip_forward, value: 1 }
- { name: net.bridge.bridge-nf-call-ip6tables, value: 1 }

- name: Install containerd
apt:
name: containerd.io
state: present
update_cache: yes
force_apt_get: yes
notify:
- containerd status

- name: Create containerd daemon configuration from template
template:
src: templates/containerd.conf.j2
dest: /etc/containerd/config.toml
register: containerd_config

- name: Restart containerd
service:
name: containerd
daemon_reload: yes
state: restarted
when: containerd_config.changed
61 changes: 0 additions & 61 deletions test/e2e/infra/vagrant/playbook/roles/common/tasks/docker.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

- import_tasks: base.yml

- import_tasks: docker.yml
- import_tasks: containerd.yml

- import_tasks: busybox.yml

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
root = "/var/lib/containerd"
state = "/run/containerd"
oom_score = 0
imports = ["/etc/containerd/runtime_*.toml", "./debug.toml"]

[grpc]
address = "/run/containerd/containerd.sock"
uid = 0
gid = 0

[debug]
address = "/run/containerd/debug.sock"
uid = 0
gid = 0
level = "info"

[metrics]
address = ""
grpc_histogram = false

[cgroup]
path = ""

[plugins]
[plugins.cgroups]
no_prometheus = false
[plugins.diff]
default = ["walking"]
[plugins.linux]
shim = "containerd-shim"
runtime = "runc"
runtime_root = ""
no_shim = false
shim_debug = false
[plugins.scheduler]
pause_threshold = 0.02
deletion_threshold = 0
mutation_threshold = 100
schedule_delay = 0
startup_delay = "100ms"

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
overlay
br_netfilter

This file was deleted.

0 comments on commit 33fabc9

Please sign in to comment.