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

This commit is contained in:
Petr Řehoř authored and GitHub committed 2024-04-11 10:14:48 -04:00
1 parent 6fd11c398d
commit 0bb18d4588
4 files changed
+45 -1

No files matched your search

@@ -25,6 +25,36 @@
when: k3s_installed.stat.exists when: k3s_installed.stat.exists
ansible.builtin.include_tasks: tasks/version-check.yaml 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 - name: Install Kubernetes
ansible.builtin.include_role: ansible.builtin.include_role:
name: xanmanning.k3s name: xanmanning.k3s
@@ -50,7 +50,11 @@
flush: true flush: true
ip_version: ipv6 ip_version: ipv6
loop: ["filter", "nat", "mangle", "raw"] 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: ansible.builtin.file:
path: /etc/cni/net.d path: /etc/cni/net.d
state: absent state: absent
@@ -10,6 +10,11 @@ cgroup:
cluster: cluster:
id: 1 id: 1
name: #{ bootstrap_cluster_name|default('home-kubernetes', true) }# 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: containerRuntime:
integration: containerd integration: containerd
#% if bootstrap_distribution in ["k3s"] %# #% if bootstrap_distribution in ["k3s"] %#
@@ -10,6 +10,11 @@ cgroup:
cluster: cluster:
id: 1 id: 1
name: #{ bootstrap_cluster_name|default('home-kubernetes', true) }# 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: containerRuntime:
integration: containerd integration: containerd
#% if bootstrap_distribution in ["k3s"] %# #% if bootstrap_distribution in ["k3s"] %#