kubernetes
network
CNI 僅關心容器創建時的網路分配,和當容器被刪除時釋放網路資源。
這些 CNI Plugin 都是由 CNI 專案所提供的基本功能,其目的非常簡單,就是提供最簡單且
單一的網路架構
。so that your Pods can communicate with each other.
當 kubelet 在建立 Pod 的時候,會透過 CNI 來讓 Pod 成功設定好網路
cni-bin-dir
(預設 /opt/cni/bin):存放各種 CNI Plugin 執行檔案的位置,例如上面提到的配置網路,刪除網路,分配 IP 位址的功能cni-conf-dir
(預設 /etc/cni/net.d):存放 CNI 的組態檔案,讓 kubelet 知道 Pod 在設定網路時,需要透過哪一些 Plugin 來完成Note:
Prior to Kubernetes 1.24, the CNI plugins could also be managed by the kubelet using thecni-bin-dir
andnetwork-plugin
command-line parameters. These command-line parameters were removed in Kubernetes 1.24, with management of the CNI no longer in scope for kubelet.