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

Fix cilium to use k3s paths for binPath and confPath v2 #1402

Merged
merged 2 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
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
30 changes: 30 additions & 0 deletions bootstrap/templates/ansible/playbooks/cluster-installation.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,36 @@
when: k3s_installed.stat.exists
ansible.builtin.include_tasks: tasks/version-check.yaml

- name: Ensure that the /opt/cni directory exists
ansible.builtin.file:
path: /opt/cni
mode: '755'
state: directory
- name: Ensure that the /opt/cni/bin is a link to /var/lib/rancher/k3s/data/current/bin
ansible.builtin.file:
src: /var/lib/rancher/k3s/data/current/bin
dest: /opt/cni/bin
follow: false
force: true
state: link

- name: Ensure that the /etc/cni directory exists
ansible.builtin.file:
path: /etc/cni
mode: '755'
state: directory
- name: Ensure that the /var/lib/rancher/k3s/agent/etc/cni/net.d directory exists
ansible.builtin.file:
path: /var/lib/rancher/k3s/agent/etc/cni/net.d
mode: '755'
state: directory
- name: Ensure that the /etc/cni/net.d is a link to /var/lib/rancher/k3s/agent/etc/cni/net.d
ansible.builtin.file:
src: /var/lib/rancher/k3s/agent/etc/cni/net.d
dest: /etc/cni/net.d
force: true
state: link

- name: Install Kubernetes
ansible.builtin.include_role:
name: xanmanning.k3s
Expand Down
6 changes: 5 additions & 1 deletion bootstrap/templates/ansible/playbooks/cluster-nuke.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@
flush: true
ip_version: ipv6
loop: ["filter", "nat", "mangle", "raw"]
- name: Networking | Delete CNI directory
- name: Networking | Delete CNI bin link
ansible.builtin.file:
path: /opt/cni/bin
state: absent
- name: Networking | Delete CNI conf link
ansible.builtin.file:
path: /etc/cni/net.d
state: absent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ cgroup:
cluster:
id: 1
name: #{ bootstrap_cluster_name|default('home-kubernetes', true) }#
#% if bootstrap_distribution in ["k3s"] %#
cni:
binPath: /var/lib/rancher/k3s/data/current/bin
confPath: /var/lib/rancher/k3s/agent/etc/cni/net.d
#% endif %#
containerRuntime:
integration: containerd
#% if bootstrap_distribution in ["k3s"] %#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ cgroup:
cluster:
id: 1
name: #{ bootstrap_cluster_name|default('home-kubernetes', true) }#
#% if bootstrap_distribution in ["k3s"] %#
cni:
binPath: /var/lib/rancher/k3s/data/current/bin
confPath: /var/lib/rancher/k3s/agent/etc/cni/net.d
#% endif %#
containerRuntime:
integration: containerd
#% if bootstrap_distribution in ["k3s"] %#
Expand Down