Is `--cni-bin-dir` still effective on v1.24, or any replace document exist?

1.7k views Asked by At

Is --cni-bin-dir still effective on kubernetes v1.24?

From seeing Network Plugin document, --cni-bin-dir is described. But from seeing the CHANGELOG, it is removed.

Is there any documentation for Kubernetes CNI plugin for v1.24?

Reference

https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/

https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.24.md

1

There are 1 answers

2
jlonganecker On

Short answer yes, it has been removed.

Kubelet


--cni-bin-dir string Default: /opt/cni/bin

A comma-separated list of full paths of directories in which to search for CNI plugin binaries. This docker-specific flag only works when container-runtime is set to docker. (DEPRECATED: will be removed along with dockershim.)

source - https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/

Dockershim


Dockershim was removed from Kubernetes with the release of v1.24

source - https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/

Conclusion


Putting those two bits together --cni-bin-dir was deprecated then removed with dockershim for the v1.24 release.

I find this docs page useful for figuring out details about the different flags used by kubernetes components:

https://kubernetes.io/docs/reference/command-line-tools-reference/

updated

It is up to your CNI to manage to cni bin dir, for example if you are using flannel and its DaemonSet it will create those dirs for you.

Taken from https://github.com/flannel-io/flannel/blob/master/Documentation/kube-flannel.yml#L236-L238

...
      - name: cni-plugin
        hostPath:
          path: /opt/cni/bin
...

This DaemonSet defines some volumes and creates the dir for you on the host

I believe Kubelet doesn't actually care to interact with your CNI, your container runtime is suppose to do that.