A network configuration method and server in a container cloud platform environment

By introducing a second network component into the container cloud platform for network configuration, the problem of needing to modify network components in existing technologies is solved, achieving efficient tunnel mode communication and performance improvement.

CN117278395BActive Publication Date: 2026-06-09JUHAOKAN TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JUHAOKAN TECH CO LTD
Filing Date
2022-12-28
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

In container cloud platform environments, existing technologies require modifications to network components to support LVS tunnel mode, resulting in inconvenient maintenance and degraded network response performance.

Method used

The network is configured using the second network component, and a second connection is established to enable tunnel-mode communication between microservice instances and terminal devices without modifying the first network component of the container cloud platform.

Benefits of technology

It improves network response performance, facilitates maintenance and modification, and simplifies the access process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117278395B_ABST
    Figure CN117278395B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a network configuration method and server in a container cloud platform environment, and particularly relates to the field of computer communication; the method comprises the following steps: determining the type of the micro-service instance which needs to be configured according to the network configuration request of the micro-service instance; when the type is a tunnel mode supporting LVS, performing first network configuration through a first network component according to first configuration information in the network configuration request, and performing second network configuration through a configuration component corresponding to a second network component according to second configuration information in the network configuration request, wherein the first network configuration is used to establish a first connection, the second configuration information comprises a virtual IP address of LVS, and the second network configuration is used to establish a second connection. According to the present disclosure, the second network configuration can support sending response data packets to a terminal device through a tunnel mode, without modifying the first network component of the container cloud platform, which is beneficial to maintenance and modification and facilitates access.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer communications, and in particular to a network configuration method and server in a container cloud platform environment. Background Technology

[0002] In a container cloud platform cluster environment, a large number of microservices are deployed. Each microservice can have one or more microservice instances (Pods) running on one or more servers of the cloud platform.

[0003] To facilitate access, especially when containers provide access to environments outside the cluster (such as user terminal devices), a load balancing system, such as a Linux Virtual Server (LVS), is typically deployed. The LVS system provides a unified Internet Protocol (IP) address or domain name for external access and forwards received access requests to the actual Pods. After receiving the request data packet from the client (i.e., the user's terminal device), LVS can process it using a tunnel (TUN) mode. However, this mode requires the Pod to support sending responses using the LVS virtual IP address, which may require modifications to the network components of the container cloud platform. This is inconvenient for maintenance and modification, causing inconvenience for actual access. Summary of the Invention

[0004] To address the aforementioned technical issues, or at least partially address them, this disclosure provides a network configuration method and server in a container cloud platform environment. By configuring the second network through a configuration component corresponding to the second network component, microservice instances can support sending response data packets to terminal devices via tunnel mode without modifying the first network component of the container cloud platform. This method also improves network response performance, facilitates maintenance and modification, and makes access easier.

[0005] To achieve the above objectives, the technical solutions provided by the embodiments of this disclosure are as follows:

[0006] Firstly, this disclosure provides a network configuration method for a container cloud platform environment, applied to a server of the container cloud platform, the method comprising:

[0007] Based on the network configuration request of the microservice instance, determine the type of microservice instance that needs to be configured;

[0008] When the type is a tunnel mode supporting Linux Virtual Server (LVS), a first network configuration is performed through a first network component based on the first configuration information in the network configuration request, and a second network configuration is performed through a configuration component corresponding to the second network component based on the second configuration information in the network configuration request. The first configuration information includes parameter information corresponding to the microservice instance, and the first network configuration is used to establish a first connection so that the microservice instance receives request data packets sent by the terminal device through the first connection. The second configuration information includes the virtual Internet Protocol (IP) address of the LVS, and the second network configuration is used to establish a second connection so that the microservice instance sends response data packets to the terminal device through the second connection.

[0009] Secondly, this disclosure provides a server for a container cloud platform, the server comprising:

[0010] The controller is configured as follows:

[0011] Based on the network configuration request of the microservice instance, determine the type of microservice instance that needs to be configured;

[0012] When the type is a tunnel mode supporting Linux Virtual Server (LVS), a first network configuration is performed through a first network component based on the first configuration information in the network configuration request, and a second network configuration is performed through a configuration component corresponding to the second network component based on the second configuration information in the network configuration request. The first configuration information includes parameter information corresponding to the microservice instance, and the first network configuration is used to establish a first connection so that the microservice instance receives request data packets sent by the terminal device through the first connection. The second configuration information includes the virtual Internet Protocol (IP) address of the LVS, and the second network configuration is used to establish a second connection so that the microservice instance sends response data packets to the terminal device through the second connection.

[0013] Thirdly, this disclosure provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the network configuration method in a container cloud platform environment as described in the first aspect.

[0014] Fourthly, this application provides a computer program product that, when run on a computer, enables the computer to implement the network configuration method in a container cloud platform environment as described in the first aspect.

[0015] Compared with the prior art, the technical solutions provided by some embodiments of this disclosure have the following advantages: Based on the network configuration request of the microservice instance, the type of the microservice instance to be configured is determined. When the type of the microservice instance is a tunnel mode supporting LVS, a first network configuration is performed through a first network component based on the first configuration information in the network configuration request, and a second network configuration is performed through a configuration component corresponding to the second network component based on the second configuration information in the network configuration request. The first configuration information includes parameter information corresponding to the microservice instance, and the first network configuration is used to establish a first connection so that the microservice instance can receive request data packets sent by the terminal device through the first connection. The second configuration information includes the virtual IP address of LVS, and the second network configuration is used to establish a second connection so that the microservice instance can send response data packets to the terminal device through the second connection. In the above technical solution, performing the second network configuration through the configuration component corresponding to the second network component enables the microservice instance to support sending response data packets to the terminal device through the tunnel mode, without requiring modification of the first network component of the container cloud platform, and can improve network response performance, facilitate maintenance and modification, and facilitate access. Attached Figure Description

[0016] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0017] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1A This is a schematic diagram illustrating how network address translation (NAT) can be used to access Linux virtual servers to enable communication between terminal devices and microservice instances.

[0019] Figure 1B This is a diagram illustrating the access process between different microservice instances on the same server in related technologies.

[0020] Figure 1C This diagram illustrates the access process between microservice instances on different servers in related technologies.

[0021] Figure 2A A flowchart illustrating a network configuration method in a container cloud platform environment provided by some embodiments of this disclosure;

[0022] Figure 2BThis is a schematic diagram illustrating a network configuration process based on the interaction between a server, a first network component, a second network component, and a configuration component, provided for some embodiments of this disclosure.

[0023] Figure 3A This diagram illustrates how tunnel-mode access to a Linux virtual server enables communication between terminal devices and microservice instances, as provided in some embodiments of this disclosure.

[0024] Figure 3B A schematic diagram illustrating the access process between different microservice instances on the same server, provided for some embodiments of this disclosure;

[0025] Figure 3C This is a schematic diagram illustrating the access process between microservice instances in different servers provided in some embodiments of this disclosure;

[0026] Figure 4A A schematic diagram illustrating the principle of another network configuration method in a container cloud platform environment provided by some embodiments of this disclosure;

[0027] Figure 4B This is a schematic diagram illustrating a network deletion process based on the interaction between a server, a first network component, a second network component, and a configuration component, provided for some embodiments of this disclosure.

[0028] Figure 5 This is a schematic diagram of the structure of a network configuration device in a container cloud platform environment provided in some embodiments of this disclosure;

[0029] Figure 6 This is a schematic diagram of the structure of an electronic device provided in some embodiments of this disclosure. Detailed Implementation

[0030] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0031] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.

[0032] It should be noted that the brief descriptions of terms in this disclosure are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise stated, these terms should be understood in their ordinary and common meaning.

[0033] It should be noted that in this disclosure, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. For example, a product or apparatus that comprises a list of components is not necessarily limited to all components expressly listed, but may include other components not expressly listed or inherent to such product or apparatus.

[0034] The container cloud platform cluster environment can be Kubernetes or other environments; this embodiment is not limited to any particular environment. Kubernetes is a portable and scalable open-source platform used to manage containerized workloads and services. In Kubernetes, multiple microservice instances (pods, also known as container instances) run distributed across one or more servers on the cloud platform. These servers can also be called host machines, and each server can be called a node; a node can also be a virtual machine. The container cloud platform (also known as the cloud platform) assigns each microservice instance an independent and dedicated Internet Protocol (IP) address during its runtime, used for communication between different microservice instances or between microservice instances and terminal devices outside the container cloud cluster. When a microservice instance needs to be upgraded, expanded, or scaled down, the cloud platform can create a new microservice instance or delete an existing one according to the operation instructions. The new microservice instance corresponds to a new, dedicated IP address.

[0035] Since there may be multiple servers in a container cloud platform, and each server may have multiple microservice instances, the list of IP addresses of all microservice instances on the server may also change. In order to facilitate access, especially to provide access to the environment outside the cluster (e.g., users' terminal devices), a load balancing system is usually deployed. The load balancing system provides a unified access IP address or domain name to the outside world and forwards the access requests it receives to the actual microservice instances.

[0036] Typically, a load balancing system can be a Linux Virtual Server (LVS), but other devices are also possible; this is not a limitation. LVS uses Internet Protocol Virtual Server (IPVS) technology to implement the aforementioned forwarding functions. LVS provides a unified virtual service, which includes access IP (virtual IP) addresses, access protocols, and ports. Each virtual service can be configured with one or more sets of microservice instance IP addresses and ports. The microservice instance corresponding to the IP address and port of that virtual service is the real server of that virtual service.

[0037] When LVS receives a request data packet from the client (i.e., the terminal device used by the user), there are three processing modes:

[0038] 1. Direct Routing (DR) mode: The destination Media Access Control (MAC) address of the request packet is modified to the MAC address of a microservice instance, and the request packet is forwarded to that microservice instance. The microservice instance uses the virtual IP address of LVS to send the response packet to the terminal device. This mode requires the microservice instance and LVS to be in the same Layer 2 subnet (i.e., local area network), which has greater restrictions on network topology.

[0039] 2. Tunnel (TUN) mode: The request data packet is forwarded to a microservice instance using an IP-in-IP tunnel. The microservice instance uses the virtual IP of LVS to send the response data packet to the terminal device. This mode requires the microservice instance to support the establishment of an IP-in-IP tunnel with LVS, and does not require the microservice instance and LVS to be on the same Layer 2 subnet.

[0040] 3. Network Address Translation (NAT) mode: The destination IP address of the request packet is modified to the IP address corresponding to a microservice instance. The microservice instance uses this IP address to send the response packet to LVS. LVS uses its virtual IP address to send the response packet to the terminal device. Since both the response packet and the request packet need to be forwarded through LVS, it will increase network overhead.

[0041] For example, Figure 1A This diagram illustrates how network address translation (NAT) can be used to access a Linux virtual server to enable communication between terminal devices and microservice instances. (Example:) Figure 1AAs shown, taking microservice instance 11 in server 1 as an example, microservice instance 11 is configured with network interface card a, and server 1 is configured with virtual network interface card a and network interface card 1. After the terminal device sends the request data packet to LVS, LVS sends the request data packet to microservice instance 11 through NAT mode (that is, the request data packet flow is: terminal device - LVS - network interface card 1 - virtual network interface card a - network interface card a). After microservice instance 11 processes the received request data packet, it first sends the response data packet to LVS through NAT mode, and then LVS sends the response data packet to the terminal device (that is, the response data packet flow is: network interface card a - virtual network interface card a - network interface card 1 - LVS - terminal device).

[0042] It should be noted that: Figure 1A The server 1, microservice instance 11, network interface card a, network interface card 1 and virtual network interface card a shown are for illustrative purposes only and are not intended to limit them in any specific way.

[0043] For example, Figure 1B This diagram illustrates the access process between different microservice instances on the same server in related technologies. For example... Figure 1B As shown, taking microservice instance 11 and microservice instance 12 in server 1 as examples, microservice instance 11 is configured with network card a, microservice instance 12 is configured with network card b, server 1 is configured with virtual network card a, virtual network card b and network card 1. Microservice instance 11 and microservice instance 12 can access each other through network card a, virtual network card a, virtual network card b and network card b.

[0044] It should be noted that: Figure 1B The server 1, microservice instance 11, microservice instance 12, network interface a, network interface b, network interface 1, network interface a, and virtual network interface b shown are for illustrative purposes only and are not intended to limit them in any specific way.

[0045] For example, Figure 1C This diagram illustrates the access process between microservice instances on different servers in related technologies. For example... Figure 1C As shown, taking microservice instance 11 in server 1 and microservice instance 21 in server 2 as examples, microservice instance 11 is configured with network card a, server 1 is configured with virtual network card a and network card 1, microservice instance 21 is configured with network card c, server 2 is configured with virtual network card c and network card 2. Microservice instance 11 and microservice instance 21 can access each other through network card a, virtual network card a, network card 1, network card 2, virtual network card c and network card c.

[0046] It should be noted that: Figure 1CThe server 1, server 2, microservice instance 11, microservice instance 21, network interface card a, virtual network interface card a, network interface card 1, network interface card c, virtual network interface card c, and network interface card 2 shown are for illustrative purposes only and are not intended to limit them in any specific way.

[0047] Regarding the three modes mentioned above: 1. In DR mode, due to the complexity of container cloud networks, the network of microservice instances and the server network are usually not in the same Layer 2 subnet, making DR mode difficult to apply. 2. In TUN mode, although microservice instances can establish IP-in-IP tunnels with LVS, the microservice instances need to support using LVS's virtual IP address, rather than the IP address assigned to the microservice instance for responses. However, in a container cloud environment, the cloud platform's network components provide a separate IP address for each microservice instance. Furthermore, for the need for resource isolation between different microservice instances, the cloud platform typically uses stateful firewalls and other functions to restrict each microservice instance to using only its assigned IP address for data transmission and reception. Therefore, in this mode, modifications to the container cloud platform's network components are required, and these modifications significantly intrude on the existing logic of the network components, making maintenance difficult and even inconvenient. 3. If a microservice instance under a container cloud platform accesses LVS through NAT mode, it can ensure that the microservice instance uses its assigned IP address to complete data sending and receiving. However, this also means that the request data packets from the terminal device to the microservice instance and the response data packets from the microservice instance to the terminal device are forwarded through LVS. Compared with DR mode or TUN mode, LVS has greater network overhead in NAT mode, which can easily become a performance bottleneck and affect the business processing capabilities of the entire cloud platform.

[0048] To address the aforementioned issues, this disclosure proposes a network configuration method for a container cloud platform environment. Based on the network configuration request of a microservice instance, the type of microservice instance requiring configuration is determined. When the microservice instance type supports LVS tunnel mode, a first network configuration is performed using a first network component based on the first configuration information in the network configuration request (i.e., the parameter information corresponding to the microservice instance). A second network configuration is performed using the configuration component corresponding to the second network component based on the second configuration information in the network configuration request (i.e., the virtual IP address of LVS). The first network configuration establishes a first connection, enabling the microservice instance to receive request data packets sent by the terminal device through the first connection. The second configuration establishes a second connection, enabling the microservice instance to send response data packets to the terminal device through the second connection. This technical solution, by performing the second network configuration through the configuration component corresponding to the second network component, enables the microservice instance to support sending response data packets to the terminal device through tunnel mode without modifying the first network component of the container cloud platform. It also improves network response performance, facilitates maintenance and modification, and enhances accessibility. To illustrate the solution in this disclosure in more detail, the following will use exemplary methods in conjunction with… Figure 2A To explain, it is understandable that Figure 2A The steps involved may include more or fewer steps in actual implementation, and the order of these steps may also be different, depending on whether the network configuration method in the container cloud platform environment provided in the embodiments of this application can be implemented.

[0049] Figure 2A This is a flowchart illustrating a network configuration method in a container cloud platform environment, provided by some embodiments of this disclosure. This embodiment is applicable to situations where the microservice instance to be configured is of type supporting LVS tunnel mode, and the network configuration process is described. The method of this embodiment can be executed by a network configuration device in a container cloud platform environment, which can be implemented in hardware / software and configured in an electronic device.

[0050] like Figure 2A As shown, the method specifically includes the following steps:

[0051] S210, based on the network configuration request of the microservice instance, determine the type of microservice instance that needs to be configured.

[0052] Microservice instances can be understood as instances deployed on servers in a cloud platform. In terms of computing form, it is a lightweight virtualization technology. Usually, it is pre-packaged so that developers can call it according to their own needs. By starting the call command, the resources can be called.

[0053] Specifically, when an operator sends a network configuration request for a microservice instance to the container cloud platform, the central server of the container cloud platform can receive the network configuration request. Then, the central server sends the network configuration request to other servers of the container cloud platform. When the servers of the container cloud platform receive the network configuration request, they parse the network configuration request. By analyzing the fields in the parsed network configuration request, the type of microservice instance that needs to be configured can be determined. This type can include tunnel mode that supports LVS, or tunnel mode that does not support LVS, such as other modes of LVS, or not using LVS, etc. The specific mode is not limited here.

[0054] S220, when the type is a tunnel mode supporting LVS, the first network configuration is performed through the first network component according to the first configuration information in the network configuration request, and the second network configuration is performed through the configuration component corresponding to the second network component according to the second configuration information in the network configuration request.

[0055] The first configuration information includes parameter information corresponding to the microservice instance, such as the name of the microservice instance, server name, and namespace name, etc., which are not specifically limited in this embodiment. The first network configuration is used to establish a first connection so that the microservice instance can receive request data packets sent by the terminal device through the first connection. The second configuration information includes the virtual IP address of LVS. The second network configuration is used to establish a second connection so that the microservice instance can send response data packets to the terminal device through the second connection. The first network component can be Calico or other components, which are not specifically limited in this embodiment. The first network component can be a software module or functional module that is inherent in the container cloud platform. The second network component and the configuration component corresponding to the second network component can be understood as a pre-designed application, software module, or functional module with corresponding functions, used to implement the corresponding functions. The second network component can be applied to the container cloud platform. Assuming that the container cloud platform cluster environment is a Kubernetes platform, the second network component conforms to the Kubernetes Container Network Interface (CNI) specification.

[0056] When the microservice instance to be configured is of type that supports LVS tunnel mode, it means that network configuration is required for the microservice instance so that when LVS receives a request data packet from the terminal device, it sends the request data packet to the configured microservice instance through tunnel mode, and the configured microservice instance can send response data packets to the terminal device through tunnel mode.

[0057] Based on this, this disclosure adds a second network component to the existing first network component of the container cloud platform, replacing the original first network component. The second network component receives network configuration requests from the container cloud platform. When the microservice instance to be configured supports LVS tunnel mode, the second network component receives the network configuration request from the container cloud platform server and calls the first network component. The first network component performs the first network configuration based on the first configuration information, i.e., basic network configuration, such as configuring the network interface card (NIC) in the microservice instance on the server, and configuring virtual NICs, routing, and firewalls on the server. Correspondingly, after the first network configuration is completed, based on the first connection established during the first network configuration process (i.e., the server NIC, the virtual NIC configured on the server, and the NIC configured in the microservice instance), when LVS receives a request data packet from the terminal device, LVS uses its own actual IP address as the source IP address and the actual IP address of the microservice instance as the destination IP address. Through the first connection, it can send the request data packet to the microservice instance, thus enabling the microservice instance to receive the request data packet from the terminal device through the first connection. Furthermore, after the first network component completes the first network configuration, it will send a first network configuration response to the second network component, which is the result of the first network configuration. The second network component can then receive and record the first network configuration response fed back by the first network component.

[0058] Then, the second network component sends a network configuration request to its corresponding configuration component. This configuration component performs second network configuration based on the second configuration information, primarily establishing a second connection (different from the first connection). This allows the microservice instance to send response data packets to the terminal device via the second connection. When the microservice instance sends the response data packet to the terminal device via the second connection, it uses the LVS virtual IP address as the source IP address and the terminal device's IP address as the destination IP address, thus enabling access between the microservice instance and the terminal device using LVS tunneling mode in the container cloud platform environment. Correspondingly, after completing the second network configuration, the configuration component also sends a second network configuration response, i.e., the result of the second network configuration, back to the second network component. The second network component can then receive and record this second network configuration response.

[0059] The network configuration method for a server in a container cloud platform environment provided in this disclosure determines the type of microservice instance to be configured based on the network configuration request of the microservice instance. When the type of the microservice instance is a tunnel mode supporting LVS, a first network configuration is performed through a first network component based on the first configuration information in the network configuration request, and a second network configuration is performed through a configuration component corresponding to the second network component based on the second configuration information in the network configuration request. The first configuration information includes parameter information corresponding to the microservice instance, and the first network configuration is used to establish a first connection so that the microservice instance can receive request data packets sent by the terminal device through the first connection. The second configuration information includes the virtual IP address of LVS, and the second network configuration is used to establish a second connection so that the microservice instance can send response data packets to the terminal device through the second connection. In the above technical solution, the second network configuration is performed through the configuration component corresponding to the second network component, which enables the microservice instance to support sending response data packets to the terminal device through the tunnel mode without modifying the first network component of the container cloud platform, and can improve network response performance, facilitate maintenance and modification, and facilitate access.

[0060] For example, Figure 2B This diagram illustrates a network configuration process based on the interaction between a server, a first network component, a second network component, and a configuration component, as provided in some embodiments of this disclosure. Figure 2B As shown, the specific steps include the following:

[0061] S2001, the server controller determines the type of microservice instance that needs to be configured based on the network configuration request of the microservice instance.

[0062] Here, "server" refers to the server of the container cloud platform.

[0063] See the description in S210, which will not be repeated here.

[0064] S2002, when the type is LVS-supported tunnel mode, the server controller sends a network configuration request to the second network component.

[0065] S2003, the second network component sends a network configuration request to the first network component.

[0066] S2004, the first network component performs the first network configuration based on the first configuration information in the network configuration request.

[0067] S2005, the second network component sends a network configuration request to the configuration component corresponding to the second network component.

[0068] S2006, The configuration component corresponding to the second network component performs the second network configuration according to the second configuration information in the network configuration request.

[0069] In some embodiments, in order to maintain compatibility between the first network component and the second network component in the container cloud platform, the second configuration information can be stored in the annotation field of the network configuration request. Therefore, the first network component can ignore the second configuration information in the annotation field.

[0070] In some embodiments, optionally, configuring the second network through a configuration component corresponding to the second network component may include:

[0071] Virtual network interface card (NIC) pairs are established in the server by configuring components;

[0072] Configure network routing rules through the configuration component, and establish a second connection based on the network routing rules.

[0073] Specifically, a virtual network interface card (NIC) pair is established on the container cloud platform server through the configuration component corresponding to the second network component. Network routing rules are configured through this component, primarily involving: modifying system configuration information so that the server-side NIC of the aforementioned virtual NIC pair can respond to Address Resolution Protocol (ARP) requests to the specified gateway IP address; setting up routing within the microservice instance to use the virtual NIC configured within the microservice instance to access the specified gateway; adding a new routing table specifying a default route originating from the virtual NIC configured within the microservice instance via the specified gateway IP address; and adding a policy-based route so that response packets with a source IP address of LVS's virtual IP address are sent using the virtual NIC configured within the microservice instance, rather than the NIC configured on the server's microservice instance by the first network component. Through these network routing rules, a second connection is established, allowing response packets to reach the server's NIC via the virtual NIC pair and then be sent to the terminal device by the server's NIC.

[0074] In some embodiments, establishing a second connection through the above process is efficient and fast, and does not affect the use of the first component in the container cloud platform, facilitating subsequent maintenance and modification of the second network component. It offers high operability.

[0075] In some embodiments, configuration components can also be used to configure other information such as firewalls in the server to enhance the functionality and isolation of the virtual network of microservice instances.

[0076] In some embodiments, optionally, the virtual network interface card pair includes a first virtual network interface card and a second virtual network interface card, wherein the first virtual network interface card is configured in the microservice instance and the second virtual network interface card is configured in the server;

[0077] Establishing a second connection based on network routing rules can include:

[0078] Based on network routing rules, a second connection is established according to the first virtual network interface card, the second virtual network interface card, and the server's network interface card.

[0079] Specifically, a virtual network interface pair (NIC) consists of two virtual NICs: a first virtual NIC and a second virtual NIC. The first virtual NIC is configured in the microservice instance, and the second virtual NIC is configured in the server. Based on the network routing rules described above, a second connection can be established using the first virtual NIC, the second virtual NIC, and the server's NIC.

[0080] In some embodiments, a second connection is established based on a first virtual network interface card (NIC), a second virtual NIC, and the server's NIC, which is efficient, simple, and fast.

[0081] In some embodiments, optionally, the above method may further include:

[0082] Configure the target network tunnel endpoint in the microservice instance by configuring the component;

[0083] When the request packet is sent through the target network tunneling protocol, the request packet is parsed through the target network tunnel endpoint to determine the IP address of the terminal device, the virtual IP address of LVS, and the target data;

[0084] The target data is processed by a microservice instance to obtain a response data packet. Based on the second connection, the IP address of the terminal device, and the virtual IP address of LVS, the response data packet is sent to the terminal device through the first virtual network card.

[0085] The target network tunnel can be understood as an IP-in-IP network tunnel. The endpoint of the target network tunnel can be the endpoint of the IP-in-IP network tunnel, such as tunl0, and an LVS virtual IP address can be configured on it so that the microservice instance can use the IP address configured in the first network component to establish a network tunnel with LVS and receive request packets sent by LVS.

[0086] Specifically, the target network tunnel endpoint is configured in the microservice instance through the configuration component corresponding to the second network component. When the microservice instance receives a request data packet sent via the IP-in-IP network tunnel protocol, the IP-in-IP network tunnel endpoint parses the request data packet to obtain the terminal device's IP address, the LVS virtual IP address, and the target data. The microservice instance then processes this target data to obtain a response data packet. After obtaining the response data packet, based on the second connection, the terminal device's IP address is used as the destination IP address, and the LVS virtual IP address is used as the source IP address. The response data packet can then be sent to the terminal device through the first virtual network interface card.

[0087] In some embodiments, by using the IP address of the terminal device as the destination IP address and the virtual IP address of LVS as the source IP address, a response data packet is sent to the terminal device through the first virtual network card via the above process. This enables mutual access between microservice instances and terminal devices in the container cloud platform environment using LVS tunnel mode.

[0088] In some embodiments, optionally, the above method may further include:

[0089] When the type is not a tunnel mode that supports LVS, the target network is configured through the first network component according to all the configuration information in the network configuration request. The target network configuration is used to establish a target connection so that the microservice instance can communicate with external devices through the target connection, where the external devices include terminal devices.

[0090] External devices may also include any other microservice instances on the same server, or any microservice instances on other servers; no specific limitations are made here.

[0091] When the microservice instance to be configured does not support LVS tunnel mode, the second network component receives the network configuration request from the container cloud platform server. Based on all configuration information in the request (excluding the LVS virtual IP address), it calls the first network component. The first network component then performs target network configuration, including network interface card (NIC) configuration, virtual NIC configuration, routing, and firewall configuration. Correspondingly, after completing the target network configuration, the first network component enables communication between the microservice instance and external devices based on the target connection established during the configuration process. Furthermore, after completing the target network configuration, the first network component sends a target network configuration response (the result of the target network configuration) to the second network component, which then receives and records the response.

[0092] In some embodiments, the above process enables data communication between the microservice instance and external devices when the type of the microservice instance to be configured is not a tunnel mode that supports LVS.

[0093] In some embodiments, optionally, the target network is configured via a first network component based on all configuration information in the network configuration request, including:

[0094] Based on all configuration information, configure the first network interface card in the microservice instance through the first network component, and configure the third virtual network interface card in the server;

[0095] A target connection is established between the microservice instance and the external device through the first network interface card (NIC), the third virtual NIC, and the server's NIC.

[0096] Specifically, the first network component configures the first network interface card (NIC) in the microservice instance and the third virtual NIC in the server based on all the configuration information in the network configuration request. Then, through the first NIC, the third virtual NIC, and the server's NIC, a target connection between the microservice instance and the external device can be established.

[0097] In some embodiments, establishing a target connection through the above process is simple, efficient, and fast.

[0098] In some embodiments, optionally, the above method may further include:

[0099] After configuring the second network using the configuration component based on the second configuration information, the following is also included:

[0100] The first network configuration response sent by the first network component is sent to the cloud platform. The first network configuration response includes the IP address of the microservice instance.

[0101] In some embodiments, after the configuration component corresponding to the second network component performs the second network configuration according to the second configuration information, the second network component sends the first network configuration response sent by the first network component to the cloud platform. The first network configuration response includes the IP address of the microservice instance so that the cloud platform can use it later.

[0102] For example, Figure 3A This diagram illustrates how tunnel-mode access to a Linux virtual server enables communication between terminal devices and microservice instances, as provided in some embodiments of this disclosure. Figure 3AAs shown, taking microservice instance 13 (supporting LVS tunnel mode) in server 1 as an example, network interface card d and virtual network interface card d are configured during the first network configuration of the first network component, and the first and second virtual network interfaces are configured during the second network configuration of the second network component. Network interface card 1 is the network interface card of server 1. When the terminal device sends a request data packet to microservice instance 13, the path is: terminal device - LVS - network interface card 1 - virtual network interface card d - network interface card d; when microservice instance 13 sends a response data packet to the terminal device, the path is: first virtual network interface card - second virtual network interface card - network interface card 1 - terminal device. From the above process, it can be seen that this method can significantly reduce network overhead and improve network response performance.

[0103] It should be noted that: Figure 3A The server 1 and microservice instance 13 in the example are for illustrative purposes only and are not intended to limit the scope of the example.

[0104] For example, Figure 3B This diagram illustrates the access process between different microservice instances on the same server, as provided in some embodiments of this disclosure. Figure 3B As shown, taking microservice instances 12 and 13 in server 1 as examples, network interface card d and virtual network interface card d are configured during the first network component's first network configuration, while the first and second virtual network interfaces are configured during the second network component's second network configuration. Network interface card 1 is the network interface card of server 1. Microservice instance 12 (which does not support LVS tunnel mode) includes network interface card b and virtual network interface card b. Microservice instance 13 and microservice instance 12 can communicate with each other through network interface card d, virtual network interface card d, virtual network interface card b, and network interface card b. Figure 1B Similar to the Chinese.

[0105] It should be noted that: Figure 3B Server 1, microservice instance 12, and microservice instance 13 in the example are for illustrative purposes only and are not intended to limit the scope of the example.

[0106] For example, Figure 3C This diagram illustrates the access process between microservice instances on different servers provided in some embodiments of this disclosure. Figure 3C As shown, taking microservice instance 13 in server 1 and microservice instance 21 in server 2 as examples, network interface card d and virtual network interface card d are configured during the first network component's first network configuration, while the first and second virtual network interfaces are configured during the second network component's second network configuration. Network interface card 1 is the network interface card of server 1. Microservice instance 21 (which does not support LVS tunnel mode) includes network interface card c and virtual network interface card c. Microservice instance 13 and microservice instance 21 can communicate with each other through network interface card d, virtual network interface card d, network interface card 1, network interface card 2, virtual network interface card c, and network interface card c. Figure 1CSimilar to the Chinese.

[0107] It should be noted that: Figure 3C Server 1, Server 2, Microservice Instance 13, and Microservice Instance 21 in the text are for illustrative purposes only and are not intended to limit the scope of the application.

[0108] Figure 4A This is a schematic diagram illustrating the principle of another network configuration method in a container cloud platform environment provided by some embodiments of this disclosure. This embodiment is an optimization based on the above embodiments. Optionally, this embodiment provides a detailed explanation of the network deletion process after network configuration is completed. Figure 4A As shown, the method specifically includes the following:

[0109] S410 determines the type of microservice instance that needs to be configured based on the network configuration request of the microservice instance.

[0110] S420, when the type is a tunnel mode supporting LVS, performs first network configuration through the first network component according to the first configuration information in the network configuration request, and performs second network configuration through the configuration component corresponding to the second network component according to the second configuration information in the network configuration request.

[0111] S430, based on the network deletion request of the target microservice instance, if it is determined that the type of the target microservice instance is a tunnel mode that supports LVS, the second network configuration corresponding to the target microservice instance is deleted through the second network component, and the first network configuration corresponding to the target microservice instance is deleted through the first network component.

[0112] The target microservice instance can be understood as a microservice instance in the container cloud platform's server that needs to be deleted from the network.

[0113] When the container cloud platform's server determines that the target microservice instance's type is LVS-supporting tunnel mode based on the network deletion request, it sends a network deletion request to the second network component. The second network component then sends a network deletion request to its corresponding configuration component. Based on this request, the configuration component deletes the second network configuration corresponding to the target microservice instance, thus completing the deletion of the second network configuration. After deleting the second network configuration, the current network configuration is the first network configuration. The second network component then sends a network deletion request to the first network component, which in turn deletes the first network configuration corresponding to the target microservice instance, thus completing the deletion of the first network configuration. This improves compatibility with the first network component.

[0114] Correspondingly, after deleting the second network configuration corresponding to the target microservice instance, the configuration component corresponding to the second network component will send a second network deletion response to the second network component, that is, the deletion result of the second configuration network. Thus, the second network component can receive and record the second network deletion response fed back by the configuration component.

[0115] Accordingly, after deleting the first network configuration corresponding to the target microservice instance, the first network component will send a first network deletion response to the second network component, that is, the deletion result of the first configuration network, so that the second network component can receive and record the first network deletion response fed back by the first network component.

[0116] In some embodiments, the S430 described above enables network deletion after network configuration, which is simple, quick, and improves efficiency.

[0117] For example, Figure 4B This diagram illustrates a network deletion process based on the interaction between a server, a first network component, a second network component, and a configuration component, as provided in some embodiments of this disclosure. Figure 4B As shown, the specific steps include the following:

[0118] S4001, the server controller determines the type of the target microservice instance as a tunnel mode that supports LVS based on the network deletion request of the target microservice instance.

[0119] S4002, the server controller sends a network deletion request to the second network component.

[0120] S4003, the second network component sends a network deletion request to the configuration component corresponding to the second network component.

[0121] S4004, The configuration component corresponding to the second network component deletes the second network configuration corresponding to the target microservice instance.

[0122] S4005, the second network component sends a network deletion request to the first network component.

[0123] S4006, The first network component deletes the first network configuration corresponding to the target microservice instance.

[0124] This disclosure provides, in some embodiments, a server for a container cloud platform, the server comprising:

[0125] The controller is configured as follows:

[0126] Based on the network configuration request of the microservice instance, determine the type of microservice instance that needs to be configured;

[0127] When the type is LVS-supported tunnel mode, the first network configuration is performed through the first network component according to the first configuration information in the network configuration request, and the second network configuration is performed through the configuration component corresponding to the second network component according to the second configuration information in the network configuration request. The first configuration information includes parameter information corresponding to the microservice instance, and the first network configuration is used to establish a first connection so that the microservice instance can receive request data packets sent by the terminal device through the first connection. The second configuration information includes the virtual IP address of LVS, and the second network configuration is used to establish a second connection so that the microservice instance can send response data packets to the terminal device through the second connection.

[0128] In this embodiment, the server of the container cloud platform can implement the network configuration method in the container cloud platform environment provided in any of the above embodiments, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0129] Figure 5 This is a schematic diagram of a network configuration device in a container cloud platform environment provided in some embodiments of this disclosure. The device is configured in an electronic device and can implement the network configuration method in a container cloud platform environment as described in any embodiment of this application. The device specifically includes the following:

[0130] The determination module 510 is used to determine the type of microservice instance that needs to be configured based on the network configuration request of the microservice instance;

[0131] Configuration module 520 is configured to, when the type is a tunnel mode supporting Linux Virtual Server (LVS), perform a first network configuration through a first network component based on the first configuration information in the network configuration request, and perform a second network configuration through a configuration component corresponding to the second network component based on the second configuration information in the network configuration request. The first configuration information includes parameter information corresponding to the microservice instance, and the first network configuration is used to establish a first connection so that the microservice instance receives request data packets sent by the terminal device through the first connection. The second configuration information includes the virtual Internet Protocol (IP) address of the LVS, and the second network configuration is used to establish a second connection so that the microservice instance sends response data packets to the terminal device through the second connection.

[0132] In some embodiments, optionally, the configuration module 520 includes:

[0133] The first configuration unit is used to perform first network configuration through the first network component according to the first configuration information in the network configuration request when the type is a tunnel mode that supports Linux Virtual Server (LVS).

[0134] The second configuration unit is used to perform second network configuration by using the configuration component corresponding to the second network component according to the second configuration information in the network configuration request.

[0135] The second configuration unit includes:

[0136] The first establishment subunit is used to establish a virtual network interface pair in the server through the configuration component according to the second configuration information in the network configuration request;

[0137] The second establishment subunit is used to configure network routing rules through the configuration component and establish the second connection based on the network routing rules.

[0138] In some embodiments, optionally, the virtual network interface card pair includes a first virtual network interface card and a second virtual network interface card, wherein the first virtual network interface card is configured in the microservice instance and the second virtual network interface card is configured in the server;

[0139] The second subunit is established, specifically for:

[0140] Configure network routing rules through the configuration component, and establish the second connection based on the network routing rules, according to the first virtual network card, the second virtual network card, and the network card of the server.

[0141] In some embodiments, optionally, the above-described apparatus further includes:

[0142] The endpoint configuration module is used to configure the target network tunnel endpoint in the microservice instance through the configuration component;

[0143] The parsing module is used to parse the request data packet through the target network tunnel endpoint when the request data packet is sent through the target network tunnel protocol, and determine the IP address of the terminal device, the virtual IP address of the LVS, and the target data.

[0144] The data packet sending module is used to process the target data through the microservice instance to obtain a response data packet, and send the response data packet to the terminal device through the first virtual network card according to the second connection, the IP address of the terminal device, and the virtual IP address of the LVS.

[0145] In some embodiments, optionally, the above-described apparatus further includes:

[0146] The target network configuration module is used to configure the target network through the first network component according to all configuration information in the network configuration request when the type is not a tunnel mode that supports LVS. The target network configuration is used to establish a target connection so that the microservice instance can communicate with external devices through the target connection, wherein the external devices include the terminal device.

[0147] In some embodiments, optionally, the target network configuration module is specifically used for:

[0148] When the type does not support the tunnel mode of LVS, based on all configuration information, the first network interface card is configured in the microservice instance through the first network component, and the third virtual network interface card is configured in the server.

[0149] The target connection between the microservice instance and the external device is established through the first network interface card (NIC), the third virtual NIC, and the server's NIC, so that the microservice instance can communicate with the external device through the target connection.

[0150] In some embodiments, optionally, the above-described apparatus further includes:

[0151] The deletion module is used to, based on the network deletion request of the target microservice instance, determine that the type of the target microservice instance is a tunnel mode supporting LVS, delete the second network configuration corresponding to the target microservice instance through the second network component, and delete the first network configuration corresponding to the target microservice instance through the first network component.

[0152] In some embodiments, optionally, the above-described apparatus further includes:

[0153] The configuration response sending module is used to send the first network configuration response sent by the first network component to the cloud platform after performing the second network configuration through the configuration component according to the second configuration information. The first network configuration response includes the IP address of the microservice instance.

[0154] The network configuration device in the container cloud platform environment provided in this embodiment determines the type of microservice instance to be configured based on the network configuration request of the microservice instance. When the type of the microservice instance is a tunnel mode supporting LVS, the device performs first network configuration through a first network component based on the first configuration information in the network configuration request, and performs second network configuration through a configuration component corresponding to the second network component based on the second configuration information in the network configuration request. The first configuration information includes parameter information corresponding to the microservice instance, and the first network configuration is used to establish a first connection so that the microservice instance can receive request data packets sent by the terminal device through the first connection. The second configuration information includes the virtual IP address of LVS, and the second network configuration is used to establish a second connection so that the microservice instance can send response data packets to the terminal device through the second connection. In the above technical solution, performing second network configuration through the configuration component corresponding to the second network component enables the microservice instance to support sending response data packets to the terminal device through the tunnel mode without modifying the first network component of the container cloud platform, and can improve network response performance, which is beneficial for maintenance and modification and easy to access.

[0155] The network configuration device in the container cloud platform environment provided in this disclosure can execute the network configuration method in the container cloud platform environment provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of executing the method.

[0156] Figure 6 This is a schematic diagram of the structure of an electronic device provided in some embodiments of this disclosure. For example... Figure 6 As shown, the electronic device includes a processor 610 and a storage device 620; the number of processors 610 in the electronic device can be one or more; the processors 610 and the storage device 620 in the electronic device can be connected by a bus or other means.

[0157] Storage device 620, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the network configuration method in the container cloud platform environment of this disclosure embodiment. Processor 610 executes various functional applications and data processing of electronic devices by running the software programs, instructions, and modules stored in storage device 620, thereby implementing the network configuration method in the container cloud platform environment provided in this disclosure embodiment.

[0158] Storage device 620 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on terminal usage. Furthermore, storage device 620 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, storage device 620 may further include memory remotely located relative to processor 610, which can be connected to electronic devices via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0159] The electronic device provided in this embodiment can be used to execute the network configuration method in the container cloud platform environment provided in any of the above embodiments, and has corresponding functions and beneficial effects.

[0160] This disclosure provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the various processes of the network configuration method in the container cloud platform environment described above, and achieves the same technical effect. To avoid repetition, further details are omitted here.

[0161] The computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0162] The present invention provides a computer program product, comprising: when the computer program product is run on a computer, causing the computer to implement the above-described network configuration method in a container cloud platform environment.

[0163] For ease of explanation, the above description has been provided in conjunction with specific embodiments. However, the discussion in some embodiments above is not intended to be exhaustive or to limit the embodiments to the specific forms disclosed above. Various modifications and variations can be obtained based on the above teachings. The selection and description of the above embodiments are for the purpose of better explaining the principles and practical applications, thereby enabling those skilled in the art to better utilize the embodiments and various different variations of the embodiments suitable for specific application considerations.

Claims

1. A network configuration method in a container cloud platform environment, characterized in that, The method, applied to a server on a container cloud platform, includes: Based on the network configuration request of the microservice instance, determine the type of microservice instance that needs to be configured; When the type is a tunnel mode supporting Linux Virtual Server (LVS), a first network configuration is performed through a first network component based on the first configuration information in the network configuration request, and a second network configuration is performed through a configuration component corresponding to the second network component based on the second configuration information in the network configuration request. The first configuration information includes parameter information corresponding to the microservice instance, and the first network configuration is used to establish a first connection so that the microservice instance receives request data packets sent by the terminal device through the first connection. The second configuration information includes the virtual Internet Protocol (IP) address of the LVS, and the second network configuration is used to establish a second connection so that the microservice instance sends response data packets to the terminal device through the second connection.

2. The method according to claim 1, characterized in that, The second network configuration via the configuration component corresponding to the second network component includes: The configuration component establishes a virtual network interface card pair in the server. Configure network routing rules using the configuration component, and establish the second connection based on the network routing rules.

3. The method according to claim 2, characterized in that, The virtual network interface card pair includes a first virtual network interface card and a second virtual network interface card, wherein the first virtual network interface card is configured in the microservice instance and the second virtual network interface card is configured in the server; Establishing the second connection based on the network routing rules includes: Based on the network routing rules, the second connection is established according to the first virtual network card, the second virtual network card, and the network card of the server.

4. The method according to claim 3, characterized in that, The method further includes: The target network tunnel endpoint is configured in the microservice instance using the configuration component. When the request data packet is sent via the target network tunneling protocol, the request data packet is parsed through the target network tunnel endpoint to determine the IP address of the terminal device, the virtual IP address of the LVS, and the target data; The target data is processed by the microservice instance to obtain a response data packet, and the response data packet is sent to the terminal device through the first virtual network card according to the second connection, the IP address of the terminal device, and the virtual IP address of the LVS.

5. The method according to claim 1, characterized in that, The method further includes: When the type does not support the tunnel mode of LVS, the target network is configured through the first network component according to all the configuration information in the network configuration request. The target network configuration is used to establish a target connection so that the microservice instance can communicate with external devices through the target connection, wherein the external devices include the terminal device.

6. The method according to claim 5, characterized in that, The step of configuring the target network through the first network component based on all configuration information in the network configuration request includes: Based on all configuration information, the first network interface card is configured in the microservice instance through the first network component, and the third virtual network interface card is configured in the server. The target connection between the microservice instance and the external device is established through the first network interface card (NIC), the third virtual NIC, and the server's NIC.

7. The method according to any one of claims 1-6, characterized in that, The method further includes: Based on the network deletion request of the target microservice instance, if it is determined that the type of the target microservice instance is a tunnel mode that supports LVS, the second network configuration corresponding to the target microservice instance is deleted through the second network component, and the first network configuration corresponding to the target microservice instance is deleted through the first network component.

8. The method according to any one of claims 1-6, characterized in that, After configuring the second network using the configuration component based on the second configuration information, the process further includes: The first network configuration response sent by the first network component is sent to the cloud platform, and the first network configuration response includes the IP address of the microservice instance.

9. A server for a container cloud platform, characterized in that, The server includes: The controller is configured as follows: Based on the network configuration request of the microservice instance, determine the type of microservice instance that needs to be configured; When the type is a tunnel mode supporting Linux Virtual Server (LVS), a first network configuration is performed through a first network component based on the first configuration information in the network configuration request, and a second network configuration is performed through a configuration component corresponding to the second network component based on the second configuration information in the network configuration request. The first configuration information includes parameter information corresponding to the microservice instance, and the first network configuration is used to establish a first connection so that the microservice instance receives request data packets sent by the terminal device through the first connection. The second configuration information includes the virtual Internet Protocol (IP) address of the LVS, and the second network configuration is used to establish a second connection so that the microservice instance sends response data packets to the terminal device through the second connection.

10. The server according to claim 9, characterized in that, The controller is specifically configured as follows: The configuration component establishes a virtual network interface card pair in the server. Configure network routing rules using the configuration component, and establish the second connection based on the network routing rules.