[edge] testing/kubelet: Failed to locate cni-plugins binaries
Context
kubelet daemon could not find cni-plugins binaries
Steps to reproduce
$ apk info kubelet # edge package
kubelet-1.18.4-r1 description:
Kubernetes - kubelet
$ rc-service kubelet start
$ ps aux | grep kubelet
12082 root 0:00 supervise-daemon kubelet --start --stdout /var/log/kubelet/kubelet.log --stderr /var/log/kubelet/kubelet.log /usr/bin/kubelet -- --cni-bin-dir=/usr/share/cni-plugins/bin --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --config=/var/lib/kubelet/config.yaml --cgroup-driver=cgroupfs --network-plugin=cni --pod-infra-container-image=k8s.gcr.io/pause:3.2
12083 root 0:12 /usr/bin/kubelet --cni-bin-dir=/usr/share/cni-plugins/bin --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --config=/var/lib/kubelet/config.yaml --cgroup-driver=cgroupfs --network-plugin=cni --pod-infra-container-image=k8s.gcr.io/pause:3.2
As you could see in the output above the --cni-bin-dir=/usr/share/cni-plugins/bin
flag is declared for kubelet deamon, it means that kubelet would try to look into the /usr/share/cni-plugins/bin
for cni-plugin binaries.
Because cni-plugins install binaries to /usr/libexec/cni/
, kubelet would fail to locate cni-plugins binaries. The output of kubelet daemon clearly supports this:
$ cat /var/log/kubelet/kubelet.log
..
: [failed to find plugin "bridge" in path [/usr/share/cni-plugins/bin] failed to find plugin "portmap" in path [/usr/share/cni-plugins/bin] failed to find plugin "bandwidth" in path [/usr/share/cni-plugins/bin]]
Discussion
Is there any reason why we place cni-plugins to /usr/libexec/cni
instead of /usr/share/cni-plugins/bin
? I could see from the 09dff09b by @ncopa that the decision was more of a convention of storing executables in /usr/libexec/
. If that's the case, I guess we should update the --cni-bin-dir
in kubelet confd too.
Edited by Trung Lê