Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e: bridge CNI setup fixes for Fedora/containerd. #361

Merged
merged 2 commits into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 32 additions & 23 deletions test/e2e/playbook/provision.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,38 @@

- name: Configure containerd
when: is_containerd
ansible.builtin.shell: "{{ item }}"
with_items:
- mkdir -p /etc/containerd
- containerd config default > /etc/containerd/config.toml
- sed -i 's/^.*disabled_plugins *= *.*$/disabled_plugins = []/' /etc/containerd/config.toml
- sed -i 's/SystemdCgroup = false/SystemdCgroup = true/g' /etc/containerd/config.toml
block:
- name: Create containerd configuration
ansible.builtin.shell: "{{ item }}"
with_items:
- mkdir -p /etc/containerd
- containerd config default > /etc/containerd/config.toml
- sed -i 's/^.*disabled_plugins *= *.*$/disabled_plugins = []/' /etc/containerd/config.toml
- sed -i 's/SystemdCgroup = false/SystemdCgroup = true/g' /etc/containerd/config.toml

- name: Update CNI plugin directory on Fedora
when: ansible_facts['distribution'] == "Fedora"
ansible.builtin.lineinfile:
path: /etc/containerd/config.toml
regexp: ' *bin_dir *= *"/opt/cni/bin" *'
line: 'bin_dir = "/usr/libexec/cni"'

- name: Configure bridge CNI plugin
when: cni_plugin == "bridge"
block:
- name: Copy CNI bridge plugin configuration
ansible.builtin.copy:
src: "{{ nri_resource_policy_src }}/test/e2e/files/10-bridge.conf.in"
dest: "/etc/cni/net.d/10-bridge.conf"
owner: root
group: root
mode: '0644'

- name: Update CNI bridge plugin configuration
ansible.builtin.replace:
path: /etc/cni/net.d/10-bridge.conf
regexp: '(CNI_NETWORK)'
replace: "{{ network }}"

- name: Setup NRI
ansible.builtin.file:
Expand Down Expand Up @@ -417,23 +443,6 @@
- cilium install --wait
- cilium status --wait

- name: Configure bridge CNI plugin
when: cni_plugin == "bridge"
block:
- name: Copy CNI bridge plugin configuration
ansible.builtin.copy:
src: "{{ nri_resource_policy_src }}/test/e2e/files/10-bridge.conf.in"
dest: "/etc/cni/net.d/10-bridge.conf"
owner: root
group: root
mode: '0644'

- name: Update CNI bridge plugin configuration
ansible.builtin.replace:
path: /etc/cni/net.d/10-bridge.conf
regexp: 'CNI_NETWORK'
replace: "{{ network }}"

- name: Generate join command
ansible.builtin.command:
cmd: kubeadm token create --print-join-command
Expand Down