By default, K3S will run with flannel as the CNI and use custom directories to store CNI plugin binaries and config files(You can inspect the kubelet args K3S uses via journalctl -u k3s|grep cni-conf-dir
).
So you need to configure that properly When deploying Multus CNI.
For example given the official Multus manifests in https://github.com/intel/multus-cni/blob/36f2fd64e0965e639a0f1d17ab754f0130951aba/images/multus-daemonset.yml
, the following changes are needed:
volumes:
- name: cni
hostPath:
path: /var/lib/rancher/k3s/agent/etc/cni/net.d
- name: cnibin
hostPath:
path: /var/lib/rancher/k3s/data/<replace-with-your-hash>/bin
containers:
- name: kube-multus
image: nfvpe/multus:v3.4.1
command: ["/entrypoint.sh"]
args:
- "--multus-conf-file=auto"
- "--cni-version=0.3.1"
# Add the following arg
- "--multus-kubeconfig-file-host=/var/lib/rancher/k3s/agent/etc/cni/net.d/multus.d/multus.kubeconfig"
Once Multus CNI is deployed properly it works as normal in K3S.
Hey, Ive been able to install MultusCNI with your solution and use macvlan. I have a net-attach with the spec inside. I've been trying to use the NetworkAttachmentDefinition with CNI config file instead of the spec inside the yaml file and I cant make it work. I keep getting this error:
Any idea on how to solve this? Thank you!