From c6833e0b24ae6c4b56e307386603aa611eaf5f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=98eho=C5=99?= Date: Wed, 20 Mar 2024 13:05:51 +0100 Subject: [PATCH] Fix cilium to use k3s paths for binPath and confPath (#1381) * Update cilium-values-init.partial.yaml.j2 * Update cilium-values-full.partial.yaml.j2 * Update cluster-nuke.yaml.j2 --------- Co-authored-by: Devin Buhl --- bootstrap/templates/ansible/playbooks/cluster-nuke.yaml.j2 | 2 +- .../templates/partials/cilium-values-full.partial.yaml.j2 | 7 ++++++- .../templates/partials/cilium-values-init.partial.yaml.j2 | 7 ++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/bootstrap/templates/ansible/playbooks/cluster-nuke.yaml.j2 b/bootstrap/templates/ansible/playbooks/cluster-nuke.yaml.j2 index a99265b8..400c1e79 100644 --- a/bootstrap/templates/ansible/playbooks/cluster-nuke.yaml.j2 +++ b/bootstrap/templates/ansible/playbooks/cluster-nuke.yaml.j2 @@ -52,7 +52,7 @@ loop: ["filter", "nat", "mangle", "raw"] - name: Networking | Delete CNI directory ansible.builtin.file: - path: /etc/cni/net.d + path: /var/lib/rancher/k3s/agent/etc/cni/net.d state: absent - name: Check to see if k3s-killall.sh exits diff --git a/bootstrap/templates/partials/cilium-values-full.partial.yaml.j2 b/bootstrap/templates/partials/cilium-values-full.partial.yaml.j2 index 37c4f7c4..2134c40e 100644 --- a/bootstrap/templates/partials/cilium-values-full.partial.yaml.j2 +++ b/bootstrap/templates/partials/cilium-values-full.partial.yaml.j2 @@ -9,7 +9,12 @@ cgroup: hostRoot: /sys/fs/cgroup cluster: 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: integration: containerd #% if bootstrap_distribution in ["k3s"] %# diff --git a/bootstrap/templates/partials/cilium-values-init.partial.yaml.j2 b/bootstrap/templates/partials/cilium-values-init.partial.yaml.j2 index d7c9875c..7e89bbcc 100644 --- a/bootstrap/templates/partials/cilium-values-init.partial.yaml.j2 +++ b/bootstrap/templates/partials/cilium-values-init.partial.yaml.j2 @@ -9,7 +9,12 @@ cgroup: hostRoot: /sys/fs/cgroup cluster: 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: integration: containerd #% if bootstrap_distribution in ["k3s"] %#