containernetworking / cni

Container Network Interface - networking for Linux containers

Home Page:https://cni.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cni spec Question: Why do we need to place config file in /etc/cni/net.d?

yash97 opened this issue · comments

Why cni config file is not some CRD object that container runtime can pull from K8s and execute binaries.

Thank You.

Why cni config file is not some CRD object that container runtime can pull from K8s and execute binaries.

Thank You.

The CNI is not executed by K8s, it is executed by the container runtime (containerd, cri-o). These paths are configurable as well and /etc/cni/net.d is the default. Its worth noting the CNI is not specific to Kubernetes as well.

If you are using containerd its configurable:

[plugins."io.containerd.grpc.v1.cri".cni]
  bin_dir = "/opt/cni/bin"
  conf_dir = "/etc/cni/net.d"

I am sure its probably configurable with cri-o as well