diff --git a/.gitlab-ci/packet.yml b/.gitlab-ci/packet.yml index 66f80594c74d8188357d16c875dbe953d02b8335..186240ef1ac9ccb4556f5158a5bfa8c39e9c124f 100644 --- a/.gitlab-ci/packet.yml +++ b/.gitlab-ci/packet.yml @@ -162,6 +162,11 @@ packet_amazon-linux-2-aio: extends: .packet when: manual +packet_fedora30-cilium-containerd: + stage: deploy-part2 + extends: .packet + when: on_success + # ### PR JOBS PART3 # Long jobs (45min+) diff --git a/docs/ci.md b/docs/ci.md index 2b6de8418b00edf1522729dbba4d15fcfdb73b6d..7c1210efe1e2817368b79eacc25367833b461b9c 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -48,7 +48,7 @@ centos8 | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | coreos | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | debian10 | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | debian9 | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | -fedora30 | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | +fedora30 | :x: | :x: | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | fedora31 | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | opensuse | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | oracle7 | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | diff --git a/roles/container-engine/containerd/defaults/main.yml b/roles/container-engine/containerd/defaults/main.yml index adeda97f97f450a89a8e430283649dd26c6f105b..bf6484081d6ba11372b76aab4433cd4fc6451a88 100644 --- a/roles/container-engine/containerd/defaults/main.yml +++ b/roles/container-engine/containerd/defaults/main.yml @@ -49,6 +49,12 @@ 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/$releasever/$basearch/stable' +containerd_fedora_repo_gpgkey: 'https://download.docker.com/linux/fedora/gpg' +containerd_fedora_repo_repokey: '9DC858229FC7DD38854AE2D88D81803C0EBFCD88' +containerd_fedora_repo_component: 'stable' + containerd_default_runtime: type: io.containerd.runtime.v1.linux engine: '' diff --git a/roles/container-engine/containerd/tasks/main.yml b/roles/container-engine/containerd/tasks/main.yml index 5c33504dd7199487c438a0d5fa4ad104fac84da6..ebed7e11f62e7c88c8b47446c48b8677b68dc56d 100644 --- a/roles/container-engine/containerd/tasks/main.yml +++ b/roles/container-engine/containerd/tasks/main.yml @@ -13,7 +13,7 @@ fail: msg: "{{ ansible_distribution }} is not supported by containerd." when: - - not ansible_distribution in ["CentOS","RedHat", "Ubuntu", "Debian"] + - not ansible_distribution in ["CentOS","RedHat", "Ubuntu", "Debian", "Fedora"] - name: gather os specific variables include_vars: "{{ item }}" @@ -34,6 +34,21 @@ tags: - facts +- name: disable unified_cgroup_hierarchy in Fedora 31+ + shell: + cmd: grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0" + when: + - ansible_distribution == "Fedora" + - (ansible_distribution_major_version | int) >= 31 + - ansible_proc_cmdline['systemd.unified_cgroup_hierarchy'] is not defined or ansible_proc_cmdline['systemd.unified_cgroup_hierarchy'] != '0' + +- name: reboot in Fedora 31+ + reboot: + when: + - ansible_distribution == "Fedora" + - (ansible_distribution_major_version | int) >= 31 + - ansible_proc_cmdline['systemd.unified_cgroup_hierarchy'] is not defined or ansible_proc_cmdline['systemd.unified_cgroup_hierarchy'] != '0' + - include_tasks: containerd_repo.yml when: not is_ostree diff --git a/roles/container-engine/containerd/templates/fedora_containerd.repo.j2 b/roles/container-engine/containerd/templates/fedora_containerd.repo.j2 new file mode 100644 index 0000000000000000000000000000000000000000..a76b469a146855281e849496f018e451bb7a1003 --- /dev/null +++ b/roles/container-engine/containerd/templates/fedora_containerd.repo.j2 @@ -0,0 +1,7 @@ +[docker-ce] +name=Docker-CE Repository +baseurl={{ containerd_fedora_repo_base_url }} +enabled=1 +gpgcheck={{ '1' if containerd_fedora_repo_gpgkey else '0' }} +gpgkey={{ containerd_fedora_repo_gpgkey }} +{% if http_proxy is defined %}proxy={{ http_proxy }}{% endif %} diff --git a/roles/container-engine/containerd/vars/fedora.yml b/roles/container-engine/containerd/vars/fedora.yml new file mode 100644 index 0000000000000000000000000000000000000000..54280420987afdf3bc055862ebb2395fa9c842d8 --- /dev/null +++ b/roles/container-engine/containerd/vars/fedora.yml @@ -0,0 +1,16 @@ +--- + +containerd_versioned_pkg: + 'latest': "{{ containerd_package }}" + '1.2.10': "{{ containerd_package }}-1.2.10-3.2.fc{{ ansible_distribution_major_version }}" + '1.2.12': "{{ containerd_package }}-1.2.12-3.2.fc{{ ansible_distribution_major_version }}" + '1.2.13': "{{ containerd_package }}-1.2.13-3.1.fc{{ ansible_distribution_major_version }}" + 'stable': "{{ containerd_package }}-1.2.13-3.1.fc{{ ansible_distribution_major_version }}" + 'edge': "{{ containerd_package }}-1.2.13-3.1.fc{{ ansible_distribution_major_version }}" + +containerd_package_info: + pkg_mgr: dnf + pkgs: + - name: "{{ containerd_versioned_pkg[containerd_version | string] }}" + +runc_binary: /usr/bin/runc diff --git a/tests/files/packet_fedora30-cilium-containerd.yml b/tests/files/packet_fedora30-cilium-containerd.yml new file mode 100644 index 0000000000000000000000000000000000000000..24c95ad027d743746528345093f729b0d17b4a8d --- /dev/null +++ b/tests/files/packet_fedora30-cilium-containerd.yml @@ -0,0 +1,11 @@ +--- +# Instance settings +cloud_image: fedora-30 +mode: default + +# Kubespray settings +container_manager: containerd +etcd_deployment_type: host +deploy_netchecker: true +dns_min_replicas: 1 +kube_network_plugin: cilium