Skip to content

Commit

Permalink
containerd: download containerd from upstream instead of using distro…
Browse files Browse the repository at this point in the history
… specific packages (#7970)

* Containerd: download containerd from upstream instead of using distro specific packages

split runc download to separate role
make bootstrap-os role deploy container-selinux and seccomp libraries
clean up package manager provided containerd
move variables to docker role that are no longer common with containerd

* Containerd: make molecule testing more relevant

* replace ubuntu18 with ubuntu20
* add centos8 and debian11 to molecule tests
* run kubernetes/preinstall role to ensure relevancy
  of test including dependency packages

* CI: adjust test scenarios for downloaded containerd
  • Loading branch information
cristicalin authored Oct 20, 2021
1 parent 10c30ea commit ea8e2fc
Show file tree
Hide file tree
Showing 55 changed files with 396 additions and 311 deletions.
24 changes: 12 additions & 12 deletions roles/container-engine/containerd-common/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
# We keep these variables around to allow migration from package
# manager controlled installs to direct download ones.
containerd_package: 'containerd.io'
yum_repo_dir: /etc/yum.repos.d

# Keep minimal repo information arround for cleanup
containerd_repo_info:
repos:

# Fedora docker-ce repo
docker_fedora_repo_base_url: 'https://download.docker.com/linux/fedora/{{ ansible_distribution_major_version }}/$basearch/stable'
docker_fedora_repo_gpgkey: 'https://download.docker.com/linux/fedora/gpg'
# CentOS/RedHat docker-ce repo
docker_rh_repo_base_url: 'https://download.docker.com/linux/centos/{{ ansible_distribution_major_version }}/$basearch/stable'
docker_rh_repo_gpgkey: 'https://download.docker.com/linux/centos/gpg'
# Ubuntu docker-ce repo
docker_ubuntu_repo_base_url: "https://download.docker.com/linux/ubuntu"
docker_ubuntu_repo_gpgkey: 'https://download.docker.com/linux/ubuntu/gpg'
docker_ubuntu_repo_repokey: '9DC858229FC7DD38854AE2D88D81803C0EBFCD88'
containerd_ubuntu_repo_base_url: "https://download.docker.com/linux/ubuntu"
containerd_ubuntu_repo_component: "stable"

# Debian docker-ce repo
docker_debian_repo_base_url: "https://download.docker.com/linux/debian"
docker_debian_repo_gpgkey: 'https://download.docker.com/linux/debian/gpg'
docker_debian_repo_repokey: '9DC858229FC7DD38854AE2D88D81803C0EBFCD88'
containerd_debian_repo_base_url: "https://download.docker.com/linux/debian"
containerd_debian_repo_component: "stable"
14 changes: 13 additions & 1 deletion roles/container-engine/containerd-common/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
---
- name: gather os specific variables
- name: containerd-common | check if fedora coreos
stat:
path: /run/ostree-booted
get_attributes: no
get_checksum: no
get_mime: no
register: ostree

- name: containerd-common | set is_ostree
set_fact:
is_ostree: "{{ ostree.stat.exists }}"

- name: containerd-common | gather os specific variables
include_vars: "{{ item }}"
with_first_found:
- files:
Expand Down
8 changes: 0 additions & 8 deletions roles/container-engine/containerd-common/vars/amazon.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,2 @@
---
containerd_package: containerd
containerd_versioned_pkg:
'latest': "{{ containerd_package }}"
'1.3.2': "{{ containerd_package }}-1.3.2-1.amzn{{ ansible_distribution_major_version }}"
'1.4.1': "{{ containerd_package }}-1.4.1-2.amzn{{ ansible_distribution_major_version }}"
'1.4.4': "{{ containerd_package }}-1.4.4-1.amzn{{ ansible_distribution_major_version }}"
'1.4.6': "{{ containerd_package }}-1.4.6-1.amzn{{ ansible_distribution_major_version }}"
'stable': "{{ containerd_package }}-1.4.6-1.amzn{{ ansible_distribution_major_version }}"
'edge': "{{ containerd_package }}-1.4.6-1.amzn{{ ansible_distribution_major_version }}"
10 changes: 0 additions & 10 deletions roles/container-engine/containerd-common/vars/debian-stretch.yml

This file was deleted.

11 changes: 0 additions & 11 deletions roles/container-engine/containerd-common/vars/debian.yml

This file was deleted.

11 changes: 0 additions & 11 deletions roles/container-engine/containerd-common/vars/fedora.yml

This file was deleted.

11 changes: 0 additions & 11 deletions roles/container-engine/containerd-common/vars/redhat.yml

This file was deleted.

2 changes: 2 additions & 0 deletions roles/container-engine/containerd-common/vars/suse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
containerd_package: containerd
10 changes: 0 additions & 10 deletions roles/container-engine/containerd-common/vars/ubuntu-16.yml

This file was deleted.

11 changes: 0 additions & 11 deletions roles/container-engine/containerd-common/vars/ubuntu.yml

This file was deleted.

34 changes: 1 addition & 33 deletions roles/container-engine/containerd/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
containerd_storage_dir: "/var/lib/containerd"
containerd_state_dir: "/run/containerd"
containerd_systemd_dir: "/etc/systemd/system/containerd.service.d"
containerd_oom_score: 0

containerd_default_runtime: "runc"
Expand Down Expand Up @@ -35,39 +36,6 @@ containerd_max_container_log_line_size: -1

containerd_cfg_dir: /etc/containerd

# Path to runc binary
runc_binary: /usr/bin/runc

yum_repo_dir: /etc/yum.repos.d

# Optional values for containerd apt repo
containerd_package_info:
pkgs:

containerd_repo_key_info:
repo_keys:

containerd_repo_info:
repos:

# Ubuntu docker-ce repo
containerd_ubuntu_repo_base_url: "https://download.docker.com/linux/ubuntu"
containerd_ubuntu_repo_gpgkey: "https://download.docker.com/linux/ubuntu/gpg"
containerd_ubuntu_repo_repokey: "9DC858229FC7DD38854AE2D88D81803C0EBFCD88"
containerd_ubuntu_repo_component: "stable"

# Debian docker-ce repo
containerd_debian_repo_base_url: "https://download.docker.com/linux/debian"
containerd_debian_repo_gpgkey: "https://download.docker.com/linux/debian/gpg"
containerd_debian_repo_repokey: "9DC858229FC7DD38854AE2D88D81803C0EBFCD88"
containerd_debian_repo_component: "stable"

# Fedora docker-ce repo
containerd_fedora_repo_base_url: "https://download.docker.com/linux/fedora/{{ ansible_distribution_major_version }}/$basearch/stable"
containerd_fedora_repo_gpgkey: "https://download.docker.com/linux/fedora/gpg"
containerd_fedora_repo_repokey: "9DC858229FC7DD38854AE2D88D81803C0EBFCD88"
containerd_fedora_repo_component: "stable"

# Extra config to be put in {{ containerd_cfg_dir }}/config.toml literally
containerd_extra_args: ''

Expand Down
2 changes: 2 additions & 0 deletions roles/container-engine/containerd/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---
dependencies:
- role: container-engine/containerd-common
- role: container-engine/runc
- role: container-engine/crictl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
- name: Converge
hosts: all
become: true
vars:
container_manager: containerd
roles:
- role: kubespray-defaults
- role: container-engine/containerd
24 changes: 21 additions & 3 deletions roles/container-engine/containerd/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,30 @@ lint: |
set -e
yamllint -c ../../../.yamllint .
platforms:
- name: ubuntu18
box: generic/ubuntu1804
cpus: 2
- name: ubuntu20
box: generic/ubuntu2004
cpus: 1
memory: 1024
groups:
- kube_control_plane
- kube_node
- k8s_cluster
- name: debian11
box: generic/debian11
cpus: 1
memory: 1024
groups:
- kube_control_plane
- kube_node
- k8s_cluster
- name: centos8
box: generic/centos8
cpus: 1
memory: 1024
groups:
- kube_control_plane
- kube_node
- k8s_cluster
provisioner:
name: ansible
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
- name: Prepare
hosts: all
gather_facts: False
become: true
vars:
ignore_assert_errors: true
roles:
- role: kubespray-defaults
- role: bootstrap-os
- { role: kubernetes/preinstall, tags: ["bootstrap-os"] }
36 changes: 0 additions & 36 deletions roles/container-engine/containerd/tasks/containerd_repo.yml

This file was deleted.

Loading

0 comments on commit ea8e2fc

Please sign in to comment.