Network mutual access processing method and device

By creating container network gateways and routes in the Kubernetes cluster, the problem that Contiv does not support Pod access to services and endpoints is solved, and the needs of network mutual access and complex business scenarios inside and outside the Kubernetes cluster are realized.

CN118802691APending Publication Date: 2024-10-18CHINA MOBILE GROUP ZHEJIANG +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410052059.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-12
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

The open source Contiv does not support the container group (Pod) in the Kubernetes cluster to access the Service address and its endpoint address at the same time, and does not support the Pod to access the backend Endpoint as the Pod's own Service, resulting in complex business scenarios such as the Internet of Things (IOT) scenario. Can't run smoothly.

Method used

Create a container network gateway on the host, and add a route to the Service network segment in the Pod. The traffic accessing the Service in the Pod is routed to the container network gateway through routing, and the Service address and port are converted into the Pod address and port, and vice versa. Likewise, virtual switches are used for data forwarding.

Benefits of technology

It realizes mutual network access inside and outside the Kubernetes cluster, supports the core features of Service and Pod to access Service and its endpoints at the same time, and meets the needs of complex business scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118802691A_ABST
    Figure CN118802691A_ABST
Patent Text Reader

Abstract

The invention discloses a network mutual access processing method and device, and the method comprises the steps: building a first container network gateway on a first host machine under the condition that a first container group Pod on the first host machine sends an access request to a first service Service of a second Pod on a second host machine, a first route for accessing a first Service network segment is added in the first Pod; routing the flow accessing the first Service in the first Pod to the first container network gateway through the first route, so that the address and the port of the first Service are converted into the address and the port of the second Pod, and the address and the port of the first Pod are converted into the address and the port of the first container network gateway; and sending the converted first message to a first virtual switch of the first host machine through the first container network gateway, and sending the converted first message to the second Pod through the first virtual switch.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing, and in particular to a method and device for processing network mutual access. Background Art

[0002] Kubernetes is Google's open source container cluster management system. Kubernetes itself does not provide a network solution, but provides the Container Network Interface (CNI) specification. The typical usage of network plug-ins in some instances is the overlay network model, which can meet the network access within the Kubernetes cluster, but it is difficult to support network access within and outside the Kubernetes cluster. Container Network Gateway (Contiv) is a container network component of Cisco, which can well meet the network access requirements within and outside the Kubernetes cluster. In addition, open source Contiv provides a Kubernetes service solution through the Open Virtual Switch (Openvswitch, OVS) flow table technology.

[0003] However, the open source Contiv Service solution has two major flaws: it does not support container groups (Pods) accessing the Service address and its endpoint address at the same time, and it does not support Pods accessing the Service whose backend endpoint is the Pod's own. For complex business scenarios, such as the Internet of Things (IOT) scenario, when a Pod needs to access a Service and its endpoint at the same time, when there are fat containers and the Pod needs to access the service in the Pod itself through the Service address, the business cannot run smoothly. Summary of the invention

[0004] The embodiments of the present application provide a method and device for processing network mutual access, so as to solve the problem that services cannot be operated due to cluster network mutual access in the related art.

[0005] In a first aspect, a network mutual access processing method is provided, comprising:

[0006] When a first container group Pod on a first host sends an access request to a first service Service of a second Pod on a second host, a first container network gateway is created on the first host, and a first route for accessing a first Service network segment is added in the first Pod;

[0007] Routing the traffic in the first Pod accessing the first Service to the first container network gateway through the first route, so that the address and port of the first Service are converted to the address and port of the second Pod, and the address and port of the first Pod are converted to the address and port of the first container network gateway;

[0008] The converted first message is sent to the first virtual switch of the first host machine through the first container network gateway, and is sent to the second Pod through the first virtual switch.

[0009] In a second aspect, a network mutual access processing device is provided, comprising:

[0010] A creation module is used to create a first container network gateway on the first host and add a first route to access the first Service network segment in the first Pod when the first container group Pod on the first host sends an access request to the first service Service of the second Pod on the second host;

[0011] A conversion module, configured to route the traffic in the first Pod accessing the first Service to the first container network gateway through the first route, so that the address and port of the first Service are converted to the address and port of the second Pod, and the address and port of the first Pod are converted to the address and port of the first container network gateway;

[0012] The access module is used to send the converted first message to the first virtual switch of the first host machine through the first container network gateway, and send it to the second Pod through the first virtual switch.

[0013] In a third aspect, a terminal device is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the method described in the first aspect when executed by the processor.

[0014] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0015] In an embodiment of the present application, first, when the first container group Pod on the first host sends an access request to the first service Service of the second Pod on the second host, a first container network gateway is created on the first host, and a first route for accessing the first Service network segment is added in the first Pod, and then the traffic accessing the first Service in the first Pod is routed to the first container network gateway through the first route, so that the address and port of the first Service are converted to the address and port of the second Pod, and the address and port of the first Pod are converted to the address and port of the first container network gateway, and finally the converted first message is sent to the first virtual switch of the first host through the first container network gateway, and sent to the second Pod through the first virtual switch. In an embodiment of the present application, a container network gateway is created on the host, a route for accessing the Service network segment is added in the Pod, and the traffic accessing the Service in the Pod is routed to the host container network gateway, and the destination address and source address are converted to achieve a complete Service capability, which not only supports the core features of the Service, but also supports the Pod to access the Service and its endpoints at the same time, meeting the requirements of complex business scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0017] Figure 1 is a flow chart of a network mutual access processing method provided in an embodiment of the present application;

[0018] Figure 2 It is a data flow diagram of the network mutual access processing method provided in an embodiment of the present application;

[0019] Figure 3 It is a data flow diagram of another network mutual access processing method provided by an embodiment of the present application;

[0020] Figure 4 It is a schematic diagram of a network mutual access processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0021] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0022] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here. In addition, the "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally represents that the objects associated with each other are in an "or" relationship.

[0023] In the following, in conjunction with the accompanying drawings, a network mutual access processing method and device provided by the embodiment of the present application are described in detail through specific embodiments and application scenarios.

[0024] like Figure 1 As shown, it is a flow chart of a network mutual access processing method provided by an embodiment of the present application. Figure 1 As shown, the network mutual access processing method may include: contents shown in S101 to S103.

[0025] In S101, when a first container group Pod on a first host sends an access request to a first service Service of a second Pod on a second host, a first container network gateway is created on the first host, and a first route to access the first Service network segment is added in the first Pod.

[0026] In other words, under the OVS virtual machine LAN (VLAN) two-layer flat network architecture, the data forwarding plane of Contiv's Kubernetes Service solution can be offloaded to the host network through the joint collaboration of the host network and the container network.

[0027] In S102, traffic accessing the first Service in the first Pod is routed to the first container network gateway through the first route, so that the address and port of the first Service are converted to the address and port of the second Pod, and the address and port of the first Pod are converted to the address and port of the first container network gateway.

[0028] In S103, the converted first message is sent to the first virtual switch of the first host machine through the first container network gateway, and is sent to the second Pod through the first virtual switch.

[0029] In an embodiment of the present application, first, when the first container group Pod on the first host sends an access request to the first service Service of the second Pod on the second host, a first container network gateway is created on the first host, and a first route for accessing the first Service network segment is added in the first Pod, and then the traffic accessing the first Service in the first Pod is routed to the first container network gateway through the first route, so that the address and port of the first Service are converted to the address and port of the second Pod, and the address and port of the first Pod are converted to the address and port of the first container network gateway, and finally the converted first message is sent to the first virtual switch of the first host through the first container network gateway, and sent to the second Pod through the first virtual switch. In an embodiment of the present application, a container network gateway is created on the host, a route for accessing the Service network segment is added in the Pod, and the traffic accessing the Service in the Pod is routed to the host container network gateway, and the destination address and source address are converted to achieve a complete Service capability, which not only supports the core features of the Service, but also supports the Pod to access the Service and its endpoints at the same time, meeting the requirements of complex business scenarios.

[0030] In a possible implementation of the present application, the network mutual access processing method may also include: when the second Pod receives the first message, the first host receives a response message returned by the second Pod, the source address and port of the response message are the address and port of the second Pod, and the destination address and port of the response message are the address and port of the first container network gateway.

[0031] In a possible implementation of the present application, the network mutual access processing method may also include: converting the source address and port into the address and port of the first Service, and converting the destination address and port into the address and port of the first Pod; sending the converted second message to the first virtual switch through the first container network gateway, and sending it to the first Pod through the first virtual switch.

[0032] That is to say, the response message of the second Pod uses the first container network gateway of the first host as the destination address. After the response message is received by the first host, the source address translation (SNAT) and destination address translation (DNAT) are implemented through the IP virtual server (IPVS) and the client proxy (Iptables), that is, the source address and port are converted to the Service address and port, and the destination address and port are converted to the Pod address and port. The response message is then sent to OVS through the first container network gateway and forwarded to the first Pod by OVS.

[0033] In a possible implementation of the present application, routing traffic accessing the first Service in the first Pod to the first container network gateway through a first route may include: routing traffic accessing the first Service in the first Pod to the first container network gateway through the first route, and converting the address and port of the first Service to the address and port of the second Pod, and converting the address and port of the first Pod to the address and port of the first container network gateway through the IP virtual server and client agent of the first host.

[0034] In a possible implementation of the present application, the network mutual access processing method may further include: setting a first physical network card on the first host machine, setting a second physical network card on the second host machine, and the first physical network card and the second physical network card are both container network interfaces.

[0035] That is to say, each host can be configured with two physical network cards and form network card bonds (bonds), bond0 and bond1, where bond0 is used as the host network interface and bond1 is used as the container network interface. When Contiv is initialized, bond1 is attached to OVS as the container network data channel.

[0036] In a possible implementation of the present application, the network mutual access processing method may further include: configuring a container network for the first container network gateway, the container network including a container address range, a gateway address, and a virtual machine local area network identifier (vlanID).

[0037] For example, the address range is 192.168.52.101-192.168.53.253 / 23, the gateway is 192.168.53.254, and the vlanID is 2134.

[0038] In a specific embodiment of the present application, Figure 2 As shown in the figure, the network topology of two connected host nodes in a Kubernetes cluster with Contiv as the network plug-in and two Pods running on each host node shows the data flow path of Pod2 accessing Pod4 through Service.

[0039] First, set up the environment. The Kubernetes cluster Service network segment is 172.16.0.0 / 16. Each host is configured with two physical network cards and bonded, bond0 and bond1, respectively. Bond0 is used as the host network interface and bond1 is used as the container network interface. When Contiv is initialized, bond1 is attached to OVS as the container network data channel. Configure the basic network and container network for Contiv. The configuration commands are as follows:

[0040] netctl net create contivgw0-n infra-s 192.168.52.1-192.168.52.100 / 23-e vlan-p 2134

[0041] netctl net create default-net-n data-s 192.168.52.101-192.168.53.253 / 23-g192.168.53.254-e vlan-p 2134

[0042] The first command configures a basic network named contivgw0 with an address range of 192.168.52.1-192.168.52.100 / 23 and a vlan ID of 2134.

[0043] The second command configures a container network named default-net with an address range of 192.168.52.101-192.168.53.253 / 23, a gateway of 192.168.53.254, and a vlan ID of 2134.

[0044] The Contiv component creates a network interface conitvgw0 for each host node based on the above basic network configuration, and allocates an IP address from the address pool to the interface. The Pod configures the route to access the Service network segment and the route to access the container network gateway on the host side. These two routes route the Pod's access to the Service's message to the host network. For example, the route in Pod2 is as follows:

[0045] 172.16.0.0 / 16via 192.168.52.1dev eth0 src 192.168.53.10

[0046] 192.168.52.1dev eth0 scope link

[0047] Configure the Service address of the service in Pod4 to 172.16.10.100, and the corresponding backend Endpoint to 192.168.53.11.

[0048] Based on the above configuration, when Pod2 accesses the Service of Pod4, Figure 2The line with the right arrow in the figure is the data path of the request, and the line with the left arrow is the data path of Pod4's response to the request. When Pod2 initiates a request to Pod4's Service, the source and destination addresses of Pod2's request message are 192.168.53.10 and 172.16.10.100, respectively. The message is forwarded by the router in Pod2 to the container network gateway contivgw0 on the host. After the destination and source addresses are converted and load balanced by IPVS and Iptables on the host network, it is forwarded to the outside of the host by OVS through the contivgw0 interface. At this time, the source and destination addresses of the message are 192.168.52.1 and 192.168.53.11, respectively, and the message finally reaches the destination Pod4. Pod4's response message uses contivgw0 IP address 192.168.52.1 on Host 1 as the destination address. The source and destination addresses of the response message are 192.168.53.11 and 192.168.52.1 respectively. After the message is received by Host 1, it undergoes reverse address translation through IPVS and Iptables on the host network, and is then forwarded to Pod2 by OVS through the contivgw0 interface. At this time, the source and destination addresses of the message are 172.16.10.100 and 192.168.53.10 respectively. The message finally reaches Pod2, completing the entire request-response closed loop.

[0049] In the embodiment of the present application, the container network and the host network are connected through the OVS virtual switch, and the traffic accessing the Service is routed to the host network through routing in the Pod. The IPVS and Iptables technologies of the host network are used to implement a complete Service service capability, which not only supports the core features of the Service, but also solves the two major defects of the open source Contiv Service capability, and meets complex business scenarios such as IOT.

[0050] In another embodiment of the present application, Figure 3 As shown, the open source Contiv Kubernetes Service solution is as follows:

[0051] Open source Contiv provides a Kubernetes Service solution through OVS flow table technology, that is, Contiv monitors Kubernetes Service creation, update, and deletion events, and sends the obtained Service and Endpoint configurations to OVS. When a Pod initiates access to a Service, two entry and exit rules are generated in the OVS flow table to achieve mutual conversion between the Service address and the Endpoint address.

[0052] The present embodiment is described in detail below with an example, focusing on the role of the OVS flow table on the data forwarding plane. Figure 3 The network topology of two connected host nodes and two Pods running on each host node in a Kubernetes cluster with Contiv as the network plug-in is shown, and the request and response data paths of Pod2 accessing Pod4 through Service are expressed by right-pointing arrow lines and left-pointing arrow lines respectively. In this embodiment, a container network gateway is not created on the host.

[0053] First, set up the environment. The Kubernetes cluster Service network segment is 172.16.0.0 / 16. Each host is configured with two physical network cards and bonded, bond0 and bond1, respectively. Bond0 is used as the host network interface and bond1 is used as the container network interface. When contiv is initialized, bond1 is attached to OVS as the container network data channel. Configure the container network for contiv. The configuration commands are as follows:

[0054] netctl net create default-net-n data-s 192.168.52.0 / 23-g192.168.53.254-evlan-p 2134

[0055] This command configures a container network named default-net, with a network segment of 192.168.52.0 / 23, a gateway of 192.168.53.254, and a VLAN ID of 2134.

[0056] The service address of the service provided by Pod4 is configured to be 172.16.10.100, and the corresponding backend Endpoint is 192.168.53.11.

[0057] Based on the above configuration, when Pod2 accesses the Service of Pod4, Figure 3The line with the right arrow in the figure is the data path of the request, and the line with the left arrow is the data path of Pod4's response to the request. When Pod2 initiates a request to Pod4's Service, the source and destination addresses of Pod2's request message are 192.168.53.10 and 172.16.10.100, respectively. When the message passes through OVS, it is matched by the flow table rule, and the destination address translation is performed, converting 172.16.10.100 to 192.168.53.11, and then forwarded to the outside of the host. At this time, the source and destination IP addresses are 192.168.53.10 and 192.168.53.11, respectively, and the message finally reaches the destination Pod4. Pod4's response message uses Pod2's IP address 192.168.53.10 as the destination address, with the source and destination addresses being 192.168.53.11 and 192.168.53.10 respectively. When the message passes through Host1 OVS, it is matched by the flow table rule and source address translation is performed. After translation, the source and destination addresses are 172.16.10.100 and 192.168.53.10 respectively, and then forwarded to Pod2. The entire request-response loop is closed.

[0058] like Figure 4 As shown, it is a schematic diagram of a network mutual access processing device provided by an embodiment of the present application. Figure 4 As shown, the network mutual access processing device may include: a creation module 401 , a conversion module 402 and an access module 403 .

[0059] Among them, the creation module 401 is used to create a first container network gateway on the first host machine and add a first route to access the first Service network segment in the first Pod when the first container group Pod on the first host machine sends an access request to the first service Service of the second Pod on the second host machine; the conversion module 402 is used to route the traffic accessing the first Service in the first Pod to the first container network gateway through the first route, so that the address and port of the first Service are converted to the address and port of the second Pod, and the address and port of the first Pod are converted to the address and port of the first container network gateway; the access module 403 is used to send the converted first message to the first virtual switch of the first host machine through the first container network gateway, and send it to the second Pod through the first virtual switch.

[0060] In an embodiment of the present application, first, when the first container group Pod on the first host sends an access request to the first service Service of the second Pod on the second host, the creation module 401 creates a first container network gateway on the first host, and adds a first route to access the first Service network segment in the first Pod, and then the conversion module 402 routes the traffic accessing the first Service in the first Pod to the first container network gateway through the first route, so that the address and port of the first Service are converted to the address and port of the second Pod, and the address and port of the first Pod are converted to the address and port of the first container network gateway, and finally the access module 403 sends the converted first message to the first virtual switch of the first host through the first container network gateway, and sends it to the second Pod through the first virtual switch. In an embodiment of the present application, a container network gateway is created on the host, a route to access the Service network segment is added in the Pod, the traffic accessing the Service in the Pod is routed to the host container network gateway, the destination address and the source address are converted, and a complete Service capability is realized, which not only supports the core characteristics of the Service, but also supports the Pod to access the Service and its endpoints at the same time, meeting the requirements of complex business scenarios.

[0061] In a possible implementation manner of the present application, the network mutual access processing device further includes a receiving module.

[0062] Among them, the receiving module is used to, when the second Pod receives the first message, the first host receives a response message returned by the second Pod, the source address and port of the response message are the address and port of the second Pod, and the destination address and port of the response message are the address and port of the first container network gateway.

[0063] In a possible implementation manner of the present application, the network mutual access processing device further includes a second conversion module and a sending module.

[0064] Among them, the second conversion module is used to convert the source address and port into the address and port of the first Service, and the destination address and port into the address and port of the first Pod; the sending module is used to send the converted second message to the first virtual switch through the first container network gateway, and send it to the first Pod through the first virtual switch.

[0065] In a possible implementation of the present application, the conversion module 402 is used to: route the traffic accessing the first Service in the first Pod to the first container network gateway through the first route, and convert the address and port of the first Service into the address and port of the second Pod and the address and port of the first Pod into the address and port of the first container network gateway through the IP virtual server and the client agent of the first host.

[0066] In a possible implementation manner of the present application, the network mutual access processing device further includes a setting module.

[0067] Among them, the setting module is used to set a first physical network card on the first host machine and set a second physical network card on the second host machine, and the first physical network card and the second physical network card are both container network interfaces.

[0068] In a possible implementation manner of the present application, the network mutual access processing device further includes a second setting module.

[0069] Among them, the second setting module is used to configure a container network for the first container network gateway, and the container network includes a container address range, a gateway address, and a virtual machine local area network identifier.

[0070] The function of the network mutual access processing device of the present application is Figure 1-Figure 3 The method embodiment shown is described in detail, so for any details not provided in the description of this embodiment, please refer to the relevant descriptions in the aforementioned embodiments, which will not be repeated here.

[0071] Optionally, an embodiment of the present application also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned network mutual access processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0072] Optionally, the embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by the processor, each process of the above-mentioned network mutual access processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. Among them, the computer-readable storage medium is such as a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0073] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0074] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0075] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A network access processing method, characterized in that: include: When a first container group Pod on a first host sends an access request to a first service Service of a second Pod on a second host, a first container network gateway is created on the first host, and a first route for accessing a first Service network segment is added in the first Pod; Routing the traffic in the first Pod accessing the first Service to the first container network gateway through the first route, so that the address and port of the first Service are converted to the address and port of the second Pod, and the address and port of the first Pod are converted to the address and port of the first container network gateway; The converted first message is sent to the first virtual switch of the first host machine through the first container network gateway, and is sent to the second Pod through the first virtual switch.

2. The method according to claim 1, characterized in that The method further comprises: When the second Pod receives the first message, the first host receives a response message returned by the second Pod, the source address and port of the response message are the address and port of the second Pod, and the destination address and port of the response message are the address and port of the first container network gateway.

3. The method according to claim 2, characterized in that The method further comprises: Convert the source address and port to the address and port of the first Service, and convert the destination address and port to the address and port of the first Pod; The converted second message is sent to the first virtual switch through the first container network gateway, and then sent to the first Pod through the first virtual switch.

4. The method according to claim 1, characterized in that: The step of routing the traffic in the first Pod accessing the first Service to the first container network gateway through the first route includes: Traffic accessing the first Service in the first Pod is routed to the first container network gateway through the first routing, and the address and port of the first Service are converted to the address and port of the second Pod, and the address and port of the first Pod are converted to the address and port of the first container network gateway through the IP virtual server and client agent of the first host.

5. The method according to claim 1, characterized in that Before the first container group Pod on the first host sends an access request to the first service Service of the second Pod on the second host, the method further includes: A first physical network card is set on the first host machine, and a second physical network card is set on the second host machine, wherein both the first physical network card and the second physical network card are container network interfaces.

6. The method according to claim 5, characterized in that After creating a first container network gateway on the first host machine and adding a first route to access the first Service network segment in the first Pod, the method further includes: A container network is configured for the first container network gateway, wherein the container network includes a container address range, a gateway address, and a virtual machine local area network identifier.

7. A network access processing device, characterized in that: include: A creation module is used to create a first container network gateway on the first host and add a first route to access the first Service network segment in the first Pod when the first container group Pod on the first host sends an access request to the first service Service of the second Pod on the second host; A conversion module, configured to route the traffic in the first Pod accessing the first Service to the first container network gateway through the first route, so that the address and port of the first Service are converted to the address and port of the second Pod, and the address and port of the first Pod are converted to the address and port of the first container network gateway; The access module is used to send the converted first message to the first virtual switch of the first host machine through the first container network gateway, and send it to the second Pod through the first virtual switch.

8. The device according to claim 7, characterized in that The device also includes: A receiving module is used for, when the second Pod receives the first message, the first host machine receives a response message returned by the second Pod, the source address and port of the response message are the address and port of the second Pod, and the destination address and port of the response message are the address and port of the first container network gateway.

9. The device according to claim 7, characterized in that The conversion module is used for: Traffic accessing the first Service in the first Pod is routed to the first container network gateway through the first routing, and the address and port of the first Service are converted to the address and port of the second Pod, and the address and port of the first Pod are converted to the address and port of the first container network gateway through the IP virtual server and client agent of the first host.

10. The device according to claim 7, characterized in that The device also includes: A setting module is used to set a first physical network card on a first host machine and a second physical network card on a second host machine, wherein both the first physical network card and the second physical network card are container network interfaces.