Inter-tenant network connection method and apparatus

By obtaining and processing network connection custom resource information, determining tenant and namespace information, and creating network policies, it solves the problem of network connection abnormalities caused by CNI plug-ins in cloud native, and achieves stable and efficient connection between tenants.

WO2024230222A1PCT designated stage expired Publication Date: 2024-11-14JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/071023
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-05
Filing Date
2024-01-08
Publication Date
2024-11-14

AI Technical Summary

Technical Problem

In the cloud native field, when using CNI plug-in to implement custom configuration of tenant networks, there are often problems with abnormal network connection between multiple tenants.

Method used

By obtaining pre-configured network connection custom resource information, determining the tenant information set and namespace information, creating network policy information, and establishing network connections between tenants based on this information, realizing stable network connections between tenants.

Benefits of technology

It realizes custom configuration and stable connection between tenants, solves the problem of network connection abnormalities between multiple tenants caused by CNI plug-in, and improves the speed and efficiency of network connection between tenants.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024071023_14112024_PF_FP_ABST
    Figure CN2024071023_14112024_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in embodiments of the present disclosure are an inter-tenant network connection method and apparatus. A specific implementation of the method comprises: obtaining first network connection customized resource information; in response to receiving an inter-tenant network connection event, determining a first network connection tenant information set corresponding to the first network connection customized resource information; determining a first namespace information set corresponding to each piece of network connection tenant information in the first network connection tenant information set to obtain a first namespace information set group; for each piece of first namespace information in the first namespace information set group, creating network policy information corresponding to the first namespace information as first network policy information; and establishing an inter-tenant network connection for the first network connection tenant information set according to a first network policy information set group.
Need to check novelty before this filing date? Find Prior Art

Description

Inter-tenant network connection method and device

[0001] This disclosure claims priority to Chinese patent application No. 202310499204.3, filed on May 5, 2023, entitled “Inter-tenant network connection method, device, electronic device and computer-readable medium”, and the contents of the above-mentioned Chinese patent application disclosure are hereby cited in their entirety as part of this application. Technical Field

[0002] Embodiments of the present disclosure relate to the field of computer technology, and more particularly to a method and apparatus for connecting a network between tenants. Background Art

[0003] Currently, cloud-native container orchestration platforms offer powerful container orchestration capabilities, open network interfaces, and support custom container networks. Tenant network configuration typically involves using a CNI (Container Network Interface) plug-in to customize the network configuration for each tenant.

[0004] However, the inventors have discovered that when the above method is adopted, the following technical problems often occur:

[0005] Using CNI plug-ins to implement custom configuration of tenant networks often leads to abnormal network connectivity between multiple tenants.

[0006] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure concept and therefore it may contain information that does not form the prior art that is already known to a person of ordinary skill in the art.

[0007] Summary of the Invention

[0008] The content of this disclosure is used to briefly introduce concepts that will be described in detail in the detailed description section below. The content of this disclosure is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0009] Some embodiments of the present disclosure provide a method, apparatus, electronic device, and computer-readable medium for connecting a network between tenants to solve the technical problems mentioned in the background technology section above.

[0010] According to the first aspect of the present disclosure, some embodiments of the present disclosure provide a method for inter-tenant network connection, including: obtaining pre-configured first network connection custom resource information; in response to receiving an inter-tenant network connection event for the above-mentioned first network connection custom resource information, determining the first network connection tenant information set corresponding to the above-mentioned first network connection custom resource information; determining the first namespace information set corresponding to each network connection tenant information in the above-mentioned first network connection tenant information set to obtain a first namespace information set group; for each first namespace information in the above-mentioned first namespace information set group, creating network policy information corresponding to the above-mentioned first namespace information as the first network policy information; and establishing an inter-tenant network connection for the above-mentioned first network connection tenant information set based on the obtained first network policy information set group.

[0011] According to one or more embodiments of the present disclosure, the above method also includes: obtaining pre-configured first tenant custom resource information; in response to receiving a tenant definition event for the above first tenant custom resource information, determining the second namespace information set and tenant information set corresponding to the above first tenant custom resource information; determining the network policy information corresponding to each second namespace information in the above second namespace information set as the second network policy information, and obtaining the second network policy information set; based on the above second network policy information set, executing the establishment of an association relationship between the above second namespace information set and the above tenant information set.

[0012] According to one or more embodiments of the present disclosure, the above method also includes: obtaining pre-configured second network connection custom resource information and second tenant custom resource information; in response to receiving a namespace establishment event, determining a defined tenant information set based on the above second tenant custom resource information; establishing an internal network for each defined tenant information in the above defined tenant information set corresponding to the defined tenant; in response to determining that the internal network of each defined tenant has been established, determining a second network connection tenant information set based on the above second network connection custom resource information, wherein the above second network connection tenant information set is a subset of the above defined tenant information set; and establishing an inter-tenant network for the above second network connection tenant information set.

[0013] According to one or more embodiments of the present disclosure, the above method also includes: in response to receiving a network connection adjustment event for the above-mentioned first network connection tenant information set, obtaining the above-mentioned first network policy information set group and network connection adjustment information; performing information adjustment on the network policy information in the above-mentioned first network policy information set group that corresponds to the above-mentioned network connection adjustment information to generate first network policy adjustment information and obtain the first network policy adjustment information set group; and according to the above-mentioned first network policy adjustment information set group, performing inter-tenant network adjustment of the corresponding network connection tenant information subset.

[0014] According to one or more embodiments of the present disclosure, the above method also includes: in response to receiving an association relationship adjustment event for tenant-namespace association relationship information, obtaining tenant-namespace relationship adjustment information; adjusting at least one second network policy information in the above second network policy information set that is associated with the above tenant-namespace relationship adjustment information to obtain at least one second network policy adjustment information; and executing the association relationship adjustment for the above tenant-namespace association relationship information based on the above at least one second network policy adjustment information.

[0015] According to one or more embodiments of the present disclosure, the above-mentioned determination of the first namespace information set corresponding to each network connection tenant information in the above-mentioned first network connection tenant information set includes: using a namespace selector to determine the first namespace information set corresponding to each network connection tenant information in the above-mentioned first network connection tenant information set.

[0016] According to one or more embodiments of the present disclosure, the tenant network connections between the individual first network connection tenant information in the above-mentioned first network connection tenant information set are pre-isolated based on the target tenant network isolation plug-in.

[0017] According to the second aspect of the present disclosure, some embodiments of the present disclosure provide an inter-tenant network connection device, including: an acquisition unit, configured to acquire pre-configured first network connection custom resource information; a first determination unit, configured to determine the first network connection tenant information set corresponding to the above-mentioned first network connection custom resource information in response to receiving an inter-tenant network connection event for the above-mentioned first network connection custom resource information; a second determination unit, configured to determine the first namespace information set corresponding to each network connection tenant information in the above-mentioned first network connection tenant information set, and obtain a first namespace information set group; a creation unit, configured to create network policy information corresponding to the above-mentioned first namespace information for each first namespace information in the above-mentioned first namespace information set group as the first network policy information; and an establishment unit, configured to establish an inter-tenant network connection for the above-mentioned first network connection tenant information set based on the obtained first network policy information set group.

[0018] According to the third aspect of the present disclosure, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by one or more processors, the one or more processors implement the method described in any implementation method in the first aspect.

[0019] According to a fourth aspect of the present disclosure, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any implementation manner in the first aspect is implemented.

[0020] According to a fifth aspect of the present disclosure, some embodiments of the present disclosure provide a computer program product, including a computer program, which implements the method described in any implementation manner in the above first aspect when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.

[0022] FIG1 is a schematic diagram of an application scenario of a method for connecting a network between tenants according to some embodiments of the present disclosure;

[0023] FIG2 is a flow chart of some embodiments of a method for connecting a network between tenants according to the present disclosure;

[0024] FIG3 is a flowchart of another embodiment of the inter-tenant network connection method according to the present disclosure;

[0025] FIG4 is a schematic diagram of inter-tenant network adjustment in some embodiments of the inter-tenant network connection method according to the present disclosure;

[0026] FIG5 is a schematic structural diagram of some embodiments of an inter-tenant network connection device according to the present disclosure;

[0027] FIG6 is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION

[0028] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0029] It should also be noted that, for ease of description, only the parts related to the relevant disclosure are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other.

[0030] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0031] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".

[0032] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0033] Before performing operations such as the collection, storage, and use of the information involved in this disclosure (for example, the first network connection custom resource information), the relevant organizations or individuals must fulfill their obligations, including conducting information security impact assessments, fulfilling their obligation to inform the information subject, and obtaining the authorization and consent of the information subject in advance.

[0034] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0035] FIG1 is a schematic diagram of an application scenario of a method for connecting a network between tenants according to some embodiments of the present disclosure.

[0036] In the application scenario of Figure 1 , electronic device 101 may first obtain pre-configured first network connection custom resource information 102. In this application scenario, first network connection custom resource information 102 may include network connections between the first tenant and the second tenant, and network connections between the third tenant and the fourth tenant. Then, in response to receiving an inter-tenant network connection event for first network connection custom resource information 102, electronic device 101 may determine a first network connection tenant information set 103 corresponding to first network connection custom resource information 102. In this application scenario, first network connection tenant information set 103 may include first tenant information 1031, second tenant information 1032, third tenant information 1033, and fourth tenant information 1034. Next, electronic device 101 may determine the first namespace information set corresponding to each piece of network connection tenant information in first network connection tenant information set 103, thereby obtaining a first namespace information set group. In this application scenario, first namespace information set 104 corresponding to first tenant information 1031 includes namespace C 1041 and namespace D 1042. The first namespace information set corresponding to second tenant information 1032 includes namespace A 105. The first namespace information set corresponding to third tenant information 1033 includes namespace B 106. The first namespace information set 107 corresponding to fourth tenant information 1034 includes namespace F 1071 and namespace O 1072. Furthermore, for each first namespace information in the first namespace information set group, electronic device 101 can create network policy information corresponding to the first namespace information as first network policy information. In this application scenario, first namespace information set 104 corresponds to first network policy information set 108. First network policy information set 108 includes first network policy information 1081 corresponding to namespace C 1041 and first network policy information 1082 corresponding to namespace D 1042. First namespace information 105 corresponds to first network policy information set 109. First namespace information 106 corresponds to first network policy information set 110. First namespace information set 107 corresponds to first network policy information set 111. First network policy information set 111 includes first network policy information 1111 corresponding to namespace F 1071 and first network policy information 1112 corresponding to namespace O 1072. Finally, based on the obtained first network policy information set group, an inter-tenant network connection is established for the first network connection tenant information set 103.

[0037] It should be noted that the electronic device 101 can be hardware or software. When the electronic device is hardware, it can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or it can be implemented as a single server or a single terminal device. When the electronic device is embodied as software, it can be installed in the hardware devices listed above. It can be implemented as multiple software or software modules for providing distributed services, for example, or it can be implemented as a single software or software module. No specific limitation is made here.

[0038] It should be understood that the number of electronic devices in FIG1 is merely illustrative and any number of electronic devices may be provided according to implementation requirements.

[0039] 2, a process 200 of some embodiments of the inter-tenant network connection method according to the present disclosure is shown. The inter-tenant network connection method includes the following steps:

[0040] Step 201: Obtain pre-configured first network connection custom resource information.

[0041] In some embodiments, the executing entity of the above-mentioned inter-tenant network connection method (e.g., the electronic device 101 shown in FIG. 1 ) can obtain pre-configured first network connection custom resource information via a wired or wireless connection. The first network connection custom resource information can be pre-configured tenant resource information representing inter-tenant communication (i.e., network connection). In practice, the first network connection custom resource information can be a CR (Custom Resource) resource with a specific data structure for multiple tenants. The CR resource defines tenant information requiring inter-tenant network connection. The tenant information can be information representing the tenant's identity. It should be noted that a tenant can be for a single user or a group of users, and there is at least one corresponding namespace. It should be noted that different tenants are isolated using at least one corresponding namespace. A namespace can be a namespace under Kubernetes (a container orchestration platform). Kubernetes supports multiple virtual clusters, which rely on the same physical cluster at the bottom layer. These virtual clusters are called namespaces. A namespace is a Kubernetes cluster-level resource. In practice, corresponding namespaces can be created for different users, tenants, environments, or projects. Namespaces can be used to separate resources such as process trees, network interfaces, mount points, and inter-process communication.

[0042] It should be noted that the execution subject may be a tenant controller. The tenant controller may be a pre-set controller. The tenant controller may be a controller that configures and processes tenant-related information.

[0043] In some optional implementations of some embodiments, the tenant network connections between the first network connection tenant information in the first network connection tenant information set are pre-isolated based on a target tenant network isolation plug-in. The target tenant network isolation plug-in may be a CNI (Container Network Interface) plug-in.

[0044] Step 202 : In response to receiving an inter-tenant network connection event for the first network connection custom resource information, determining a first network connection tenant information set corresponding to the first network connection custom resource information.

[0045] In some embodiments, in response to receiving an inter-tenant network connection event for the first network connection custom resource information, the execution entity may determine a first network connection tenant information set corresponding to the first network connection custom resource information. The inter-tenant network connection event may be an event for executing a corresponding inter-tenant network connection. The first network connection tenant information set may be a tenant information set to be connected that is involved in the first network connection custom resource information.

[0046] In practice, the first network connection tenant information set may include {"a first tenant establishes a network connection with a second tenant," "a third tenant, a fourth tenant, and a fifth tenant establish a network connection." The corresponding first network connection tenant information set may include: information about the first tenant, information about the second tenant, information about the third tenant, information about the fourth tenant, and information about the fifth tenant.

[0047] As an example, the execution entity may receive an inter-tenant network connection event for the first network connection custom resource information through an API server (interface service) in k8s (Kubernetes, a container orchestration platform).

[0048] As another example, the execution entity may generate the first network connection tenant information set by determining a tenant field in the first network connection custom resource information.

[0049] Step 203 : Determine the first namespace information set corresponding to each network connection tenant information in the first network connection tenant information set to obtain a first namespace information set group.

[0050] In some embodiments, the execution entity may determine the first namespace information set corresponding to each piece of network connection tenant information in the first network connection tenant information set to obtain a first namespace information set group. The first namespace information set may include at least one piece of first namespace information. The first namespace information may correspond to namespace identification information. The association between the network connection tenant information and the corresponding first namespace information set is a pre-established relationship.

[0051] In some optional implementations of some embodiments, the execution entity may use a namespace selector to determine the first namespace information set corresponding to each network connection tenant information in the first network connection tenant information set. The namespace selector may be a selector that filters namespaces based on labels. In practice, the namespace selector may be a namespaces selector.

[0052] Step 204: For each first namespace information in the first namespace information set, create network policy information corresponding to the first namespace information as first network policy information.

[0053] In some embodiments, the execution entity may create network policy information corresponding to the first namespace information for each first namespace information in the first namespace information set group as the first network policy information. The first network policy information may be a Network Policy resource. Network Policy is a specification of the communication rules allowed between Pods (the smallest deployable computing unit created and managed in Kubernetes) and other Network Endpoints. Network Policy can act on the pods under the corresponding namespace to implement corresponding network connection management and control.

[0054] Step 205: Establish an inter-tenant network connection for the first network connection tenant information set according to the obtained first network policy information set group.

[0055] In some embodiments, the execution entity may establish an inter-tenant network connection for the first network connection tenant information set based on the obtained first network policy information set group.

[0056] In practice, the first network connection tenant information set includes: first tenant information, second tenant information, third tenant information, fourth tenant information, and fifth tenant information. The first network connection tenant information set is {"the first tenant establishes a network connection with the second tenant," "the third tenant, the fourth tenant, and the fifth tenant establish a network connection"}. Therefore, the execution entity can establish a network connection between the first tenant and the second tenant, and can also establish network connections between the third tenant, the fourth tenant, and the fifth tenant.

[0057] As an example, the above-mentioned execution entity can use the open source calico network plug-in, flannel network plug-in and / or cilium network plug-in to establish an inter-tenant network connection for the above-mentioned first network connection tenant information set based on the obtained first network policy information set group.

[0058] In some optional implementations of some embodiments, after step 205, the steps further include:

[0059] The first step is to obtain the pre-configured second network connection custom resource information and the second tenant custom resource information. The second network connection custom resource information can also be pre-customized tenant resource information that represents the communication between tenants (i.e., network connection). The second network connection custom resource information can be the same as the first network connection custom resource information or different. The second tenant custom resource information can represent the correspondence between the tenant and the namespace. The second tenant custom resource information represents the correspondence between the tenant and the namespace. For example, the second tenant custom resource information may include: "the correspondence between tenant A and "A namespace", "the correspondence between tenant B and "B namespace", "the correspondence between tenant C and "C namespace".

[0060] In a second step, in response to receiving the namespace establishment event, a tenant information set is determined based on the second tenant's custom resource information. The namespace establishment event may be an event for establishing at least one namespace corresponding to a tenant. The tenant information in the tenant information set may be the tenant information involved in the second tenant's custom resource information.

[0061] In practice, in response to receiving the namespace establishment event, the execution entity may filter out the "tenant information field" from the second tenant custom resource information to generate a defined tenant information set.

[0062] The third step is to create an internal network for each tenant defined in the tenant information set. The internal network for a tenant can be a container network between containers in the pod corresponding to the defined tenant.

[0063] As an example, the execution entity may establish a plug-in through a related internal network to establish an internal network corresponding to a defined tenant for each defined tenant information in the defined tenant information set.

[0064] In step 4, in response to determining that the internal network of each defined tenant has been established, a second network connection tenant information set is determined based on the second network connection custom resource information. The second network connection tenant information set is a subset of the defined tenant information set. The second network connection tenant information in the second network connection tenant information set may include tenant information for a tenant to establish a network connection between tenants.

[0065] As an example, the execution entity may filter out information associated with the tenant field from the network connection custom resource information to obtain the second network connection tenant information set.

[0066] Step 5: Establish an inter-tenant network for the second network connection tenant information set.

[0067] The specific implementation method will not be described here.

[0068] In some optional implementations of some embodiments, after step 205, the steps further include:

[0069] The first step is to obtain the first network policy information set group and network connection adjustment information in response to receiving a network connection adjustment event for the first network connection tenant information set.

[0070] The network connection adjustment event may be an event for adjusting the network connection between tenants. The network connection adjustment information may include: information about each tenant whose network connection has changed and information about the change of each tenant.

[0071] In the second step, the network policy information corresponding to the network connection adjustment information in the first network policy information set is adjusted to generate first network policy adjustment information, thereby obtaining a first network policy adjustment information set. The first network policy adjustment information may represent the adjusted network connection status of the corresponding tenant. The network policy information corresponding to the network connection adjustment information may be the network policy information corresponding to the tenant involved in the network connection adjustment information.

[0072] In the third step, based on the first network policy adjustment information set group, inter-tenant network adjustment corresponding to the network connection tenant information subset is performed.

[0073] As an example, the above-mentioned execution entity can use the open source calico network plug-in, flannel network plug-in and / or cilium network plug-in to adjust the information set group according to the above-mentioned first network policy and perform inter-tenant network adjustment of the corresponding network connection tenant information subset.

[0074] The above-described embodiments of the present disclosure have the following beneficial effects: Through the inter-tenant network connection methods of some embodiments of the present disclosure, inter-tenant network connections can be quickly and efficiently implemented. Specifically, the cause of related inter-tenant network connection anomalies is that the use of CNI plug-ins to implement customized configuration of tenant networks often results in multi-tenant network connection anomalies. Based on this, the inter-tenant network connection methods of some embodiments of the present disclosure first obtain pre-configured first network connection custom resource information for subsequent determination of tenant information for inter-tenant network connection. Custom configuration of inter-tenant network connection can be implemented using the first network connection custom resource information. Then, in response to receiving an inter-tenant network connection event for the first network connection custom resource information, a first network connection tenant information set corresponding to the first network connection custom resource information is determined. Here, the determination of the first network connection tenant information set is used for subsequent determination of first namespace information, thereby enabling subsequent inter-tenant network connection implementation based on the first namespace corresponding to the tenant. Next, the first namespace information set corresponding to each network connection tenant information in the first network connection tenant information set is determined to obtain a first namespace information set group. Here, the namespace information set corresponding to each network connection tenant information obtained is used for the subsequent construction of the corresponding network policy information to achieve network connection between tenants. Furthermore, for each first namespace information in the above-mentioned first namespace information set group, network policy information corresponding to the above-mentioned first namespace information is created as the first network policy information. Here, the first network policy information obtained can represent the connection execution policy of the inter-tenant network of the corresponding tenant to achieve the subsequent inter-tenant network connection of the corresponding tenant. Finally, based on the obtained first network policy information set group, an inter-tenant network connection is established for the above-mentioned first network connection tenant information set to achieve a stable network connection between tenants. In summary, through the first network connection custom resource information, custom configuration of the network between tenants can be achieved. Based on this, by establishing corresponding network policy information in the first namespace corresponding to the first network connection tenant information, a stable network connection between tenants can be achieved quickly and efficiently.

[0075] Further referring to FIG3 , a process 300 of another embodiment of the inter-tenant network connection method according to the present disclosure is shown. The inter-tenant network connection method includes the following steps:

[0076] Step 301: Obtain pre-configured first network connection custom resource information.

[0077] Step 302: In response to receiving an inter-tenant network connection event for the first network connection custom resource information, determine a first network connection tenant information set corresponding to the first network connection custom resource information.

[0078] Step 303 : Determine the first namespace information set corresponding to each network connection tenant information in the first network connection tenant information set to obtain a first namespace information set group.

[0079] Step 304: For each first namespace information in the first namespace information set, create network policy information corresponding to the first namespace information as first network policy information.

[0080] Step 305: Establish an inter-tenant network connection for the first network connection tenant information set according to the obtained first network policy information set group.

[0081] In some embodiments, the specific implementation of steps 301-305 and the technical effects brought about by them can refer to steps 201-205 in the embodiment corresponding to Figure 2, and will not be repeated here.

[0082] Step 306: Obtain pre-configured first tenant custom resource information.

[0083] In some embodiments, the execution entity (e.g., the electronic device 101 shown in FIG1 ) may obtain pre-configured first tenant custom resource information. The first tenant custom resource information may represent the correspondence between the tenant and the namespace. The first tenant custom resource information may represent the correspondence between the tenant and the namespace. The first tenant custom resource information may be the same as the second tenant custom resource information, or may be different from the second tenant custom resource information.

[0084] Step 307 : In response to receiving a tenant definition event for the first tenant custom resource information, determining a second namespace information set and a tenant information set corresponding to the first tenant custom resource information.

[0085] In some embodiments, in response to receiving a tenant-defined event for the first tenant-defined resource information, the execution entity may determine a second namespace information set and a tenant information set corresponding to the first tenant-defined resource information. The tenant-defined event may be an event that defines an association between a tenant and a namespace. The second namespace information in the second namespace information set may be information related to a namespace field in the first tenant-defined resource information. The tenant information in the tenant information set may be information related to a tenant field in the first tenant-defined resource information.

[0086] As an example, the execution entity may receive a tenant-defined event for the first tenant's customized resource information through an API server.

[0087] As an example, the execution entity may use a namespaces selector to determine the second namespace information set corresponding to the first tenant custom resource information.

[0088] Step 308: Determine the network policy information corresponding to each second namespace information in the second namespace information set as the second network policy information to obtain the second network policy information set.

[0089] In some embodiments, the execution entity may determine the network policy information corresponding to each second namespace information in the second namespace information set as the second network policy information, thereby obtaining the second network policy information set. The second network policy information may be a Network Policy resource. The second network policy information may be applied to pods in the corresponding namespace to define the corresponding relationship between the tenant and the namespace.

[0090] Step 309: Establish an association relationship between the second namespace information set and the tenant information set based on the second network policy information set.

[0091] In some embodiments, the execution entity may establish an association relationship between the second namespace information set and the tenant information set based on the second network policy information set.

[0092] As an example, the above-mentioned execution entity can use the open source calico network plug-in, flannel network plug-in and / or cilium network plug-in to establish the association relationship between the above-mentioned second namespace information set and the above-mentioned tenant information set based on the above-mentioned second network policy information set.

[0093] In some optional implementations of some embodiments, after step 309, the steps further include:

[0094] The first step is to obtain tenant-namespace relationship adjustment information in response to receiving an association relationship adjustment event for tenant-namespace association information. The tenant-namespace association relationship may be a relationship representing an association between the tenant and the namespace for first tenant custom resource information. The association relationship adjustment event may be an event for adjusting the association relationship between the tenant and the namespace. The tenant-namespace relationship adjustment information may represent the adjustment between the tenant and the namespace.

[0095] In a second step, at least one second network policy information item in the second network policy information set that is associated with the tenant-namespace relationship adjustment information is adjusted to obtain at least one second network policy adjustment information item. The at least one second network policy information item associated with the tenant-namespace relationship adjustment information item may be at least one second network policy information item corresponding to the namespace information involved in the tenant-namespace relationship adjustment information item.

[0096] In a third step, based on the at least one second network policy adjustment information, an association relationship adjustment is performed on the tenant-namespace association relationship information.

[0097] As an example, the above-mentioned execution entity can use the open source calico network plug-in, flannel network plug-in and / or cilium network plug-in to adjust the above-mentioned at least one second network policy information and perform the association relationship adjustment for the above-mentioned tenant and namespace association relationship information.

[0098] As an example, as shown in Figure 4, for an association adjustment event, tenant information set 401 corresponding to the tenant-namespace association information includes first tenant information 4011, second tenant information 4012, third tenant information 4013, and fourth tenant information 4014. The original network connection between first tenant information 4011 and second tenant information 4012, and the original network connection between third tenant information 4013 and fourth tenant information 4014, can be adjusted to a network connection between first tenant information 4011, second tenant information 4012, third tenant information 4013, and fourth tenant information 4014.

[0099] As can be seen from Figure 3, compared with the description of some embodiments corresponding to Figure 2, the process 300 of the inter-tenant network connection method in some embodiments corresponding to Figure 3 can quickly respond to tenant-defined events through the obtained first tenant custom resource information, and efficiently execute the association relationship between the namespace and the corresponding tenant information.

[0100] Further referring to Figure 5, as an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a network connection device between tenants. These device embodiments correspond to the method embodiments shown in Figure 2. The network connection device between tenants can be specifically applied to various electronic devices.

[0101] As shown in FIG5 , an inter-tenant network connection apparatus 500 includes: an acquisition unit 501, a first determination unit 502, a second determination unit 503, a creation unit 504, and an establishment unit 505. The acquisition unit 501 is configured to acquire pre-configured first network connection custom resource information; the first determination unit 502 is configured to, in response to receiving an inter-tenant network connection event for the first network connection custom resource information, determine a first network connection tenant information set corresponding to the first network connection custom resource information; the second determination unit 503 is configured to determine a first namespace information set corresponding to each piece of network connection tenant information in the first network connection tenant information set to obtain a first namespace information set group; the creation unit 504 is configured to, for each piece of first namespace information in the first namespace information set group, create network policy information corresponding to the first namespace information as first network policy information; and the establishment unit 505 is configured to establish an inter-tenant network connection for the first network connection tenant information set based on the obtained first network policy information set group.

[0102] In some optional implementations of some embodiments, the above-mentioned device 500 also includes: a first information acquisition unit, a third determination unit, a fourth determination unit and a first execution unit (not shown in the figure). Among them, the above-mentioned first information acquisition unit can be configured to: obtain the pre-configured first tenant custom resource information. The third determination unit can be configured to: in response to receiving a tenant definition event for the above-mentioned first tenant custom resource information, determine the second namespace information set and tenant information set corresponding to the above-mentioned first tenant custom resource information. The fourth determination unit can be configured to: determine the network policy information corresponding to each second namespace information in the above-mentioned second namespace information set as the second network policy information, and obtain the second network policy information set. The first execution unit can be configured to: execute the establishment of the association relationship between the above-mentioned second namespace information set and the above-mentioned tenant information set according to the above-mentioned second network policy information set.

[0103] In some optional implementations of some embodiments, the above-mentioned device 500 further includes: a second acquisition unit, a fifth determination unit, a first network establishment unit, a sixth determination unit, and a second network establishment unit (not shown in the figure). The above-mentioned second acquisition unit can be configured to: obtain pre-configured second network connection custom resource information and second tenant custom resource information. The fifth determination unit can be configured to: in response to receiving a namespace establishment event, determine the defined tenant information set based on the above-mentioned second tenant custom resource information. The first network establishment unit can be configured to: establish an internal network for each defined tenant information corresponding to the defined tenant in the above-mentioned defined tenant information set. The sixth determination unit can be configured to: in response to determining that the internal network of each defined tenant has been established, determine the second network connection tenant information set based on the above-mentioned second network connection custom resource information, wherein the above-mentioned second network connection tenant information set is a subset of the above-mentioned defined tenant information set. The second network establishment unit can be configured to: establish an inter-tenant network for the above-mentioned second network connection tenant information set.

[0104] In some optional implementations of some embodiments, the above-mentioned device 500 further includes: a third acquisition unit, a first information adjustment unit and a first network adjustment unit (not shown in the figure). The above-mentioned third acquisition unit can be configured to: in response to receiving a network connection adjustment event for the above-mentioned first network connection tenant information set, obtain the above-mentioned first network policy information set group and network connection adjustment information. The first information adjustment unit can be configured to: perform information adjustment on the network policy information in the above-mentioned first network policy information set group that corresponds to the above-mentioned network connection adjustment information to generate first network policy adjustment information and obtain the first network policy adjustment information set group. The first network adjustment unit can be configured to: perform inter-tenant network adjustment of the corresponding network connection tenant information subset according to the above-mentioned first network policy adjustment information set group.

[0105] In some optional implementations of some embodiments, the above-mentioned device 500 further includes: a fourth acquisition unit, a second information adjustment unit and an association relationship adjustment unit (not shown in the figure). The above-mentioned fourth acquisition unit can be configured to: obtain tenant-namespace relationship adjustment information in response to receiving an association relationship adjustment event for tenant-namespace association relationship information. The second information adjustment unit can be configured to: perform information adjustment on at least one second network policy information in the above-mentioned second network policy information set that is associated with the above-mentioned tenant-namespace relationship adjustment information to obtain at least one second network policy adjustment information. The association relationship adjustment unit can be configured to: perform association relationship adjustment on the above-mentioned tenant-namespace association relationship information based on the above-mentioned at least one second network policy adjustment information.

[0106] In some optional implementations of some embodiments, the first determining unit 502 may be further configured to: determine the first namespace information set corresponding to each network connection tenant information in the first network connection tenant information set using a namespace selector.

[0107] In some optional implementations of some embodiments, the tenant network connections between the individual first network connection tenant information in the above-mentioned first network connection tenant information set are pre-isolated based on the target tenant network isolation plug-in.

[0108] It is understood that the units described in the inter-tenant network connection device 500 correspond to the steps in the method described with reference to FIG2 . Therefore, the operations, features, and beneficial effects described above for the method are also applicable to the inter-tenant network connection device 500 and the units included therein, and will not be repeated here.

[0109] 6, which shows a schematic diagram of the structure of an electronic device (e.g., electronic device 101 in FIG1) 600 suitable for implementing some embodiments of the present disclosure. The electronic device shown in FIG6 is merely an example and should not limit the functionality and scope of use of the embodiments of the present disclosure.

[0110] As shown in Figure 6, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory 602 or a program loaded from a storage device 608 into a random access memory 603. Various programs and data required for the operation of the electronic device 600 are also stored in the random access memory 603. The processing device 601, the read-only memory 602, and the random access memory 603 are connected to each other via a bus 604. An input / output interface 605 is also connected to the bus 604.

[0111] Typically, the following devices can be connected to the input / output interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 can allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although FIG. 6 shows an electronic device 600 with various devices, it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or provided alternatively. Each box shown in FIG. 6 may represent one device, or may represent multiple devices as needed.

[0112] In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from a network via the communication device 609, or installed from the storage device 608, or installed from the read-only memory 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of some embodiments of the present disclosure are performed.

[0113] It should be noted that in some embodiments of the present disclosure, the computer-readable medium mentioned above may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present disclosure, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or device. In some embodiments of the present disclosure, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0114] In some embodiments, the client and server can communicate using any currently known or later developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or later developed network.

[0115] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains pre-configured first network connection custom resource information; in response to receiving an inter-tenant network connection event for the first network connection custom resource information, determines a first network connection tenant information set corresponding to the first network connection custom resource information; determines a first namespace information set corresponding to each network connection tenant information in the first network connection tenant information set to obtain a first namespace information set group; for each first namespace information in the first namespace information set group, creates network policy information corresponding to the first namespace information as the first network policy information; and establishes an inter-tenant network connection for the first network connection tenant information set based on the obtained first network policy information set group.

[0116] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0117] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the boxes can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, as well as the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.

[0118] The units described in some embodiments of the present disclosure may be implemented in software or hardware. The units described may also be provided in a processor. For example, they may be described as follows: a processor includes an acquisition unit, a first determination unit, a second determination unit, a creation unit, and an establishment unit. The names of these units do not, in some cases, constitute limitations on the units themselves. For example, the acquisition unit may also be described as a "unit for acquiring pre-configured first network connection custom resource information."

[0119] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0120] Some embodiments of the present disclosure further provide a computer program product, including a computer program, which implements any of the above-mentioned inter-tenant network connection methods when executed by a processor.

[0121] The above descriptions are merely some preferred embodiments of the present disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also encompass other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by mutually replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure.

Claims

1. A method for connecting a network between tenants. include: Obtaining pre-configured first network connection custom resource information; In response to receiving an inter-tenant network connection event for the first network connection custom resource information, determining a first network connection tenant information set corresponding to the first network connection custom resource information; Determine a first namespace information set corresponding to each network connection tenant information in the first network connection tenant information set to obtain a first namespace information set group; For each first namespace information in the first namespace information set group, create network policy information corresponding to the first namespace information as first network policy information; According to the obtained first network policy information set group, an inter-tenant network connection for the first network connection tenant information set is established.

2. The method according to claim 1, in, The method further comprises: Get the pre-configured first tenant custom resource information; In response to receiving a tenant definition event for the first tenant custom resource information, determining a second namespace information set and a tenant information set corresponding to the first tenant custom resource information; Determine the network policy information corresponding to each second namespace information in the second namespace information set as the second network policy information, and obtain a second network policy information set; According to the second network policy information set, an association relationship between the second namespace information set and the tenant information set is established.

3. The method according to claim 1, in, The method further comprises: Obtain pre-configured second network connection custom resource information and second tenant custom resource information; In response to receiving the namespace establishment event, determining to define a tenant information set according to the second tenant custom resource information; Establishing an internal network of a defined tenant corresponding to each defined tenant information in the defined tenant information set; In response to determining that the internal network of each defined tenant has been established, determining a second network connection tenant information set according to the second network connection custom resource information, wherein the second network connection tenant information set is a subset of the defined tenant information set; An inter-tenant network is established for the second network connection tenant information set.

4. The method according to claim 1, in, The method further comprises: In response to receiving a network connection adjustment event for the first network connection tenant information set, acquiring the first network policy information set group and network connection adjustment information; Performing information adjustment on the network policy information in the first network policy information set group that corresponds to the network connection adjustment information to generate first network policy adjustment information, thereby obtaining a first network policy adjustment information set group; According to the first network policy adjustment information set group, inter-tenant network adjustment corresponding to the network connection tenant information subset is performed.

5. The method according to claim 2, in, The method further comprises: In response to receiving an association relationship adjustment event for tenant-namespace association relationship information, acquiring tenant-namespace relationship adjustment information; Adjusting at least one second network policy information in the second network policy information set that is associated with the tenant-namespace relationship adjustment information to obtain at least one second network policy adjustment information; According to the at least one second network policy adjustment information, an association relationship adjustment is performed on the tenant-namespace association relationship information.

6. The method according to claim 1, in, The step of determining a first namespace information set corresponding to each network connection tenant information in the first network connection tenant information set includes: A first namespace information set corresponding to each network connection tenant information in the first network connection tenant information set is determined by using a namespace selector.

7. The method according to claim 1, in, The tenant network connections between the first network connection tenant information in the first network connection tenant information set are pre-isolated based on the target tenant network isolation plug-in.

8. A network connection device between tenants, include: An acquiring unit, configured to acquire pre-configured first network connection custom resource information; a first determining unit, configured to determine a first network connection tenant information set corresponding to the first network connection custom resource information in response to receiving an inter-tenant network connection event for the first network connection custom resource information; A second determining unit is configured to determine a first namespace information set corresponding to each network connection tenant information in the first network connection tenant information set to obtain a first namespace information set group; a creating unit configured to create, for each first namespace information in the first namespace information set group, network policy information corresponding to the first namespace information as first network policy information; An establishing unit is configured to establish an inter-tenant network connection for the first network connection tenant information set according to the obtained first network policy information set group.

9. An electronic device, include: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

10. A computer readable medium having a computer program stored thereon, in, When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

11. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Multi-tenant self-defined networking method and system based on network name spaces

    CN107959614A

  • Multi-tenant management method and device

    CN113918268A

  • Multi-tenant cross-cluster networking method, communication system and readable storage medium

    CN114157668A

  • Network connection method and device between tenants, electronic equipment and computer readable medium

    CN116599846A

  • System and method for generating network security policies in a distributed computation system utilizing containers

    US11394750B1