A method and system for realizing fast switching of calico network mode in multi-CPU architecture
By configuring the Calico network mode to BGP, BGP (RR), IPIP, and CrossSubnet, and using BGP Client and Route Reflector to optimize network communication, we solved network latency and compatibility issues under multi-CPU architecture, achieved fast and flexible network mode switching, and improved the efficiency and stability of the Kubernetes cluster.
Patent Information
- Application Number
- CN202411049447.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-08-01
AI Technical Summary
In a Kubernetes cluster environment with multiple CPU architectures, network communication faces problems such as network latency, bandwidth limitations, and compatibility and performance differences between different CPU architectures. How to quickly and flexibly switch the Calico network mode to adapt to different network environments and business needs has become an urgent problem to be solved.
By configuring the Calico network mode to BGP, BGP (RR), IPIP, and CrossSubnet mode, and utilizing BGP Client, Route Reflector, and the Linux virtual network interface tunl0, efficient network routing distribution and communication optimization can be achieved, the number of node connections can be reduced, and VXLAN or IPIP can be used for packet processing to ensure communication security and reliability.
It achieves fast switching of Calico network modes under multi-CPU architecture, optimizes network communication performance, improves the overall efficiency and stability of the cluster, simplifies the network configuration process, and reduces the complexity and error rate of manual operations.
Smart Images

Figure CN119011461B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud-native Kubernetes container technology, and in particular to a method and system for implementing rapid switching of a multi-CPU architecture to a calico network mode. Background Art
[0002] With the rapid development of cloud computing and containerization technologies, Kubernetes, as a leading container orchestration platform, has been widely used in the deployment and management of large-scale applications. Calico, a network plug-in for Kubernetes, provides multiple network modes to support complex network scenarios, including BGP, IPIP, and CrossSubnet. The BGP mode uses the Border Gateway Protocol to exchange routing information between nodes and is suitable for large and complex network environments. The IPIP mode enables simple network communication by encapsulating and decapsulating IP packets. The CrossSubnet mode optimizes communication between pods across and within the same network segment, improving efficiency and reliability by intelligently selecting communication paths.
[0003] However, in a multi-CPU Kubernetes cluster environment, network communication presents new challenges. First, nodes may be distributed across different physical servers or cloud instances, making network latency and bandwidth key performance limiting factors. Second, compatibility and performance differences between different CPU architectures can also impact network communication efficiency. Furthermore, as clusters scale and applications become more complex, how to quickly and flexibly switch Calico's network mode to adapt to different network environments and business needs becomes a pressing issue.
[0004] Therefore, an effective method is needed to quickly switch Calico network modes in a multi-CPU architecture to optimize network communication performance and improve the overall efficiency and stability of the cluster. This method should be able to intelligently select the appropriate network mode based on the actual needs and scenarios of the cluster, and simplify the switching process through automated configuration, reducing the complexity and error rate of manual operations. Summary of the Invention
[0005] The purpose of the present invention is to provide a method and system for realizing rapid switching of calico network mode in a multi-CPU architecture, so as to solve the problems raised in the above background technology.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a method for realizing fast switching of calico network mode in a multi-CPU architecture, the method comprising the following steps:
[0007] Parameter settings: Configure Calico to use BGP mode in the cluster. By setting the calico_network_mode=BGP parameter, Calico will automatically configure a series of parameters to achieve efficient network routing distribution and communication;
[0008] Parameter allocation, Calico introduces the Route Reflector (RR) mode that supports BGP. In BGP's RR mode, by setting the parameters calico_network_mode = BGP and enable_RR_mode = true, Calico will automatically configure a series of parameters to achieve effective routing information exchange and management;
[0009] Network communication management: Configure Calico in the cluster to use IPIP mode to manage network communication in the Kubernetes cluster. By setting the calico_network_mode=IPIP parameter, Calico will automatically configure a series of parameters to provide a convenient and efficient network communication mechanism for the cluster.
[0010] Communication optimization, configure Calico's CrossSubnet mode to optimize communication between Pods of Kubernetes nodes across and within the same network segment. By setting the calico_network_mode=CrossSubnet parameter, Calico automatically configures the following parameters to provide an efficient network communication mechanism for the cluster.
[0011] Preferably, the specific operations of parameter setting include:
[0012] In BGP mode, a BGP client is deployed for each host. The BGP client reads the routing information generated by Felix into the host kernel and distributes the routing information throughout the cluster through the BGP protocol. When Felix inserts the routing information into the Forwarding Information Base (FIB) of the Linux kernel, the BGP client obtains the routing information and distributes it efficiently to other nodes in the cluster.
[0013] Through the routing distribution of the BGP protocol, each node in the cluster can obtain the routing information of other nodes in real time, thereby establishing a global routing table. This mechanism enables fast and reliable communication between different nodes in the cluster, achieving efficient data transmission and network interconnection.
[0014] Preferably, the specific operations of parameter allocation include:
[0015] In BGP's RR mode, the concept of Route Reflector is introduced to reduce the number of direct connections between nodes. Route Reflector acts as a central node, responsible for collecting and distributing routing information. This avoids the need for each node to establish connections with other nodes, enabling simpler and more efficient routing communication paths to be established between nodes in the network.
[0016] Preferably, the specific operations of network communication management include:
[0017] When the Calico node starts, it pulls up a Linux system virtual network interface tunl0, which will be used to handle the encapsulation and parsing of IPIP packets. Through the binary file named allocateip, an IP address from the Calico IP Pool will be assigned to tunl0. Detailed logs of this process are recorded in the local / var / log / calico / allocate-tunnel-addrs / directory to ensure the tracking and monitoring of the IP address allocation process.
[0018] Tunl0 is a tunnel device interface supported by the Linux system. Its existence enables outbound IP packets to be encapsulated into IPIP messages, realizing tunnel encapsulation and decapsulation operations on data packets. In this way, different nodes in the cluster can communicate securely and reliably while ensuring the integrity and reliability of data packets.
[0019] Preferably, the specific operations of communication optimization include:
[0020] In CrossSubnet mode, communication between pods on Kubernetes nodes across different network segments uses VXLAN or IPIP for packet encapsulation, ensuring secure and reliable cross-segment communication. For communication between pods on Kubernetes nodes within the same network segment, BGP mode is directly used to avoid unnecessary packet processing and improve communication efficiency.
[0021] By configuring Kubernetes nodes in the same network segment as BGPSpeakers, full interconnection is achieved, and the subnet routing information of each Pod is exchanged, thus enabling intercommunication between Pods. Through the full interconnection of BGP Speakers, each node in the cluster can understand the routing information of Pods on other nodes, realizing dynamic updates of global routes and optimization of communication paths.
[0022] A system for realizing rapid switching of calico network modes in a multi-CPU architecture, the system comprising a parameter setting module, a parameter allocation module, a network communication management module, and a communication optimization module;
[0023] The parameter setting module is used to configure Calico to use BGP mode in the cluster. By setting the calico_network_mode=BGP parameter, Calico will automatically configure a series of parameters to achieve efficient network routing distribution and communication;
[0024] Parameter allocation module, used for Calico to introduce support for BGP Route Reflector (RR) mode. In BGP RR mode, by setting calico_network_mode = BGP and enable_RR_mode = true parameters, Calico will automatically configure a series of parameters to achieve effective routing information exchange and management;
[0025] The network communication management module is used to configure Calico to use IPIP mode in the cluster to manage network communication in the Kubernetes cluster. By setting the calico_network_mode=IPIP parameter, Calico will automatically configure a series of parameters to provide a convenient and efficient network communication mechanism for the cluster;
[0026] The communication optimization module is used to configure Calico's CrossSubnet mode to optimize communication between Pods of Kubernetes nodes across and within the same network segment. By setting the calico_network_mode=CrossSubnet parameter, Calico automatically configures the following parameters to provide an efficient network communication mechanism for the cluster.
[0027] Preferably, the parameter setting module deploys a BGP Client for each host in BGP mode. The BGP Client reads the routing information generated by Felix into the kernel of the host and distributes the routing information throughout the cluster through the BGP protocol. When Felix inserts the routing information into the Forwarding Information Base (FIB) of the Linux kernel, the BGP client obtains the routing information and effectively distributes it to other nodes in the cluster.
[0028] Through the routing distribution of the BGP protocol, each node in the cluster can obtain the routing information of other nodes in real time, thereby establishing a global routing table. This mechanism enables fast and reliable communication between different nodes in the cluster, achieving efficient data transmission and network interconnection.
[0029] Preferably, the parameter allocation module introduces the concept of Route Reflector in the RR mode of BGP to reduce the number of direct connections between nodes. The Route Reflector acts as a central node, responsible for collecting and distributing routing information, thereby avoiding the situation where each node needs to establish a connection with other nodes, so that a more concise and efficient routing communication path is established between the nodes in the network.
[0030] Preferably, the network communication management module, when the Calico node is started, pulls up a virtual network interface tunl0 of the Linux system, which will be used to process the encapsulation and parsing of IPIP messages. Through a binary file named allocateip, an IP address from the Calico IPPool will be allocated to tunl0. The detailed log of this process is recorded in the local / var / log / calico / allocate-tunnel-addrs / directory, ensuring the tracking and monitoring of the IP address allocation process;
[0031] Tunl0 is a tunnel device interface supported by the Linux system. Its existence enables outbound IP packets to be encapsulated into IPIP messages, realizing tunnel encapsulation and decapsulation operations on data packets. In this way, different nodes in the cluster can communicate securely and reliably while ensuring the integrity and reliability of data packets.
[0032] Preferably, in the CrossSubnet mode, the communication optimization module uses VXLAN or IPIP for packet encapsulation for communication between Pods on Kubernetes nodes across network segments, ensuring secure and reliable cross-segment communication. For communication between Pods on Kubernetes nodes within the same network segment, BGP mode is directly used to avoid unnecessary packet processing and improve communication efficiency.
[0033] By configuring Kubernetes nodes in the same network segment as BGPSpeakers, full interconnection is achieved, and the subnet routing information of each Pod is exchanged, thus enabling intercommunication between Pods. Through the full interconnection of BGP Speakers, each node in the cluster can understand the routing information of Pods on other nodes, realizing dynamic updates of global routes and optimization of communication paths.
[0034] Compared with the prior art, the present invention has the following beneficial effects:
[0035] The present invention proposes a method and system for realizing fast switching of calico network modes in a multi-CPU architecture. Based on the calico network, fast switching of four network modes, namely BGP, BGP (RR), IPIP, and CrossSubnet, is realized. Different network modes can be selected according to the scale and complexity of the network, and network strategies can be flexibly selected. Since the IPIP mode has an additional layer of packet encapsulation and unpacking compared to the BGP mode, which increases network overhead and latency, the network transmission performance of the IPIP mode is lower than that of the pure BGP mode. In order to realize flexible switching within and across sub-networks, the switching functions of BGP, BGP (RR), IPIP, and CrossSubnet are added.
[0036] For the switching function of BGP, BGP (RR), IPIP and CrossSubnet, the switch calico_network_mode is added. If the calico network mode is specified, the CALICO_IPV4POOL_IPIP in the calico.yaml configuration file and the ipipMode mode in ippool are automatically modified to achieve switching between BGP, IPIP and CrossSubnet. For whether BGP enables RR mode, the switch enable_RR_mode is added, and true or false is specified. If the current calico_network_mode = BGP, and enable_RR_mode = true is specified, the master node is determined to act as a route reflector, allowing other nodes to obtain routing information from the RR node, automatically shutting down nodetonodeMesh, modifying BGPconfig, and adding label: i-am-a-route-reflector = true to the master node. The default is false. Therefore, this patent realizes the rapid switching of calico network mode in a multi-CPU architecture in a K8S cluster through the transformation of calico. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 Flow chart of the method of the present invention. DETAILED DESCRIPTION
[0038] In order to clearly and completely describe the objectives and technical solutions of the present invention and make the advantages more clearly understood, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are part of the embodiments of the present invention, not all of them, and are only used to explain the embodiments of the present invention, not to limit the embodiments of the present invention. All other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0039] Example 1
[0040] See also Figure 1 The present invention provides a technical solution: a method for realizing fast switching of calico network mode in a multi-CPU architecture, the method comprising the following steps:
[0041] 1. Configure Calico to use BGP mode in the cluster. By setting the calico_network_mode=BGP parameter, Calico will automatically configure a series of parameters to achieve efficient network routing distribution and communication.
[0042] In BGP mode, it's crucial to deploy a BGP client on each host. This BGP client's primary function is to read the routing information generated by Felix into the host's kernel and distribute it throughout the cluster using BGP. When Felix inserts routing information into the Linux kernel's Forwarding Information Base (FIB), the BGP client retrieves this routing information and efficiently distributes it to other nodes in the cluster.
[0043] Through BGP routing distribution, each node in the cluster can obtain real-time routing information from other nodes, thereby establishing a global routing table. This mechanism enables fast and reliable communication between different nodes in the cluster, achieving efficient data transmission and network interconnection.
[0044] By setting parameters, the following configurations can be achieved:
[0045] (1) Configure Calico-node's damonsetCALICO_IPV4POOL_IPIP to Never.
[0046] (2) Configure ipipMode of ippool to off.
[0047] 2. The network maintained by Calico uses a Node-to-Node Mesh model by default for exchanging routing information. However, as the cluster scales, the Mesh model will cause the number of connections to grow exponentially, forming a massive service mesh and posing challenges to the network.
[0048] To address this issue, Calico introduced a BGP-supported Route Reflector (RR) mode. In BGP's RR mode, by setting the calico_network_mode = BGP and enable_RR_mode = true parameters, Calico will automatically configure a series of parameters to achieve efficient routing information exchange and management.
[0049] In BGP's RR mode, the concept of a Route Reflector is introduced to reduce the number of direct connections between nodes. The Route Reflector acts as a central node, collecting and distributing routing information, eliminating the need for every node to establish connections with every other node. This architecture establishes simpler and more efficient routing paths between nodes in the network.
[0050] By setting parameters, the following configurations can be achieved:
[0051] (1) Configure the Calico-node damonset CALICO_IPV4POOL_IPIP to Never.
[0052] (2) Configure ipipMode of ippool to off.
[0053] (3) Create a new bgpconfig configuration as follows:
[0054]
[0055] (4) Create a new bgppeer configuration as follows:
[0056]
[0057] (5) Each master node has been added with the label: i-am-a-route-reflector:
[0058] "true".
[0059] 3. Configuring Calico in the cluster Using IPIP mode is a common network setting that can effectively manage network communication in the Kubernetes cluster. By setting the calico_network_mode=IPIP parameter, Calico will automatically configure a series of parameters to provide a convenient and efficient network communication mechanism for the cluster.
[0060] Once IPIP mode is configured, when the Calico node boots, it will bring up a Linux virtual network interface, tunl0, which will handle IPIP packet encapsulation and parsing. Subsequently, an IP address from the Calico IP Pool is assigned to tunl0 via the allocateip binary. Detailed logging of this process is recorded in the local / var / log / calico / allocate-tunnel-addrs / directory, ensuring tracking and monitoring of the IP address allocation process.
[0061] Tunl0 is a tunnel device interface supported by the Linux system. Its existence enables outbound IP packets to be encapsulated into IPIP messages, thereby implementing tunnel encapsulation and decapsulation operations on data packets. In this way, different nodes in the cluster can communicate securely and reliably while ensuring the integrity and reliability of data packets.
[0062] Configuring Calico to use IPIP mode offers numerous advantages, including simplified network setup and improved network communication efficiency and reliability. By automatically allocating IP addresses and using IPIP tunneling technology, nodes in the cluster can quickly establish communication channels and securely transmit data packets. This network architecture design not only meets the needs of modern containerized environments but also provides powerful support for cluster network management and operations.
[0063] By setting parameters, the following configurations can be achieved:
[0064] (1) Set Calico-node's daemonsetCALICO_IPV4POOL_IPIP to Always.
[0065] (2) Set ipipMode of ippool to Always.
[0066] 4. By configuring Calico's CrossSubnet mode, you can optimize communication between pods on Kubernetes nodes across and within the same network segment. In this mode, by setting the calico_network_mode=CrossSubnet parameter, Calico automatically configures the following parameters to provide an efficient network communication mechanism for the cluster.
[0067] In CrossSubnet mode, communication between pods on Kubernetes nodes across different network segments uses VXLAN or IPIP for packet encapsulation, ensuring secure and reliable cross-segment communication. For communication between pods on Kubernetes nodes within the same network segment, BGP is used directly, avoiding unnecessary packet processing and improving communication efficiency.
[0068] Furthermore, by configuring Kubernetes nodes within the same network segment as BGPSpeaker, they are fully interconnected, exchanging their respective pod's subnet routing information, thus enabling inter-pod communication. This mechanism not only simplifies network configuration but also improves network scalability and flexibility. Through BGPSpeaker's full interconnection, every node in the cluster can understand the routing information of pods on other nodes, enabling dynamic global routing updates and optimized communication paths.
[0069] By setting parameters, the following configurations can be achieved:
[0070] (1) Set the ipipMode parameter in ippool to CrossSubnet.
[0071] (2) Set the CALICO_IPV4POOL_IPIP working mode and set the value to Off.
[0072] Example 2
[0073] Based on the first embodiment, a system for realizing fast switching of calico network mode in multi-CPU architecture is proposed, which consists of a parameter setting module, a parameter allocation module, a network communication management module and a communication optimization module;
[0074] The parameter setting module is used to configure Calico to use BGP mode in the cluster. By setting the calico_network_mode=BGP parameter, Calico will automatically configure a series of parameters to achieve efficient network routing distribution and communication. In BGP mode, a BGP client is deployed for each host. The BGP client reads the routing information generated by Felix into the host kernel and distributes the routing information throughout the cluster through the BGP protocol. When Felix inserts the routing information into the Forwarding Information Base (FIB) of the Linux kernel, the BGP client will obtain this routing information and distribute it effectively to other nodes in the cluster.
[0075] Through the routing distribution of the BGP protocol, each node in the cluster can obtain the routing information of other nodes in real time, thereby establishing a global routing table. This mechanism enables fast and reliable communication between different nodes in the cluster, achieving efficient data transmission and network interconnection.
[0076] The parameter allocation module is used for Calico to introduce the Route Reflector (RR) mode that supports BGP. In the RR mode of BGP, by setting the parameters calico_network_mode=BGP and enable_RR_mode=true, Calico will automatically configure a series of parameters to achieve effective routing information exchange and management; in the RR mode of BGP, the concept of Route Reflector is introduced to reduce the number of direct connections between nodes. Route Reflector acts as a central node, responsible for collecting and distributing routing information, thereby avoiding the situation where each node needs to establish a connection with other nodes, so that a more concise and efficient routing communication path is established between nodes in the network.
[0077] The network communication management module is used to configure Calico in the cluster to use IPIP mode to manage network communication in the Kubernetes cluster. By setting the calico_network_mode=IPIP parameter, Calico will automatically configure a series of parameters to provide a convenient and efficient network communication mechanism for the cluster. When the Calico node is started, a Linux system virtual network interface tunl0 is pulled up. The interface will be used to handle the encapsulation and parsing of IPIP messages. An IP address from the Calico IPPool will be allocated to tunl0 through a binary file named allocateip. Detailed logs of this process are recorded in the local / var / log / calico / allocate-tunnel-addrs / directory to ensure tracking and monitoring of the IP address allocation process.
[0078] Tunl0 is a tunnel device interface supported by the Linux system. Its existence enables outbound IP packets to be encapsulated into IPIP messages, realizing tunnel encapsulation and decapsulation operations on data packets. In this way, different nodes in the cluster can communicate securely and reliably while ensuring the integrity and reliability of data packets.
[0079] The communication optimization module is used to configure Calico's CrossSubnet mode to optimize communication between Pods on Kubernetes nodes across network segments and within the same network segment. By setting the calico_network_mode=CrossSubnet parameter, Calico automatically configures the following parameters to provide an efficient network communication mechanism for the cluster. In CrossSubnet mode, communication between Pods on Kubernetes nodes across network segments uses VXLAN or IPIP for packet encapsulation, ensuring secure and reliable cross-segment communication. For communication between Pods on Kubernetes nodes within the same network segment, BGP mode is directly used to avoid unnecessary packet processing and improve communication efficiency.
[0080] By configuring Kubernetes nodes in the same network segment as BGPSpeakers, full interconnection is achieved, and the subnet routing information of each Pod is exchanged, thus enabling intercommunication between Pods. Through the full interconnection of BGP Speakers, each node in the cluster can understand the routing information of Pods on other nodes, realizing dynamic updates of global routes and optimization of communication paths.
[0081] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A method for quickly switching the calico network mode in a multi-CPU architecture, characterized by: The method comprises the following steps: Parameter settings: Configure Calico to use BGP mode in the cluster by setting the calico_network_mode=BGP parameter, configuring the Calico-node's damonsetCALICO_IPV4POOL_IPIP to Never, and configuring the ippool's ipipMode to off to achieve efficient network routing distribution and communication; Parameter allocation, Calico introduced the Route Reflector (RR) mode that supports BGP. In the RR mode of BGP, by setting the parameters calico_network_mode = BGP and enable_RR_mode = true, if the current calico_network_mode = BGP, and specify enable_RR_mode = true, the master node is determined to act as a route reflector, allowing other nodes to obtain routing information from the RR node, automatically shutting down nodetonodeMesh, modifying BGPconfig, and adding label: i-am-a-route-reflector = true on the master node; the default setting is false, which enables effective routing information exchange and management; Network communication management, by setting the calico_network_mode=IPIP parameter, setting the Calico-node's damonsetCALICO_IPV4POOL_IPIP to Always, and setting the ippool's ipipMode to Always, provides a convenient and efficient network communication mechanism for the cluster; Communication optimization: Configure Calico's CrossSubnet mode to optimize communication between Pods of Kubernetes nodes across network segments and within the same network segment. Set the calico_network_mode = CrossSubnet parameter, set the ipipMode parameter in ippool to CrossSubnet, set the CALICO_IPV4POOL_IPIP working mode, and set the value to Off to provide an efficient network communication mechanism for the cluster.
2. A method for realizing fast switching of calico network mode in multi-CPU architecture according to claim 1, characterized in that: The specific operations of parameter setting include: In BGP mode, a BGP client is deployed for each host. The BGP client reads the routing information generated by Felix into the host kernel and distributes the routing information throughout the cluster through the BGP protocol. When Felix inserts the routing information into the Forwarding Information Base (FIB) of the Linux kernel, the BGP client obtains the routing information and distributes it efficiently to other nodes in the cluster. Through the routing distribution of the BGP protocol, each node in the cluster can obtain the routing information of other nodes in real time, thereby establishing a global routing table. This mechanism enables fast and reliable communication between different nodes in the cluster, achieving efficient data transmission and network interconnection.
3. A method for realizing fast switching of calico network mode in multi-CPU architecture according to claim 1, characterized in that: The specific operations of parameter assignment include: In BGP's RR mode, the concept of Route Reflector is introduced to reduce the number of direct connections between nodes. Route Reflector acts as a central node, responsible for collecting and distributing routing information. This avoids the need for each node to establish connections with other nodes, enabling simpler and more efficient routing communication paths to be established between nodes in the network.
4. A method for realizing fast switching of calico network mode in a multi-CPU architecture according to claim 1, characterized in that: Specific operations of network communication management include: When the Calico node starts, it pulls up a Linux system virtual network interface tunl0, which will be used to handle the encapsulation and parsing of IPIP packets. Through the binary file named allocateip, an IP address from the Calico IP Pool will be assigned to tunl0. Detailed logs of this process are recorded in the local / var / log / calico / allocate-tunnel-addrs / directory to ensure the tracking and monitoring of the IP address allocation process. Tunl0 is a tunnel device interface supported by the Linux system. Its existence enables outbound IP packets to be encapsulated into IPIP messages, realizing tunnel encapsulation and decapsulation operations on data packets. In this way, different nodes in the cluster can communicate securely and reliably while ensuring the integrity and reliability of data packets.
5. The method for realizing fast switching of calico network mode in multi-CPU architecture according to claim 1, characterized in that: Specific operations of communication optimization include: In CrossSubnet mode, communication between pods on Kubernetes nodes across different network segments uses VXLAN or IPIP for packet encapsulation, ensuring secure and reliable cross-segment communication. For communication between pods on Kubernetes nodes within the same network segment, BGP mode is directly used to avoid unnecessary packet processing and improve communication efficiency. By configuring Kubernetes nodes in the same network segment as BGPSpeakers, full interconnection is achieved, and the subnet routing information of each Pod is exchanged, thus enabling intercommunication between Pods. Through the full interconnection of BGP Speakers, each node in the cluster can understand the routing information of Pods on other nodes, realizing dynamic updates of global routes and optimization of communication paths.
6. A method for realizing fast switching of calico network mode in multi-CPU architecture according to any one of claims 1-5, and a system for realizing fast switching of calico network mode in multi-CPU architecture, characterized in that: The system consists of a parameter setting module, a parameter allocation module, a network communication management module and a communication optimization module; The parameter setting module configures Calico to use BGP mode in the cluster by setting the calico_network_mode=BGP parameter, configuring the Calico-node's damonsetCALICO_IPV4POOL_IPIP to Never, and configuring the ippool's ipipMode to off to achieve efficient network routing distribution and communication; In the parameter allocation module, Calico introduced the Route Reflector (RR) mode that supports BGP. In the RR mode of BGP, by setting the parameters calico_network_mode = BGP and enable_RR_mode = true, if the current calico_network_mode = BGP and enable_RR_mode = true is specified, the master node is determined to act as a route reflector, allowing other nodes to obtain routing information from the RR node, automatically shutting down nodetonodeMesh, modifying BGPconfig, and adding label: i-am-a-route-reflector = true on the master node; the default setting is false, which enables effective routing information exchange and management; The network communication management module provides a convenient and efficient network communication mechanism for the cluster by setting the calico_network_mode=IPIP parameter, setting the Calico-node's damonsetCALICO_IPV4POOL_IPIP to Always, and setting the ippool's ipipMode to Always; The communication optimization module configures Calico's CrossSubnet mode to optimize communication between Pods of Kubernetes nodes across network segments and within the same network segment. By setting the calico_network_mode=CrossSubnet parameter, setting the parameter ipipMode in ippool to CrossSubnet, setting the CALICO_IPV4POOL_IPIP working mode, and setting the value to Off, an efficient network communication mechanism is provided for the cluster.
7. The system for realizing fast switching of calico network mode in multi-CPU architecture according to claim 6, characterized in that: The parameter setting module deploys a BGP client for each host in BGP mode. The BGP client reads the routing information generated by Felix into the host's kernel and distributes the routing information throughout the cluster through the BGP protocol. When Felix inserts the routing information into the Forwarding Information Base (FIB) of the Linux kernel, the BGP client obtains the routing information and effectively distributes it to other nodes in the cluster. Through the routing distribution of the BGP protocol, each node in the cluster can obtain the routing information of other nodes in real time, thereby establishing a global routing table. This mechanism enables fast and reliable communication between different nodes in the cluster, achieving efficient data transmission and network interconnection.
8. The system for realizing fast switching of calico network mode in multi-CPU architecture according to claim 6, characterized in that: The parameter allocation module introduces the concept of Route Reflector in the RR mode of BGP to reduce the number of direct connections between nodes. Route Reflector acts as a central node, responsible for collecting and distributing routing information, thereby avoiding the situation where each node needs to establish a connection with other nodes, so that a more concise and efficient routing communication path is established between nodes in the network.
9. The system for realizing fast switching of calico network mode in multi-CPU architecture according to claim 6, characterized in that: The network communication management module, when the Calico node is started, pulls up a Linux system virtual network interface tunl0, which will be used to process the encapsulation and parsing of IPIP messages. Through the binary file named allocateip, an IP address from the Calico IPPool will be allocated to tunl0. The detailed log of this process is recorded in the local / var / log / calico / allocate-tunnel-addrs / directory, ensuring the tracking and monitoring of the IP address allocation process; Tunl0 is a tunnel device interface supported by the Linux system. Its existence enables outbound IP packets to be encapsulated into IPIP messages, realizing tunnel encapsulation and decapsulation operations on data packets. In this way, different nodes in the cluster can communicate securely and reliably while ensuring the integrity and reliability of data packets.
10. The system for realizing fast switching of calico network mode in multi-CPU architecture according to claim 6, characterized in that: In CrossSubnet mode, the communication optimization module uses VXLAN or IPIP for packet encapsulation between pods on Kubernetes nodes across different network segments, ensuring secure and reliable cross-segment communication. For communication between pods on Kubernetes nodes within the same network segment, BGP is directly used to avoid unnecessary packet processing and improve communication efficiency. By configuring Kubernetes nodes in the same network segment as BGPSpeakers, full interconnection is achieved, and the subnet routing information of each Pod is exchanged, thus enabling intercommunication between Pods. Through the full interconnection of BGP Speakers, each node in the cluster can understand the routing information of Pods on other nodes, realizing dynamic updates of global routes and optimization of communication paths.
Citation Information
Patent Citations
Method for realizing large-scale container cluster
CN111443993A
Switching method of route reflection mode and network architecture
CN111817954A