The invention provides a method and a
system for modifying a Pod network during operation based on a CNI plug-in in K8s. The method comprises the following steps: Pod is called to nodes; the Kubelet is used for calling a Multi CNI (
Computer Network Interface) cmdAdd interface; the Multi CNI calls a Dturbo CNI cmdAdd interface, and the Dturbo CNI cmdAdd interface is called by the Multi CNI; the Dturbo CNI generates a Pod network
namespace record in the cmdAdd interface; when the Operator monitors the newly added Pod network
namespace record, the Operator creates a corresponding
network interface according to the Pod
network interface definition; the Pod is removed from the node; the Kubelet is used for calling a Multi CNI (
Computer Network Interface) cmdDel interface; the Multi CNI calls a Dturbo CNI cmdDel interface, and the Dturbo CNI cmdDel interface is called by the Multi CNI; the Dturbo CNI deletes a Pod network
namespace record in the cmdDel interface; when the Operator monitors that the network namespace record is deleted, the Operator deletes the existing
network interface of the Pod; a Pod network
interface definition is externally modified; the Operator monitors that the definition of the network interface in the Pod configuration is modified; the Operator deletes the existing network interface of the Pod; and the Operator creates a corresponding network interface according to the modified Pod network
interface definition. According to the invention, the capability of modifying the Pod network interface during operation is provided, and specific service requirements are met.