Geek Culture

A new tech publication by Start it up (https://medium.com/swlh).

Follow publication

Member-only story

K8s Network — CNI Introduction

Tony
Geek Culture
Published in
5 min readOct 11, 2022

--

What is CNI?

CNI stands for “Container Network Interface”, it is a standard, common network interface. CNI is one of the CNCF (Cloud native computing foundation) project, and it consists of a specification and libs for writing plugins to configure container network interfaces.

CNI concerns itself only with network connectivity of containers and removing allocated resources when the container is deleted. Because of this focus, CNI has a wide range of support and the specification is simple to implement.

There is currently no perfect, ultimate, and a universal solution in terms of network for containers. Different users and organizations use different network solutions for various reasons.

At present, there are network solutions such as flannel, calico, openvswitch, weave, ipvlan, etc., and there will be other network solutions in the future. These solutions have different interfaces and usage methods, and different container platforms require network functions. If there is no unified standard, there will be a lot of workload and duplication of work. To avoid work duplications, CNI defines a common interface between network plugins and container runtimes.

Pic from Oreilly

As you can see from the above diagram, CNI provides a plug-in-oriented networking solution.

Originally CNI was proposed by CoreOS and adopted by projects such as Apache Mesos, Cloud Foundry, K8s, Kurma and rkt.

Who is Using CNI?

The following container runtimes and orchestration systems are currently using CNI:

CNI Flow

CNI is used to connect container management systems and network plugins. It provides a network namespace where the container is located, insert the network interface into the network namespace, then do some necessary…

--

--

Tony
Tony

No responses yet

Write a response