-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch vagrant test cluster runtime to use containerd directly
Signed-off-by: Stan Wong <swong394@gmail.com>
- Loading branch information
1 parent
3248515
commit a0365ae
Showing
9 changed files
with
117 additions
and
84 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
test/e2e/infra/vagrant/playbook/roles/common/handlers/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 9 additions & 11 deletions
20
test/e2e/infra/vagrant/playbook/roles/common/tasks/busybox.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
- 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', '>=') | ||
- name: Pull busybox:latest docker image | ||
shell: | | ||
ctr -n=k8s.io images check name==docker.io/library/busybox:latest > /tmp/busybox1 | ||
ctr -n=k8s.io image pull docker.io/library/busybox:latest | ||
ctr -n=k8s.io images check name==docker.io/library/busybox:latest > /tmp/busybox2 | ||
diff /tmp/busybox1 /tmp/busybox2 || echo "Image updated" | ||
rm -f /tmp/busybox1 /tmp/busybox2 | ||
register: busybox | ||
changed_when: "'Image updated' in busybox.stdout" |
63 changes: 63 additions & 0 deletions
63
test/e2e/infra/vagrant/playbook/roles/common/tasks/containerd.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
61
test/e2e/infra/vagrant/playbook/roles/common/tasks/docker.yml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
test/e2e/infra/vagrant/playbook/roles/common/templates/containerd.conf.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
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" |
2 changes: 2 additions & 0 deletions
2
test/e2e/infra/vagrant/playbook/roles/common/templates/containerd_modules.conf.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
overlay | ||
br_netfilter |
8 changes: 0 additions & 8 deletions
8
test/e2e/infra/vagrant/playbook/roles/common/templates/docker.json.j2
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters