A multi-cluster network communication method, device, equipment, medium and product
Patent Information
- Application Number
- CN202511227882.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-29
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2045-08-29
AI Technical Summary
In a multi-cluster deployment mode, existing technologies introduce additional components to achieve cross-cluster network communication, which leads to problems such as increased resource consumption and routing rule conflicts.
By initiating network communication requests using nodes in the first cluster, determining the next-hop node based on the address and network segment information in the local routing table, and encapsulating and forwarding data packets, cross-cluster communication can be achieved without introducing additional components.
It avoids the resource consumption and routing rule conflicts caused by additional components, and achieves efficient and lightweight cross-cluster network communication.
Smart Images

Figure CN121125592B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a multi-cluster network communication method, apparatus, device, medium and product. Background Technology
[0002] In the current environment where multi-cluster deployment mode is becoming increasingly popular, more and more enterprises are using multi-cluster containerized deployment for their business applications. However, in multi-cluster scenarios, it is necessary to connect the container networks in each cluster so that multiple services distributed in different clusters can communicate with each other.
[0003] However, the current common approach to cross-cluster network communication is to introduce additional components. But these additional components consume extra resources, such as CPU and memory, increasing the system load. In addition, these additional components rely on the Linux protocol stack at the underlying data forwarding level, which is the same mechanism used by existing container networking solutions such as Calico, and can easily lead to problems such as routing rule conflicts and overlapping network configurations. Summary of the Invention
[0004] To address the aforementioned technical problems, this disclosure provides a multi-cluster network communication method, apparatus, device, medium, and product.
[0005] This disclosure provides a multi-cluster network communication method, which is applied to a first cluster, and the method includes:
[0006] The first node in the first cluster initiates a network communication request to the second node in the second cluster;
[0007] Based on the address network segment to which the second node belongs, the next-hop node information corresponding to the address network segment is determined from the local routing table of the first node; wherein, the local routing table is configured with the address network segments of each cluster other than the first cluster in a multi-cluster environment and the next-hop node information leading to each of the other clusters;
[0008] Based on the next-hop node information corresponding to the address segment, the data packet of the network communication request is encapsulated and forwarded to the next-hop node so that the data packet is transmitted to the second node.
[0009] This disclosure also provides a multi-cluster network communication device, which is applied to a first cluster, and the device includes:
[0010] The request initiation module is used to initiate a network communication request from the first node in the first cluster to the second node in the second cluster.
[0011] The determination module is used to determine the next-hop node information corresponding to the address network segment from the local routing table of the first node based on the address network segment to which the second node belongs; wherein, the local routing table is configured with the address network segments of each cluster other than the first cluster in a multi-cluster environment and the next-hop node information leading to each of the other clusters;
[0012] The forwarding module is used to encapsulate and forward the data packet of the network communication request to the next-hop node based on the next-hop node information corresponding to the address network segment, so that the data packet is transmitted to the second node.
[0013] This disclosure also provides an electronic device, the electronic device comprising: a processor; a memory for storing executable instructions of the processor; the processor being configured to read the executable instructions from the memory and execute the instructions to implement the multi-cluster network communication method provided in this disclosure.
[0014] This disclosure also provides a computer-readable storage medium storing a computer program for executing the multi-cluster network communication method provided in this disclosure.
[0015] This disclosure also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the multi-cluster network communication method provided in this disclosure.
[0016] Compared with the prior art, the technical solution provided in this disclosure has the following advantages: The multi-cluster network communication scheme provided in this disclosure is applied to a first cluster, including: initiating a network communication request to a second node in a second cluster using a first node in the first cluster; determining the next-hop node information corresponding to the address network segment from the local routing table of the first node based on the address network segment to which the second node belongs; wherein the local routing table is configured with the address network segments of all other clusters in the multi-cluster environment except the first cluster and the next-hop node information leading to the other clusters; and encapsulating and forwarding the data packet of the network communication request to the next-hop node based on the next-hop node information corresponding to the address network segment, so that the data packet is transmitted to the second node. By adopting the above technical solution, cross-cluster network communication can be achieved without introducing additional components, thereby avoiding problems such as resource consumption, routing rule conflicts, and network configuration overlap caused by deploying additional components. Attached Figure Description
[0017] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0018] Figure 1 A flowchart illustrating a multi-cluster network communication method provided in an embodiment of this disclosure;
[0019] Figure 2 A flowchart illustrating another multi-cluster network communication method provided in this embodiment of the disclosure;
[0020] Figure 3 This is a schematic diagram of the structure of a multi-cluster network communication device provided in an embodiment of the present disclosure;
[0021] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0022] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0023] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0024] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0025] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0026] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0027] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0028] Currently, Calico is a widely used container networking plugin in Kubernetes, while Karmada is a common tool for orchestrating multi-cluster Kubernetes networks. When these two are used together, to achieve interconnectivity between multi-cluster container networks, additional components such as Submariner are typically installed.
[0029] However, the current common approach to cross-cluster network communication is to introduce additional components. But these additional components consume extra resources, such as CPU and memory, increasing the system load. In addition, these additional components rely on the Linux protocol stack at the underlying data forwarding level, which is the same mechanism used by existing container networking solutions such as Calico, and can easily lead to problems such as routing rule conflicts and overlapping network configurations.
[0030] To address the aforementioned issues, this disclosure provides a multi-cluster network communication method applied to a first cluster. The method will be described below with reference to specific embodiments.
[0031] Figure 1 This is a flowchart illustrating a multi-cluster network communication method provided in an embodiment of this disclosure. This method can be executed by a multi-cluster network communication device, which can be implemented in software and / or hardware, and is generally integrated into an electronic device. Figure 1 As shown, the method includes:
[0032] Step 101: Use the first node in the first cluster to initiate a network communication request to the second node in the second cluster.
[0033] In this context, the first cluster refers to the cluster used to initiate cross-cluster network communication requests in a multi-cluster environment. Specifically, the first cluster can be a Kubernetes cluster. Kubernetes is a container orchestration platform used for the automated deployment, scaling, and management of containerized applications. The first node is the node in the first cluster used to initiate cross-cluster network communication requests. The second cluster is the cluster used to receive cross-cluster network communication requests. The network communication request can be a cross-cluster request; specifically, it can be a message request sent by the first node in the first cluster to the second node in the second cluster via the network.
[0034] To enable communication between nodes in different clusters, in one optional implementation, before initiating a network communication request from a first node in the first cluster to a second node in the second cluster, the method further includes: receiving configured global address pool copies corresponding to each cluster other than the first cluster in the multi-cluster environment, wherein each configured global address pool copy includes the address network segment of its own cluster and the next-hop node information leading to its own cluster; based on the received configured global address pool copies, extracting the address network segments of other clusters and the next-hop node information leading to other clusters and writing them into the local routing table of each node in the first cluster, so as to realize the routing configuration for cross-cluster network communication.
[0035] In this context, a multi-cluster environment refers to an overall environment formed by multiple clusters connected via a network in a distributed architecture. Other clusters refer to all clusters participating in multi-cluster collaboration except for the first cluster; these are also called remote clusters and are the clusters where the communication request is located. An address segment refers to a continuous range of Internet Protocol (IP) addresses used to identify the IP address range used by nodes or pods within a cluster. Taking the target cluster as an example, the next-hop node information included in the configured global address pool replica of the target cluster can be the network identifier of the first forwarding node that a data packet must pass through when sent from the first cluster to the target cluster. Specifically, the next-hop node information includes the next-hop node's management network IP address, the Media Access Control (MAC) address of the network interface card used by the next-hop tunnel endpoint interface in the virtual extended LAN, and the IP address of the network interface card used by the next-hop tunnel endpoint interface in the virtual extended LAN. The local routing table is a routing rule table maintained in the operating system kernel of each node in the first cluster. It records the mapping relationship between the address network segments of other clusters and the next-hop node information leading to other clusters. When a node in the first cluster needs to communicate with nodes in other clusters, the first cluster determines the forwarding path of the data packet based on the local routing table.
[0036] In this embodiment, the first cluster first receives configured global address pool copies from other clusters in the multi-cluster environment. Then, it listens to and parses each configured global address pool copy, extracting the address network segments of other clusters and the next-hop node information leading to those clusters, and writes this information into the local routing table of each node in the first cluster. Since this operation is executed independently on each worker node of the first cluster, all nodes within the first cluster ultimately have the ability to access other clusters. When a node in the first cluster initiates a cross-cluster communication request to the second cluster, the data packet is correctly forwarded to the specified next-hop node according to the rules in the local routing table, thus reaching the second cluster and completing the cross-cluster communication.
[0037] To facilitate understanding of the configured global address pool replicas, it is assumed that other clusters include the target cluster. The configured global address pool replica of the target cluster is obtained by adding a first label, a second label, a disable flag, and annotations to the global address pool replica of the target cluster. The first label is used to mark the replica as an external address pool, the second label is used to mark the source cluster of the replica, the disable flag is used to prohibit the replica from participating in address allocation, and the annotations are used to mark the next-hop node information.
[0038] The target cluster can be any of the other clusters. A global address pool is a centrally managed network resource object used to define and allocate the IP address ranges used by nodes and container groups (Pods) in each cluster. A replica of the global address pool refers to a copy instance of the original global address pool. A configured global address pool replica is the result of a series of configurations performed on the original global address pool replica, including adding a first label, adding a second label, setting a disable flag, and adding annotations. The first label is a marker attached to the global address pool replica to identify that the replica belongs to the address space of an external cluster, i.e., a non-local address pool. The second label identifies the source cluster of the global address pool replica, allowing identification of which cluster the replica belongs to. The disable flag indicates that the global address pool replica does not participate in address allocation. For example, assuming the configured global address pool replica of the target cluster is written to the first cluster, the disable flag in the configured global address pool replica of the target cluster indicates that the global address pool of the target cluster does not participate in address allocation in the first cluster. Annotations are used to embed next-hop node information leading to the target cluster.
[0039] In one optional implementation, receiving the configured global address pool copies corresponding to each cluster other than the first cluster in a multi-cluster environment includes: receiving the configured global address pool copies corresponding to each cluster other than the first cluster issued by the cross-cloud orchestration platform Karmada.
[0040] Karmada is a Kubernetes multi-cluster orchestration tool. In this embodiment, the configured global address pool replicas for each of the other clusters can be distributed to the first cluster in the form of resource objects.
[0041] In one optional implementation, based on the received configured global address pool replicas, the address network segments of other clusters and the next-hop node information leading to other clusters are extracted and written into the local routing table of each node of the first cluster, including: monitoring each configured global address pool replica through the node agent calico-node running in each node of the first cluster, extracting the address network segments of other clusters and the next-hop node information leading to other clusters from each configured global address pool replica, and writing them into the local routing table of the node of the first cluster.
[0042] calico is a Kubernetes container networking plugin. calico-node is a daemon process that exists on each node of the cluster and is used to configure the network settings on the node.
[0043] In this embodiment of the disclosure, the node agent calico-node running in each node of the first cluster listens to resource objects, obtains each configured global address pool copy, extracts the address network segments of other clusters and the next-hop node information leading to other clusters from each configured global address pool copy, and writes it into the local routing table of the first cluster node.
[0044] In this embodiment of the disclosure, the configured global address pool replicas are distributed through Karmada, reusing the flexible configuration capabilities of Calico. When business requirements change, the network configuration can be quickly and flexibly adjusted without introducing additional network components or consuming additional system resources, thereby achieving efficient and lightweight multi-cluster network management.
[0045] Furthermore, to ensure the stability of network communication in a multi-cluster environment, in one optional implementation, the addresses of the global address pools of each cluster in the multi-cluster environment do not overlap.
[0046] Step 102: Based on the address network segment to which the second node belongs, determine the next-hop node information corresponding to the address network segment from the local routing table of the first node; wherein, the local routing table is configured with the address network segments of each cluster other than the first cluster in the multi-cluster environment and the next-hop node information leading to each of the other clusters.
[0047] In this embodiment of the disclosure, after the first cluster initiates a network communication request to the second node in the second cluster using its first node, it obtains the address network segment to which the second node belongs, queries the local routing table of the first node to see if the address network segment to which the second node belongs exists, and if the address network segment to which the second node belongs exists in the local routing table of the first node, it determines the next-hop node information corresponding to the address network segment from the local routing table of the first node based on the address network segment to which the second node belongs.
[0048] Step 103: Based on the next-hop node information corresponding to the address network segment, encapsulate the data packet of the network communication request and forward it to the next-hop node so that the data packet can be transmitted to the second node.
[0049] In this embodiment of the disclosure, after the first node of the first cluster determines the next-hop node information corresponding to the address network segment to which the second node belongs, the data packet of the network communication request is encapsulated and forwarded to the next-hop node based on the next-hop node information corresponding to the address network segment, so that the data packet is transmitted to the second node. Thus, cross-cluster network communication can be realized without introducing additional components.
[0050] The multi-cluster network communication scheme provided in this disclosure is applied to a first cluster. It includes: initiating a network communication request from a first node in the first cluster to a second node in the second cluster; determining the next-hop node information corresponding to the address network segment from the local routing table of the first node, based on the address network segment to which the second node belongs; wherein the local routing table is configured with the address network segments of all clusters in the multi-cluster environment other than the first cluster, as well as the next-hop node information leading to each of the other clusters; and encapsulating and forwarding the data packet of the network communication request to the next-hop node based on the next-hop node information corresponding to the address network segment, so that the data packet is transmitted to the second node. Using the above technical solution, cross-cluster network communication can be achieved without introducing additional components, thereby avoiding problems such as resource consumption, routing rule conflicts, and overlapping network configurations caused by deploying additional components.
[0051] To facilitate understanding of the above embodiments, the routing table configuration process for multi-cluster network communication will be introduced first.
[0052] First, a global address pool is pre-allocated to each cluster in the multi-cluster environment, ensuring that the addresses in the global address pools allocated to each cluster do not overlap. Then, replicas of the global address pools in each cluster are created and modified. Specifically, each replica of the global address pool is labeled with a first tag, marking it as an external address pool; a second tag is assigned, marking it as originating from a specific cluster; a disabled flag is set for each replica, preventing it from participating in address allocation; and an annotation is added to each replica, marking its next-hop node information (i.e., the node reachable within the next-hop selection cluster). This yields the configured global address pool replicas for each cluster. The next-hop node information includes the Media Access Control (MAC) address of the network interface card used by the next-hop tunnel endpoint interface in the virtual extended LAN, and the IP address of the network interface card used by the next-hop tunnel endpoint interface in the virtual extended LAN.
[0053] The configured global address pool replicas for each cluster are written to Karmada, and distribution rules are configured to distribute these replicas to all clusters except the source cluster. The routing configuration module of the node proxy calico-node running on each cluster node is modified to convert the next-hop information received from the configured global address pool replicas into routes and configure them in the operating system. This achieves routing table configuration for cluster network communication, enabling cross-cluster network communication without introducing additional components. This avoids resource consumption, routing rule conflicts, and network configuration overlap issues caused by deploying additional components.
[0054] Figure 2 This is a flowchart illustrating another multi-cluster network communication method provided in this embodiment of the present disclosure. Taking cluster A as the first cluster, node A1 as the first node, cluster B as the second cluster, and node B2 as the second node, the method will be described in detail below.
[0055] First, the configured global address pool replicas for cluster A and cluster B are written to Karmada. Karmada then distributes these replicas according to the distribution rules, sending the global address pool replica for cluster B to cluster A and vice versa. The global address pool replica for cluster A includes the address network segment of cluster A and the next-hop node information leading to cluster A, while the global address pool replica for cluster B includes the address network segment of cluster B and the next-hop node information leading to cluster B.
[0056] Then, using the calico-nodes running on nodes A1 and A2 in cluster A, the configured global address pool replica corresponding to cluster B is monitored. Upon detecting the configured global address pool replica of cluster B, the address network segment of cluster B and the next-hop node information leading to cluster B are extracted from the configured global address pool replica of cluster B and written into the local routing tables of nodes A1 and A2. Similarly, using the calico-nodes running on nodes B1 and B2 in cluster B, the configured global address pool replica corresponding to cluster A is monitored. Upon detecting the configured global address pool replica of cluster A, the address network segment of cluster A and the next-hop node information leading to cluster A are extracted from the configured global address pool replica of cluster A and written into the local routing tables of nodes B1 and B2.
[0057] For the scenario where node A1 accesses node B2, node A1 first determines the next-hop node information for node B2 from its local routing table. Assuming node B2's next-hop node is B1, the traffic first reaches node B1, and then node B1 distributes it to node B2. For the scenario where node B2 sends a response back to node A1, node B2 determines the next-hop node information for node A1 from its local routing table. Assuming node A1's next-hop node is A2, the traffic first reaches node A2, and then node A2 distributes it to node A1.
[0058] The node agent calico-node is a daemon process existing on each node of the cluster, used to configure the network configuration on the node. The virtual extended LAN tunnel endpoint interface vxlan.calicovtep is an overlay network access point based on the virtual extended LAN (VXLAN), used for network interconnection between containers on all nodes in the cluster. After configuring the global address pool for the cluster, each node will be allocated a small segment of address network (IP block). calico-node can determine which node each IP block is on, and calico-node will also configure the routing information of the IP block on the node.
[0059] Therefore, cross-cluster network communication can be achieved without introducing additional components, thus avoiding problems such as resource consumption, routing rule conflicts, and network configuration overlap caused by deploying additional components.
[0060] Figure 3 This is a schematic diagram of a multi-cluster network communication device provided in an embodiment of the present disclosure. The device is applied to a first cluster and can be implemented by software and / or hardware, and is generally integrated into an electronic device. Figure 3 As shown, it includes:
[0061] The request initiation module 301 is used to initiate a network communication request to the second node in the second cluster using the first node in the first cluster.
[0062] The determining module 302 is used to determine the next-hop node information corresponding to the address network segment from the local routing table of the first node based on the address network segment to which the second node belongs; wherein, the local routing table is configured with the address network segments of each cluster other than the first cluster in a multi-cluster environment and the next-hop node information leading to each of the other clusters;
[0063] The forwarding module 303 is used to encapsulate and forward the data packet of the network communication request to the next-hop node based on the next-hop node information corresponding to the address network segment, so that the data packet is transmitted to the second node.
[0064] In one optional embodiment, the apparatus further includes:
[0065] The receiving module is used to receive the configured global address pool replicas corresponding to each cluster other than the first cluster in the multi-cluster environment; wherein each configured global address pool replica includes the address network segment of its own cluster and the next-hop node information leading to the own cluster;
[0066] The extraction module is used to extract the address network segments of other clusters and the next-hop node information leading to the other clusters based on the received global address pool replicas and write them into the local routing table of each node of the first cluster, so as to realize the routing configuration for cross-cluster network communication.
[0067] In one optional implementation, the other clusters include a target cluster. The configured global address pool replica of the target cluster is obtained by adding a first tag, a second tag, setting a disable flag, and adding annotations to the global address pool replica of the target cluster. The first tag is used to mark the replica as an external address pool, the second tag is used to mark the source cluster of the replica, the disable flag is used to prohibit the replica from participating in address allocation, and the annotations are used to mark the next-hop node information.
[0068] In one optional implementation, the next-hop node information includes the Internet Protocol (IP) address of the next-hop node management network, the Media Access Control (MAC) address of the network interface card used by the next-hop tunnel endpoint interface in the Virtual Extended Local Area Network (VLAN), and the IP address of the network interface card used by the next-hop tunnel endpoint interface in the VLAN.
[0069] In one optional implementation, the receiving module is specifically used for:
[0070] Receive the configured global address pool replicas for each cluster other than the first cluster from the cross-cloud orchestration platform Karmada.
[0071] The extraction module is specifically used for:
[0072] The node agent calico-node running in each node of the first cluster monitors each configured global address pool replica, extracts the address network segments of other clusters and the next-hop node information leading to the other clusters from each configured global address pool replica, and writes them into the local routing table of the first cluster node.
[0073] In one optional implementation, the addresses of the global address pools of each cluster in the multi-cluster environment do not overlap.
[0074] The multi-cluster network communication device provided in this disclosure can execute the multi-cluster network communication method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of executing the method.
[0075] A computer program product includes a computer program / instructions that, when executed by a processor, implement the steps of the above-described multi-cluster network communication method.
[0076] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure.
[0077] The following is a detailed reference. Figure 4 The diagram illustrates a structural schematic suitable for implementing the electronic device 400 in the embodiments of this disclosure. The electronic device 400 in the embodiments of this disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (PADs), portable media players (PMPs), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 4 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0078] like Figure 4As shown, the electronic device 400 may include a processing unit 401 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 402 or a program loaded from storage device 408 into random access memory (RAM) 403. The RAM 403 also stores various programs and data required for the operation of the electronic device 400. The processing unit 401, ROM 402, and RAM 403 are interconnected via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0079] Typically, the following devices can be connected to I / O interface 405: input devices 406 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 407 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 408 including, for example, magnetic tapes, hard disks, etc.; and communication devices 409. Communication device 409 allows electronic device 400 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 4 An electronic device 400 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0080] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 409, or installed from storage device 408, or installed from ROM 402. When the computer program is executed by processing device 401, it performs the functions defined in the multi-cluster network communication method of embodiments of this disclosure.
[0081] It should be noted that the computer-readable medium described above in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory, a read-only memory, an electrically erasable programmable read-only memory (EPROM), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. The transmitted data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, radio frequency (RF), etc., or any suitable combination thereof.
[0082] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol, such as Hypertext Transfer Protocol (HTTP), and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include Local Area Networks (LANs), Wide Area Networks (WANs), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0083] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0084] The aforementioned computer-readable medium carries one or more programs. When the aforementioned one or more programs are executed by the electronic device, the electronic device causes the electronic device to: initiate a network communication request to a second node in a second cluster using a first node in a first cluster; determine the next-hop node information corresponding to the address network segment from the local routing table of the first node based on the address network segment to which the second node belongs; wherein the local routing table is configured with the address network segments of all other clusters in the multi-cluster environment except the first cluster and the next-hop node information leading to the other clusters; and encapsulate and forward the data packet of the network communication request to the next-hop node based on the next-hop node information corresponding to the address network segment, so that the data packet is transmitted to the second node.
[0085] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including local area networks (LANs) or wide area networks (WANs), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0086] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0087] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units are not, in some cases, intended to limit the specific unit.
[0088] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field-Programmable Gate Array (FPGA), Application-Specific Integrated Circuit (ASIC), Application-Specific Standard Parts (ASSP), System-on-Chip (SOC), Complex Programmable Logic Device (CPLD), and so on.
[0089] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, flash memory, optical fiber, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0090] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0091] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0092] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0093] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A multi-cluster network communication method, characterized in that, The method is applied to a first cluster, and the method includes: Receive the configured global address pool replicas for each cluster other than the first cluster from the cross-cloud orchestration platform Karmada. The node agent calico-node running in each node of the first cluster listens to each configured global address pool replica, extracts the address network segments of other clusters and the next-hop node information to other clusters from each configured global address pool replica, and writes them into the local routing table of the first cluster node to realize the routing configuration for cross-cluster network communication. The first node in the first cluster initiates a network communication request to the second node in the second cluster; Based on the address network segment to which the second node belongs, the next-hop node information corresponding to the address network segment is determined from the local routing table of the first node; wherein, the local routing table is configured with the address network segments of each cluster other than the first cluster in a multi-cluster environment and the next-hop node information leading to each of the other clusters; Based on the next-hop node information corresponding to the address segment, the data packet of the network communication request is encapsulated and forwarded to the next-hop node so that the data packet is transmitted to the second node.
2. The method according to claim 1, characterized in that, Each configured global address pool replica includes the address network segment of its parent cluster and information about the next-hop node leading to that parent cluster.
3. The method according to claim 2, characterized in that, The other clusters include the target cluster. The configured global address pool replica of the target cluster is obtained by adding a first tag, a second tag, a disable flag, and an annotation to the global address pool replica of the target cluster. The first tag is used to mark the replica as an external address pool, the second tag is used to mark the source cluster of the replica, the disable flag is used to prohibit the replica from participating in address allocation, and the annotation is used to mark the next-hop node information.
4. The method according to claim 1, characterized in that, The next-hop node information includes the Internet Protocol (IP) address of the next-hop node management network, the Media Access Control (MAC) address of the network interface card used by the next-hop tunnel endpoint interface in the Virtual Extended Local Area Network (VLAN), and the IP address of the network interface card used by the next-hop tunnel endpoint interface in the VLAN.
5. The method according to claim 3, characterized in that, In the multi-cluster environment, the addresses of the global address pools of each cluster do not overlap.
6. A multi-cluster network communication device, characterized in that, The device is applied to a first cluster, and the device includes: The receiving module is used to receive the configured global address pool replicas for each cluster other than the first cluster issued by the cross-cloud orchestration platform Karmada. The extraction module is used to listen to each configured global address pool replica through the node agent calico-node running in each node of the first cluster, extract the address network segments of other clusters and the next-hop node information leading to the other clusters from each configured global address pool replica, and write them into the local routing table of the first cluster node to realize the routing configuration for cross-cluster network communication. The request initiation module is used to initiate a network communication request from the first node in the first cluster to the second node in the second cluster. The determination module is used to determine the next-hop node information corresponding to the address network segment from the local routing table of the first node based on the address network segment to which the second node belongs; wherein, the local routing table is configured with the address network segments of each cluster other than the first cluster in a multi-cluster environment and the next-hop node information leading to each of the other clusters; The forwarding module is used to encapsulate and forward the data packet of the network communication request to the next-hop node based on the next-hop node information corresponding to the address network segment, so that the data packet is transmitted to the second node.
7. An electronic device, characterized in that, The electronic device includes: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the multi-cluster network communication method according to any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The storage medium stores a computer program for executing the multi-cluster network communication method according to any one of claims 1-5.
9. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the multi-cluster network communication method described in any one of claims 1-5.
Citation Information
Patent Citations
Multi-cluster network communication method and device, computer equipment, readable storage medium and program product
CN119363839A
