Default Gateway Management Method, Gateway Manager, Server, and Storage Medium

By allocating an exclusive default gateway to the container and monitoring the gateway resource pool, the problem that out-of-cloud services cannot identify the service identity in the container is solved, and efficient resource utilization and balanced allocation of data traffic are achieved.

CN113783712BActive Publication Date: 2025-08-05ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010526414.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-09
Publication Date
2025-08-05
Estimated Expiration
2040-06-09

AI Technical Summary

Technical Problem

In the prior art, the default gateway of the container is usually set as the public default gateway of the cloud environment, resulting in the out-of-cloud services not being able to recognize the identity of the services in the container and the resource is seriously wasted.

Method used

By detecting the attribute tags of the target application container and assigning the corresponding exclusive default gateway, we ensure that off-cloud services can identify the identity of the services in the container, and by monitoring and managing the gateway resource pool, we can achieve data traffic load balancing and resource utilization.

Benefits of technology

It realizes the precise setting of firewall rules by off-cloud services, and improves the utilization rate of gateway resources and load balancing of data traffic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113783712B_ABST
    Figure CN113783712B_ABST
Patent Text Reader

Abstract

The present invention provides a method for managing a default gateway, including: in response to a default gateway application request, detecting a target attribute label of a target application container; if the target attribute label exists and there is a target default gateway pool configured with the target attribute label in the gateway resource pool, allocating a default gateway for the target application container from the target default gateway pool. The default gateway allocated by the present invention for each application container is a dedicated default gateway corresponding to the application container, so that when the application container accesses services outside the cloud, the services outside the cloud can identify the identity of the services in the application container through the source IP corresponding to the default gateway of the application container, thereby facilitating the setting of firewall rules by the services outside the cloud. The present invention also provides a gateway manager, a server and a storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technologies, and in particular, to a default gateway management method, a gateway manager, a server, and a storage medium. Background Art

[0002] The implementation of container-based application services has multiple advantages such as simplified deployment, multi-environment support, fast startup, service orchestration, easy migration, and elastic scaling, which makes the containers running application services more lightweight than virtual machines. Since the container orchestration management engine dynamically adjusts the running location or the number of running containers according to the actual running status, the changes in containers will trigger the application and release of container network resources. To reduce the impact of internal network changes in the container cloud on the outside, generally, containers communicate based on the internal network and are thus isolated from the external network. When the services in the containers need to access the services on the external network, they need to access through the default gateway. In the prior art, the default gateway of a container is usually set to the public default gateway of the cloud environment where the container is located, that is, each container shares a common default gateway. This causes that when the container accesses the services outside the cloud, the services outside the cloud cannot identify the identity of the services contained in the container based on the IP of this common default gateway, and thus cannot set firewall rules. At the same time, since other default gateways in the cloud environment are idle, it also leads to a waste of resources. Summary of the Invention

[0003] The present invention aims to solve one of the above technical problems, and provides a default gateway management method, a gateway manager, a server, and a storage medium, so as to solve the problem that the services outside the cloud in the prior art cannot identify the identity of the services in the container.

[0004] In a first aspect, the present invention provides a default gateway management method, including:

[0005] Responding to a default gateway application request, and detecting a target attribute label of a target application container;

[0006] If the target attribute label exists and there is a target default gateway pool configured with the target attribute label in the gateway resource pool, allocate a default gateway for the target application container from the target default gateway pool.

[0007] In some embodiments, if the target attribute label does not exist, or the target attribute label exists but there is no target default gateway pool configured with the target attribute label in the gateway resource pool, allocate a preset shared default gateway in the gateway resource pool to the target application container.

[0008] In some embodiments, after the step of allocating a default gateway for the target application container from the target default gateway pool, the method further includes:

[0009] Send the default gateway assigned to the target application container to the container gateway configurator of the target application container in the form of request response information, container annotations or container tags.

[0010] In some embodiments, the step of allocating a default gateway for the target application container from the target default gateway pool includes:

[0011] If the target default gateway pool is not configured with an allocation policy, randomly select an available gateway from the target default gateway pool and allocate it to the target application container;

[0012] If the target default gateway pool is configured with an allocation policy, select an available gateway from the target default gateway pool according to the configured allocation policy and allocate it to the target application container.

[0013] In some embodiments, the step of selecting an available gateway from the target default gateway pool according to the configured allocation policy and allocating it to the target application container includes:

[0014] Select an available gateway from the target default gateway pool based on a polling policy and allocate it to the target application container;

[0015] Alternatively, select an available gateway with the smallest number of allocated times from the target default gateway pool and allocate it to the target application container;

[0016] Alternatively, determine an available gateway with the largest available bandwidth from the target default gateway pool. If the available bandwidth of the available gateway with the largest available bandwidth is greater than the required bandwidth of the target application container, allocate the available gateway with the largest available bandwidth to the target application container.

[0017] In some embodiments, the step of detecting the target attribute tag of the target application container includes:

[0018] Obtain the container identifier of the target application container from the default gateway application request;

[0019] Query whether the target application container is configured with an attribute tag according to the container identifier;

[0020] If it is queried that the target application container is configured with an attribute tag, use the attribute tag configured by the target application container as the target attribute tag;

[0021] If it is queried that the target application container is not configured with an attribute tag, further query whether the owner user of the target application container is configured with an attribute tag;

[0022] If it is queried that the attributed user is configured with attribute tags, use the attribute tags configured by the attributed user as the target attribute tags;

[0023] If it is queried that the attributed user is not configured with attribute tags, further query whether the attributed group of the target application container is configured with attribute tags;

[0024] If it is queried that the attributed group is configured with attribute tags, use the attribute tags configured by the attributed group as the target attribute tags;

[0025] If it is queried that the attributed group is not configured with attribute tags, it is detected that the target attribute tags of the target application container do not exist.

[0026] In some embodiments, the method further includes: monitoring the working status of each default gateway in the gateway resource pool;

[0027] If there is a default gateway with an abnormal working status, mark the default gateway with the abnormal working status as unavailable;

[0028] If a default gateway marked as unavailable resumes normal, mark the restored normal default gateway as available.

[0029] In some embodiments, the method further includes: monitoring the viability of the application containers associated with the default gateways that have been allocated in the gateway resource pool;

[0030] If there is an associated application container that is deleted or has abnormal operation, release the default gateway referenced by the deleted or abnormally operating application container in the gateway resource pool.

[0031] In some embodiments, the method further includes: performing management operations on the gateway resource pool.

[0032] In some embodiments, the steps of performing management operations on the gateway resource pool include at least one of the following:

[0033] Adding a default gateway pool in the gateway resource pool;

[0034] Querying a specific default gateway pool in the gateway resource pool;

[0035] Generating a list of default gateway pools in the gateway resource pool;

[0036] Deleting a default gateway pool in the gateway resource pool;

[0037] Deregistering a default gateway in the default gateway pool;

[0038] Adding an attribute tag to the default gateway pool;

[0039] Delete the attribute label for the default gateway pool;

[0040] Configure the default gateway allocation policy for the default gateway pool.

[0041] In a second aspect, the present invention provides a gateway manager, including:

[0042] A detection module, configured to detect a target attribute label of a target application container in response to a default gateway application request;

[0043] An allocation module, configured to allocate a default gateway for the target application container from the target default gateway pool when the detection module detects that the target attribute label exists and there is a target default gateway pool configured with the target attribute label in the gateway resource pool.

[0044] In a third aspect, the present invention provides a server, including:

[0045] One or more processors;

[0046] A storage device storing one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the default gateway management method described in the first aspect of the present invention.

[0047] In a fourth aspect, the present invention provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the default gateway management method described in the first aspect of the present invention.

[0048] For the default gateway management method and gateway manager provided by the present invention, when an application container starts, the application container issues a default gateway application request. After receiving the default gateway application request, the gateway manager selects a gateway from the default gateway pool pre-set corresponding to the attribute label of the application container as the default gateway of the application container. Compared with the prior art, the default gateway management method provided by the present invention allocates a dedicated default gateway corresponding to the application container for each application container, so that when the application container accesses services outside the cloud, the services outside the cloud can identify the identity of the services in the application container through the source IP corresponding to the default gateway of the application container, thereby facilitating the setting of firewall rules by the services outside the cloud. At the same time, since the external access exits of different application containers are separated, data traffic load balancing is achieved, and the utilization rate of gateway resources on the cloud platform is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 is a flowchart of a default gateway management method provided by an embodiment of the present invention;

[0050] Figure 2 Flow chart of another default gateway management method provided by an embodiment of the present invention;

[0051] Figure 3 Flow chart of yet another default gateway management method provided by an embodiment of the present invention;

[0052] Figure 4 Flow chart of still another default gateway management method provided by an embodiment of the present invention;

[0053] Figure 5 Schematic structural diagram of a gateway manager provided by an embodiment of the present invention. Detailed implementation manners

[0054] To enable those skilled in the art to better understand the technical solutions of the present invention, the default gateway management method, gateway manager, server, and storage medium provided by the present invention will be described in detail below with reference to the accompanying drawings.

[0055] Example embodiments will be described more fully hereinafter with reference to the accompanying drawings, but the example embodiments may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. On the contrary, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0056] The terms used herein are for the purpose of describing particular embodiments only and are not intended to limit the present disclosure. As used herein, the singular forms "a" and "the" are also intended to include the plural forms unless the context clearly indicates otherwise. It will also be understood that when the present specification uses the terms "comprises" and / or "consists of", it specifies the presence of the stated features, wholes, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their groups.

[0057] It will be understood that although the terms first, second, etc. may be used herein to describe various elements / instruction / requests, these elements / instruction / requests should not be limited by these terms. These terms are only used to distinguish one element / instruction / request from another element / instruction / request.

[0058] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless expressly so defined herein.

[0059] Figure 1 The figure is a flowchart of a default gateway management method provided by an embodiment of the present invention. The method uses a gateway manager as the execution entity, which is deployed on a cloud platform and is used to allocate default gateways for containers deployed on the cloud platform.

[0060] As Figure 1 shown, the method includes:

[0061] Step S101: In response to a default gateway application request, detect the target attribute tags of the target application container.

[0062] In the present invention, when the target application container is started, the target application container sends a default gateway application request to the container gateway configurator. After receiving the default gateway application request, the container gateway configurator sends the default gateway application request to the gateway manager, so that the gateway manager allocates a default gateway for the target application container. Of course, in some embodiments, the default gateway application request may also be directly sent from the target application container to the gateway manager. At this time, the container gateway configurator is actually set as a functional module of the application container.

[0063] After receiving the default gateway application request, the gateway manager detects the target attribute tags of the target application container. In the present invention, when each application container is deployed on the cloud platform, it sends its own information to the cloud platform for storage. This information includes the identifier of the application container and the attribute tags related to the application container. The attribute tags related to the application container may include: the attribute tags of the container itself, the attribute tags of the user to which the container belongs, and the attribute tags of the group to which the container belongs, etc. It should be noted that not all of the above attribute tags of each application container exist, and the attribute tags of each application container are configured by the user according to actual needs during deployment.

[0064] Step S102: If the target attribute tags exist and there is a target default gateway pool in the gateway resource pool that is configured with the target attribute tags, allocate a default gateway for the target application container from the target default gateway pool.

[0065] The gateway resource pool is a resource pool preset in the gateway manager. There are multiple default gateway pools set in the gateway resource pool. At least one gateway is set in each default gateway pool for allocation to application containers for use. Each default gateway pool can be configured with attribute tags. It should be noted that the attribute tags configured for the default gateway pool correspond to the attribute tags of the application container. The attribute tags of the application container referred to here refer to the attribute tags configured by the application container itself, or the attribute tags configured by the user to which the application container belongs, or the tags configured by the group to which the application container belongs.

[0066] In step S102, after the gateway manager detects the attribute label of the target application container, it detects whether there is a default gateway pool in the gateway resource pool that is configured with the target attribute label of the target application container, and uses this default gateway pool as the target default gateway pool. After detecting the existence of the target default gateway pool, it allocates a default gateway for the target application container from this target default gateway pool.

[0067] Specifically, when selecting a default gateway from the target default gateway pool, it can be implemented based on a pre-set allocation policy, which can be pre-set by those skilled in the art in the gateway manager according to actual needs. Specifically, if the target default gateway pool is configured with an allocation policy, then an available gateway is selected from the target default gateway pool according to the configured allocation policy and allocated to the target application container. When the target default gateway pool is not configured with an allocation policy, an available gateway is randomly selected from the target default gateway pool and allocated to the target application container.

[0068] As an optional implementation form of the allocation policy, step S102 may specifically include: selecting an available gateway from the target default gateway pool based on a polling policy. Specifically, an available gateway is selected from the available gateway list of the target default gateway pool according to the polling pointer and allocated to the target default gateway pool.

[0069] As another optional implementation form of the allocation policy, step S102 may specifically include: selecting an available gateway with the smallest number of allocated times from the target default gateway pool. Specifically, each gateway in the target default gateway pool records the number of allocated times. An available gateway with the smallest number of allocated times is selected from the available gateway list and allocated to the target application container. At the same time, the number of allocated times of the selected available gateway is incremented by one.

[0070] As yet another optional implementation form of the allocation policy, step S102 may specifically include: determining an available gateway with the largest available bandwidth from the target default gateway pool. If the available bandwidth of this available gateway with the largest available bandwidth is greater than the required bandwidth of the target application container, this available gateway with the largest available bandwidth is allocated to the target application container. Specifically, each gateway in the default gateway pool provides information on the available bandwidth of the gateway when registering, such as 1G, 10G, 100G, etc. When the application container applies for a default gateway, it carries information on the required bandwidth for accessing the external network, such as 100M, 1000M, etc. An available gateway with the largest available bandwidth is determined from the available gateway list of the target default gateway pool, and the available bandwidth of this available gateway with the largest available bandwidth is compared with the required bandwidth of the target application container. If the available bandwidth of this available gateway with the largest available bandwidth is greater than the required bandwidth of the target application container, then this available gateway with the largest available bandwidth is allocated to the target application container.

[0071] It should be noted that the specific forms of the above three allocation strategies are only exemplary and will not limit the technical solution of the present invention; in the embodiments of the present invention, other allocation strategies may also be adopted in step S102, and no further examples will be given here.

[0072] In the default gateway management method provided by the embodiments of the present invention, when an application container is started, the application container sends a default gateway application request. After receiving the default gateway application request, the gateway manager selects a gateway from a pre-set default gateway pool corresponding to the attribute label of the application container as the default gateway of the application container. Compared with the prior art, the default gateway management method provided by the present invention allocates a dedicated default gateway corresponding to the application container to each application container, so that when the application container accesses services outside the cloud, the services outside the cloud can identify the identity of the services in the application container through the source IP corresponding to the default gateway of the application container, which facilitates the setting of firewall rules by the services outside the cloud. At the same time, since the external access outlets of different application containers are separated, data traffic load balancing is achieved, and the utilization rate of gateway resources on the cloud platform is improved.

[0073] Continue to refer to Figure 1 , in some embodiments, the target application container may not be configured with target attribute labels (including its own attribute labels, the attribute labels of the belonging user, and the attribute labels of the belonging group), or, although the target application container has target attribute labels, there is no target default gateway pool configured with the target attribute labels in the gateway resource pool. At this time, the preset common default gateway in the gateway resource pool can be directly allocated to the target application container, such as Figure 1 step S102' in

[0074] Figure 2 is a flowchart of another default gateway management method provided by the present invention. As Figure 2 shown, on the basis of the embodiment described in Figure 1 , after step S102 and step S102', the default gateway management method provided in this embodiment further includes:

[0075] Step S103: Send the default gateway allocated to the target application container to the container gateway configurator of the target application container in the form of request response information, container annotation, or container label.

[0076] After determining the target default gateway of the target application container, the gateway manager sends the target default gateway to the container gateway configurator of the target application container, so that the container gateway configurator can configure the target default gateway as the default gateway of the target application container. In this embodiment, the gateway manager sends it to the container gateway configurator of the target application container in the form of request response information, container annotation or container label. Of course, in actual applications, other forms can also be used to send the default gateway.

[0077] Figure 3 It is a flowchart of another default gateway management method provided by an embodiment of the present invention. As Figure 3 shown, based on the embodiment shown in Figure 1 the specific steps of S101 include:

[0078] Step S1011: Obtain the container identifier of the target application container from the default gateway application request.

[0079] Step S1012: Query whether the target application container is configured with an attribute label according to the container identifier.

[0080] If it is queried that the target application container is configured with an attribute label, execute step S1013; if it is queried that the target application container is not configured with an attribute label, execute step S1014.

[0081] Step S1013: Use the attribute label configured by the target application container as the target attribute label.

[0082] Step S1014: Further query whether the owner user of the target application container is configured with an attribute label.

[0083] If it is queried that the owner user is configured with an attribute label, execute step S1015; if it is queried that the owner user is not configured with an attribute label, execute step S1016.

[0084] Step S1015: Use the attribute label configured by the owner user as the target attribute label.

[0085] Step S1016: Further query whether the owning group of the target application container is configured with an attribute label.

[0086] If it is queried that the owning group is configured with an attribute label, execute step S1017; if it is queried that the owning group is not configured with an attribute label, execute step S1018.

[0087] Step S1017: Use the attribute label configured by the owning group as the target attribute label.

[0088] Step S1018: Detect that the target attribute label of the target application container does not exist.

[0089] In this embodiment, when detecting the attribute tags of the target application container, first check whether the attribute tags configured by the target application container itself exist. When it is detected that the attribute tags configured by the target application container itself do not exist, then sequentially check whether the attribute tags configured by the user to which the target application container belongs exist and whether the attribute tags configured by the group to which the target application container belongs exist, so as to finally determine the attribute tags representing the characteristics of the target application container.

[0090] For example, in the present invention, in terms of planning, different attribute tags represent different groups of external network access source IPs. For example, create a default gateway pool GWP-A for manufacturer A, add 3 IP addresses to it, namely IP-A1, IP-A2, and IP-A3, and add the attribute tag gwtype = A to the default gateway pool GWP-A. Then, if the attribute tag gwtype = A is added to the account of manufacturer A, all application containers of manufacturer A will allocate default gateways from IP-A1, IP-A2, and IP-A3. If only a certain application container of manufacturer A is added with the attribute tag gwtype = A, only the container with the added attribute tag can allocate default gateways from IP-A1, IP-A2, and IP-A3.

[0091] Figure 4 It is a flowchart of another default gateway management method provided by an embodiment of the present invention. As Figure 4 shown, based on the embodiment shown in Figure 1 this embodiment, the method further includes:

[0092] Step S104: Monitor the working status of each default gateway in the gateway resource pool.

[0093] In this embodiment, the gateway manager monitors the working status of each default gateway in the gateway resource pool. For example, it is detected at a preset time interval or each time a default gateway application request is received. When it is detected that the working status of a certain default gateway is abnormal, the default gateway with the abnormal working status is marked as unavailable. And when a default gateway marked as unavailable resumes normal, the restored normal default gateway is marked as available. That is, in this embodiment, the gateway manager updates the available gateway list of each default gateway pool according to the detection results, and the available gateway list contains the current available gateways in the default gateway pool. By monitoring the availability of the to-be-allocated default gateway, the effectiveness of the gateway subsequently allocated to the application container is improved, and at the same time, the reachability of the application container accessing the external network is also improved.

[0094] Continue to refer to Figure 4 In some embodiments, the method further includes:

[0095] Step S105: Monitor the viability of the application containers associated with the default gateway allocated in the gateway resource pool.

[0096] In this embodiment, the gateway manager monitors the viability of the application containers associated with the default gateway allocated in the gateway resource pool. For example, the monitoring is performed at a preset time interval. When it is detected that an application container associated with a certain default gateway has been deleted or is operating abnormally, the default gateway referenced by the deleted or abnormally operating application container in the gateway resource pool is released in the default gateway pool to which the default gateway belongs. That is, the reference relationship between the deleted or abnormally operating application container and the default gateway it references is removed in the default gateway resource pool. By monitoring the viability of the application containers associated with the allocated default gateway, this embodiment can timely detect and remove the invalid reference relationship between the application container and the default gateway, thereby avoiding waste of default gateway resources and improving resource utilization.

[0097] Continue to refer to Figure 4 In some embodiments, the method further includes:

[0098] Step S106: Perform management operations on the gateway resource pool.

[0099] Multiple default gateway pools are configured in the gateway resource pool, and at least one default gateway is further configured in each default gateway pool. In practical applications, the gateway manager can perform management operations on the resource management pool to facilitate the effective allocation of default gateways to the containers registered on the cloud platform.

[0100] Specifically, the management operations in Step S106 may specifically include:

[0101] (1) Add a default gateway pool to the gateway resource pool. Specifically, when the cloud environment of the cloud platform is deployed, the gateway manager creates a default gateway pool, which can correspond to the registered users on the cloud platform. For example, one default gateway pool corresponds to one user.

[0102] (2) Query a specific default gateway pool in the gateway resource pool. According to the attribute tags of the application containers, query the specific default gateway pool corresponding to the attribute tags.

[0103] (3) Generate a list of default gateway pools in the gateway resource pool.

[0104] (4) Delete a default gateway pool from the gateway resource pool.

[0105] (5) Deregister a default gateway in the default gateway pool.

[0106] (6) Add attribute tags to the default gateway pool.

[0107] (7)Delete the attribute label for the default gateway pool.

[0108] (8)Configure the default gateway allocation policy for the default gateway pool. For example, a random policy, a polling policy, and an allocation policy based on the number of times allocated or bandwidth.

[0109] It should be noted that the present invention does not specifically limit the execution order of the above steps S104, S105, and S106. In actual applications, steps S104, S105, and S106 are monitored and executed by the gateway manager in real time. Only one execution order of steps S104, S105, and S106 is shown in the appendix, which does not limit the present invention. Figure 4

[0110] The following examples are used to describe the default gateway management method provided by the present invention.

[0111] Suppose that NFV application PODs of three operators, operator A, operator B, and operator C, are deployed on the container platform Kubernetes (Kubernetes, often abbreviated as K8s, is an open-source system for automatically deploying, scaling, and managing "containerized applications", aiming to provide a platform for automatically deploying, scaling, and running application containers across host clusters). Each operator has its own unique cluster and is connected to the current Kubernetes cluster through a firewall. Policies are configured in the firewall to ensure that only a specified set of IP addresses can access the internal services of the corresponding operator's unique cluster.

[0112] When the application containers PODs of the operators are registered, labels are added to the application containers of each operator. Specifically, the label of the application container POD of operator A is gwtype=app-a, the label of the application container POD of operator B is gwtype=app-b, and the label of the application container POD of operator C is gwtype=app-c.

[0113] Use CRD in the Kubernetes cluster to manage the default gateway pool. Correspondingly, user resources of the DefaultGatewayPool (default gateway pool) type need to be defined through the API of Kubernetes. Then, multiple resources of the DefaultGatewayPool type are created through the API of Kubernetes. The addition and deletion of attributes are achieved by adding labels (labels) to the resources of the DefaultGatewayPool type.

[0114] Specifically, create a DefaultGatewayPool named DGP-A with the namespace A, add gateways GAO, GA1, and GA2 to DGP-A, and add the label AppType=CloudA to DGP-A.

[0115] Create a DefauItGatewayPool named DGP-B with the namespace B, add gateways GB0, GB1, and GB2 to DGP-B, and add the label AppType=CloudB to DGP-B.

[0116] Create a DefaultGatewayPool named DGP-C with the namespace C, add gateways GCO, GC1, and GC2 to DGP-C, and add the label AppType=CloudC to DGP-C.

[0117] Set the public default gateway of the Kubernetes cloud to GW.

[0118] When a POD starts, it triggers the execution time of the CNI (CNI (Container Network Interface) is a project under CNCF, consisting of a set of specifications and libraries for configuring the network interfaces of Linux containers, and also includes some plugins. CNI only cares about the network allocation when a container is created and the release of network resources when the container is deleted) plugin. Through the CNI plugin, it triggers the container gateway configurator to apply for the default gateway of the POD. Specifically, the gateway manager detects the label of the POD, and selects the default gateway pool corresponding to the POD label according to the label of the POD. For example, if the label of the POD is gwtype=app-a, the corresponding default gateway pool is the default gateway pool with the label AppType=CloudA, that is, the gateway pool DGP-A, and then selects a default gateway from DGP-A based on a preset allocation rule from the gateway pool DGP-A.

[0119] The present invention also provides a gateway manager. Figure 5 It is a schematic structural diagram of a gateway manager provided by the present invention, which is used to implement the Figure 1 shown default gateway management method, as Figure 5 shown, the gateway manager includes: a monitoring module 11 and an allocation module 12.

[0120] Among them, the detection module 11 is used to detect the target attribute label of the target application container in response to a default gateway application request; the allocation module 12 is used to allocate a default gateway for the target application container from the target default gateway pool when the detection module 11 detects the existence of the target attribute label and there is a target default gateway pool configured with the target attribute label in the gateway resource pool.

[0121] The present invention also provides a server, including: one or more processors and a storage device, where one or more programs are stored on the storage device. When the one or more programs are executed by the one or more processors, the one or more processors implement the default gateway management method provided by the present invention.

[0122] The present invention also provides a storage medium for computer-readable storage. Among them, the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the default gateway management method provided by the present invention.

[0123] Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, and their appropriate combinations. In the hardware implementation, the division of the functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component can have multiple functions, or a function or step can be executed by several physical components in cooperation. Some physical components or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include a computer storage medium (or non-transitory medium) and a communication medium (or transitory medium). As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassette, tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, as is well known to those of ordinary skill in the art, a communication medium generally contains computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium.

[0124] Example embodiments have been disclosed herein, and although specific terms are employed, they are used only and should be interpreted only as general illustrative meanings and not for the purpose of limitation. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly specified, features, characteristics, and / or elements described in connection with a particular embodiment may be used singly or in combination with features, characteristics, and / or elements described in connection with other embodiments. Accordingly, those skilled in the art will understand that various forms and details may be changed without departing from the scope of the disclosure as set forth by the appended claims.

Claims

1. A default gateway management method, wherein: include: In response to the default gateway application request, detecting a target attribute tag of a target application container, wherein the target attribute tag includes at least one of the following: an attribute tag of the target application container, an attribute tag of a user to which the target application container belongs, and an attribute tag configured by a group to which the target application container belongs; In the case where the target attribute tag exists, using the default gateway pool configured with the target attribute tag as the target default gateway pool, and allocating a default gateway for the target application container from the target default gateway pool; If the target attribute tag does not exist, or the target attribute tag exists but there is no target default gateway pool configured with the target attribute tag in the gateway resource pool, the preset public default gateway in the gateway resource pool is allocated to the target application container.

2. The method according to claim 1, wherein After the step of allocating a default gateway for the target application container from the target default gateway pool, the method further includes: The default gateway assigned to the target application container is sent to the container gateway configurator of the target application container in the form of request response information, container annotation or container label.

3. The method according to claim 1, wherein The step of allocating a default gateway for the target application container from the target default gateway pool includes: If the target default gateway pool is not configured with an allocation policy, randomly select an available gateway from the target default gateway pool and allocate it to the target application container; If the target default gateway pool is configured with an allocation policy, an available gateway is selected from the target default gateway pool according to the configured allocation policy and allocated to the target application container.

4. The method according to claim 1, wherein The step of selecting an available gateway from the target default gateway pool and allocating it to the target application container according to the configured allocation policy includes: Selecting an available gateway from the target default gateway pool based on a polling strategy and assigning it to the target application container; Alternatively, an available gateway with the least number of allocations is selected from the target default gateway pool and allocated to the target application container; Alternatively, an available gateway with the largest available bandwidth is determined from the target default gateway pool. If the available bandwidth of the available gateway with the largest available bandwidth is greater than the required bandwidth of the target application container, the available gateway with the largest available bandwidth is allocated to the target application container.

5. The method according to claim 1, wherein The step of detecting the target attribute tag of the target application container includes: Obtaining a container identifier of a target application container from the default gateway application request; querying, according to the container identifier, whether the target application container is configured with an attribute tag; If it is found that the target application container is configured with an attribute tag, the attribute tag configured for the target application container is used as the target attribute tag; If the target application container is not configured with an attribute tag, further query whether the user to which the target application container belongs is configured with an attribute tag; If it is found that the home user is configured with an attribute tag, the attribute tag configured by the home user is used as the target attribute tag; If it is found that the attribute tag is not configured for the user, further query whether the attribute tag is configured for the group to which the target application container belongs; If it is found that the belonging group is configured with an attribute tag, the attribute tag configured by the belonging group is used as the target attribute tag; If it is found that the belonging group is not configured with an attribute tag, it is detected that the target attribute tag of the target application container does not exist.

6. The method according to claim 1, wherein It also includes: monitoring the working status of each default gateway in the gateway resource pool; If there is a default gateway in abnormal working state, the default gateway in abnormal working state is marked as unavailable; If a default gateway that was marked as unavailable recovers to normal, the recovered default gateway is marked as available.

7. The method according to claim 1, wherein The method further includes: monitoring the viability of an application container associated with an allocated default gateway in the gateway resource pool; If an associated application container is deleted or works abnormally, the default gateway referenced by the deleted or abnormally working application container in the gateway resource pool is released.

8. The method according to claim 1, wherein Also includes: Perform management operations on the gateway resource pool.

9. The method according to claim 8, wherein The step of performing management operations on the gateway resource pool includes at least one of the following: Adding a default gateway pool to the gateway resource pool; Querying a specific default gateway pool in the gateway resource pool; Generate a default gateway pool list for the gateway resource pool; Deleting a default gateway pool from the gateway resource pool; Unregister the default gateway in the default gateway pool; Add attribute tags for the default gateway pool; Delete the attribute tag for the default gateway pool; Configure the default gateway assignment policy for the default gateway pool.

10. A gateway manager, wherein: include: a detection module, configured to detect, in response to a default gateway application request, a target attribute tag of a target application container, wherein the target attribute tag includes at least one of the following: an attribute tag of the target application container, an attribute tag of a user to which the target application container belongs, and an attribute tag configured by a group to which the target application container belongs; an allocation module configured to, when the target attribute tag exists, use a default gateway pool configured with the target attribute tag as a target default gateway pool, and allocate a default gateway for the target application container from the target default gateway pool; The allocation module is further configured to allocate a preset public default gateway in the gateway resource pool to the target application container if the target attribute tag does not exist, or if the target attribute tag exists but there is no target default gateway pool configured with the target attribute tag in the gateway resource pool.

11. A server comprising: one or more processors; A storage device having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the default gateway management method according to any one of claims 1 to 9.

12. A storage medium for computer-readable storage, wherein: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the default gateway management method according to any one of claims 1 to 9.