Kernel: 5.11.11 Kubernetes: 1.20 Cilium: 1.9
Editing the CNI plugin directory with kubeadm.
Kubeadm by default will set the CNI binary path to /usr/lib/cni
which is NOT the case on most Archlinux systems.
Make sure you do two very important steps!
First edit the /etc/kubernetes/kubelet.env
to match
# /etc/kubernetes/kubelet.env
#
# The KUBELET_ARGS environment variable is used to provide flags and options to
# kubelet when running kubelet.service.
# See `man 1 kubelet` or `kubelet --help` for further information.
#
# NOTE: When using kubeadm to bootstrap a cluster KUBELET_ARGS will be appended
# to the kubeadm specific environment variables.
KUBELET_ARGS=--cni-bin-dir=/opt/cni/bin
This will piss you off if you didn't know to do this
systemctl daemon-reload
is needed in order to respect the new configuration.
If you see these errors below - you should do what I said above.
Mar 31 17:18:15 alice kubelet[84758]: }: [failed to find plugin "calico" in path [/usr/lib/cni]]
Mar 31 17:18:15 alice kubelet[84758]: W0331 17:18:15.251800 84758 cni.go:239] Unable to update cni config: no valid networks found in /etc/cni/net.d
Mar 31 17:18:17 alice kubelet[84758]: E0331 17:18:17.022765 84758 kubelet.go:2188] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
Mar 31 17:18:20 alice kubelet[84758]: W0331 17:18:20.252962 84758 cni.go:204] Error validating CNI config list {"cniVersion":"0.3.1","name":"cilium","plugins":[{"cniVersion":"0.3.1","enable-debug":false,"name":"cilium","type":"cilium-cni"}]}: [failed to find plugin "cilium-cni" in path [/usr/lib/cni]]
Mar 31 17:18:20 alice kubelet[84758]: W0331 17:18:20.264033 84758 cni.go:204] Error validating CNI config list {
Mar 31 17:18:20 alice kubelet[84758]: "name": "k8s-pod-network",
Mar 31 17:18:20 alice kubelet[84758]: "cniVersion": "0.3.1",
Mar 31 17:18:20 alice kubelet[84758]: "plugins": [
Mar 31 17:18:20 alice kubelet[84758]: {
Mar 31 17:18:20 alice kubelet[84758]: "type": "calico",
Mar 31 17:18:20 alice kubelet[84758]: "datastore_type": "kubernetes",
Mar 31 17:18:20 alice kubelet[84758]: "mtu": 0,
Mar 31 17:18:20 alice kubelet[84758]: "nodename_file_optional": false,
Mar 31 17:18:20 alice kubelet[84758]: "log_level": "Info",
Mar 31 17:18:20 alice kubelet[84758]: "log_file_path": "/var/log/calico/cni/cni.log",
Mar 31 17:18:20 alice kubelet[84758]: "ipam": { "type": "calico-ipam", "assign_ipv4" : "true", "assign_ipv6" : "false"},
Mar 31 17:18:20 alice kubelet[84758]: "container_settings": {
Mar 31 17:18:20 alice kubelet[84758]: "allow_ip_forwarding": false
Mar 31 17:18:20 alice kubelet[84758]: },
Mar 31 17:18:20 alice kubelet[84758]: "policy": {
Mar 31 17:18:20 alice kubelet[84758]: "type": "k8s"
Mar 31 17:18:20 alice kubelet[84758]: },
Mar 31 17:18:20 alice kubelet[84758]: "kubernetes": {
Mar 31 17:18:20 alice kubelet[84758]: "k8s_api_root":"https://10.96.0.1:443",
Mar 31 17:18:20 alice kubelet[84758]: "kubeconfig": "/etc/cni/net.d/calico-kubeconfig"
Mar 31 17:18:20 alice kubelet[84758]: }
Mar 31 17:18:20 alice kubelet[84758]: },
Mar 31 17:18:20 alice kubelet[84758]: {
Mar 31 17:18:20 alice kubelet[84758]: "type": "bandwidth",
Mar 31 17:18:20 alice kubelet[84758]: "capabilities": {"bandwidth": true}
Mar 31 17:18:20 alice kubelet[84758]: },
Mar 31 17:18:20 alice kubelet[84758]: {"type": "portmap", "snat": true, "capabilities": {"portMappings": true}}
Mar 31 17:18:20 alice kubelet[84758]: ]