mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-07-13 16:12:40 +02:00
fix: kubevirt - failed to configure vmi network: setup failed, err: pod link (pod6b4853bd4f2) is missing
This commit is contained in:
@@ -25,6 +25,10 @@
|
|||||||
nodeLabels = [
|
nodeLabels = [
|
||||||
"node-purpose=kubevirt"
|
"node-purpose=kubevirt"
|
||||||
];
|
];
|
||||||
|
# kubevirt works well with k3s's flannel,
|
||||||
|
# but has issues with cilium(failed to configure vmi network: setup failed, err: pod link (pod6b4853bd4f2) is missing).
|
||||||
|
# so we should not disable flannel here.
|
||||||
|
disableFlannel = false;
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
imports =
|
imports =
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
nodeLabels = [
|
nodeLabels = [
|
||||||
"node-purpose=kubevirt"
|
"node-purpose=kubevirt"
|
||||||
];
|
];
|
||||||
|
disableFlannel = false;
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
imports =
|
imports =
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
nodeLabels = [
|
nodeLabels = [
|
||||||
"node-purpose=kubevirt"
|
"node-purpose=kubevirt"
|
||||||
];
|
];
|
||||||
|
disableFlannel = false;
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
imports =
|
imports =
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
clusterInit ? false,
|
clusterInit ? false,
|
||||||
nodeLabels ? [],
|
nodeLabels ? [],
|
||||||
nodeTaints ? [],
|
nodeTaints ? [],
|
||||||
|
disableFlannel ? true,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
package = pkgs.k3s_1_29;
|
package = pkgs.k3s_1_29;
|
||||||
@@ -53,20 +54,23 @@ in {
|
|||||||
"--disable-helm-controller" # we use fluxcd instead
|
"--disable-helm-controller" # we use fluxcd instead
|
||||||
"--disable=traefik" # deploy our own ingress controller instead
|
"--disable=traefik" # deploy our own ingress controller instead
|
||||||
"--disable=servicelb" # we use kube-vip instead
|
"--disable=servicelb" # we use kube-vip instead
|
||||||
"--flannel-backend=none" # we use cilium instead
|
|
||||||
"--disable-network-policy"
|
"--disable-network-policy"
|
||||||
"--tls-san=${masterHost}"
|
"--tls-san=${masterHost}"
|
||||||
]
|
]
|
||||||
++ (map (label: "--node-label=${label}") nodeLabels)
|
++ (map (label: "--node-label=${label}") nodeLabels)
|
||||||
++ (map (taint: "--node-taint=${taint}") nodeTaints);
|
++ (map (taint: "--node-taint=${taint}") nodeTaints)
|
||||||
|
++ (pkgs.lib.optionals disableFlannel ["--flannel-backend=none"]);
|
||||||
in
|
in
|
||||||
pkgs.lib.concatStringsSep " " flagList;
|
pkgs.lib.concatStringsSep " " flagList;
|
||||||
};
|
};
|
||||||
|
|
||||||
# create symlinks to link k3s's cni directory to the one used by almost all CNI plugins
|
# create symlinks to link k3s's cni directory to the one used by almost all CNI plugins
|
||||||
|
# such as multus, calico, etc.
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
"L+ /opt/cni/bin - - - - /var/lib/rancher/k3s/data/current/bin"
|
"L+ /opt/cni/bin - - - - /var/lib/rancher/k3s/data/current/bin"
|
||||||
# seems like k3s's containerd will create /etc/cni/net.d, so we don't need to create a symlink for it
|
# If you have disabled flannel, you will have to create the directory via a tmpfiles rule
|
||||||
# "L+ /etc/cni/net.d - - - - /var/lib/rancher/k3s/agent/etc/cni/net.d"
|
"D /var/lib/rancher/k3s/agent/etc/cni/net.d 0751 root root - -"
|
||||||
|
# Link the CNI config directory
|
||||||
|
"L+ /etc/cni/net.d - - - - /var/lib/rancher/k3s/agent/etc/cni/net.d"
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user