Cluster service creation method and device

The cluster central control component maintains the mapping relationship between cross-cluster service resources and endpoint addresses, and directly accesses cluster nodes, solving the problem of low cross-cluster service access efficiency in Kubernetes clusters and achieving more efficient service access and load balancing.

CN118535276APending Publication Date: 2024-08-23HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310185054.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-22
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

In the actual use of Kubernetes clusters, cross-cluster service access efficiency is low, and existing technology requires reverse proxying through DNS and edge nodes, resulting in long access processes and low efficiency.

Method used

The central control component of the cluster maintains the mapping relationship between cross-cluster service resources and endpoint addresses, synchronizes them to the cluster nodes, and directly accesses the cluster nodes to avoid setting up edge nodes and reverse proxies and shorten the service discovery path.

Benefits of technology

It improves the efficiency of cross-cluster service access, simplifies the access process, reduces latency, and improves load balancing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535276A
    Figure CN118535276A
Patent Text Reader

Abstract

The invention discloses a cluster service creation method and device, which are applied to a first cluster in a multi-cluster environment and are used for maintaining a mapping relationship between cross-cluster service resources and endpoint addresses in cluster nodes through a central control component. Wherein the multi-cluster environment comprises a plurality of clusters, and the first cluster is any one of the plurality of clusters. In the method, a first center control component of a first cluster creates a first cross-cluster service resource; the first central control component establishes a mapping relationship between the first cross-cluster service resource and a first endpoint address, wherein the first endpoint address is used for representing an endpoint address of a server in the first cluster; in the embodiment of the invention, the first central control component synchronizes the mapping relationship between the first endpoint address and the first cross-cluster service resource into the node in the first cluster, so that the node in the cluster is directly accessed without setting an edge node in the cluster during subsequent cross-cluster service access, and the cross-cluster service access efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of cloud computing technology, and in particular to a cluster service creation method and device. Background Art

[0002] With the development and popularity of container technology represented by application container engines (Docker), the industry has gradually begun to accept and popularize container technology. The problems solved by stand-alone container engines and images are very limited. If you want to use containers directly in a production environment, you still need to rely on container management clusters. Container management clusters are usually dedicated to solving problems such as container orchestration, scheduling, and cluster management. Currently, the industry's main container management cluster is the Kubernetes cluster.

[0003] In the actual use of Kubernetes clusters, it is necessary to consider the manageable scale limit of Kubernetes clusters, the requirements of disaster recovery and backup isolation, and the need for local access to improve speed. Therefore, in actual production, it is necessary to deploy multiple Kubernetes clusters, and the services between clusters can access each other.

[0004] At present, cross-cluster service access often adopts cross-cluster reverse proxy mode; in which the domain name address and edge node address in the cluster are managed by the domain name server (DNS), and the mapping relationship between cluster service resources and endpoint addresses is managed by the reverse proxy component in the edge node in the cluster. Therefore, when using the reverse proxy mode to access cross-cluster services, it is necessary to complete the access through DNS and edge nodes, resulting in a long access process and low efficiency. Summary of the invention

[0005] The embodiments of the present application provide a cluster service creation method and device, which are used to maintain the mapping relationship between cross-cluster service resources and endpoint addresses in cluster nodes through a central control component of the cluster.

[0006] In a first aspect, an embodiment of the present application provides a cluster service creation method, which is applied to a first cluster in a multi-cluster environment. The multi-cluster environment includes multiple clusters, and the first cluster is any one of the multiple clusters. The method includes:

[0007] The first central control component of the first cluster creates a first cross-cluster service resource and establishes a mapping relationship between the first cross-cluster service resource and the first endpoint address; wherein the first endpoint address is used to represent the endpoint address of the service end within the first cluster; then, the first central control component can synchronize the mapping relationship between the first endpoint address and the first cross-cluster service resource to the nodes in the first cluster.

[0008] In this method, after establishing a mapping relationship between the first cross-cluster service resource and the first endpoint address, the first central control component will synchronize the mapping relationship to the nodes in the first cluster, so that when subsequent cross-cluster service access is performed, the nodes in the first cluster can be directly accessed without setting up edge nodes in the first cluster, thereby shortening the access path of service discovery and improving the efficiency of cross-cluster service access.

[0009] In one possible design, the first central control component obtains service information of the first cross-cluster service resource, wherein the service information includes an endpoint address screening rule. Then, the first central control component determines a first scheduling unit that satisfies the endpoint address screening rule from the first cluster; wherein the first scheduling unit is the smallest management element in the first cluster. The first central control component uses the IP address corresponding to the first scheduling unit as the first endpoint address, and establishes a mapping relationship between the first endpoint address and the first cross-cluster service resource.

[0010] In one possible design, the first central control component creates a first endpoint address resource; wherein the first endpoint address resource includes a first endpoint address; and then, the first central control component establishes an association relationship between the first cross-cluster service resource and the first endpoint address resource.

[0011] In a possible design, after establishing a mapping relationship between the first cross-cluster service resource and the first endpoint address, the first central control component may also synchronize the mapping relationship between the first cross-cluster service resource and the first endpoint address to the second cluster.

[0012] Through this design, the first central control component directly synchronizes the established mapping relationship between the first cross-cluster service resource and the first endpoint address to the second cluster, so that the mapping relationship between the first cross-cluster service resource and the first endpoint address is stored in the nodes of the second cluster. Then, when cross-cluster service discovery is performed subsequently, the first endpoint address can be determined on the nodes in the second cluster without setting up edge nodes for cross-cluster reverse proxy, thereby shortening the access path of service discovery and improving the efficiency of cross-cluster service access.

[0013] In one possible design, after creating the first cross-cluster service resource, the first central control component synchronizes the service information of the first cross-cluster service resource to the second cluster, so that the second cluster establishes the second cross-cluster service resource according to the service information; wherein the second cluster is a cluster among the multiple clusters except the first cluster.

[0014] Through this design, the first central control component synchronizes the created first cross-cluster service resources to the second cluster, providing a data basis for subsequent cross-cluster service discovery.

[0015] In a possible design, the first central control component may also receive a mapping relationship between a second cross-cluster service resource and a second endpoint address sent by the second cluster, wherein the second endpoint address is used to represent an endpoint address of a service end in the second cluster. Then, the first central control component may also synchronize the mapping relationship between the second cross-cluster service resource and the second endpoint address to the nodes in the first cluster.

[0016] Through this design, there is a mapping relationship between the second cross-cluster service resource and the second endpoint address in the node in the first cluster, so that the client in the first cluster can determine the second endpoint address in the second cluster on the node in the first cluster and complete the cross-cluster service access process, thereby improving the efficiency of cross-cluster service access.

[0017] In a possible design, after the first central control component synchronizes the mapping relationship between the second cross-cluster service resource and the second endpoint address to the nodes in the first cluster, the number of endpoints can also be determined; wherein the number of endpoints is the number of endpoint addresses in the mapping relationship set, and the mapping relationship set includes the mapping relationship between the second cross-cluster service resource and the second endpoint address and the mapping relationship between the first cross-cluster service resource and the first endpoint address. Then, the first central control component updates the load balancing rules of the nodes in the first cluster according to the number of endpoints.

[0018] Through this design, the first central control component updates the load balancing rules of the nodes in the first cluster according to the number of endpoints, thereby achieving load balancing of the servers in all clusters in a multi-cluster environment and improving load balancing efficiency.

[0019] In one possible design, the domain name of the first cross-cluster service resource is the same as the domain name of the second cross-cluster service resource.

[0020] With this design, when a client accesses a server in this cluster or another cluster in any cluster, it can use the same cluster domain name, without having to switch to different fully qualified domain names for different clusters, thereby improving access efficiency.

[0021] In a possible design, the first cluster and the second cluster are Kubernetes clusters.

[0022] In a second aspect, an embodiment of the present application provides a cluster service creation device, which is applied to a first cluster in a multi-cluster environment, where the multi-cluster environment includes multiple clusters, and the first cluster is any one of the multiple clusters. The device includes:

[0023] A creation module, used to create a first cross-cluster service resource;

[0024] An establishment module is used to establish a mapping relationship between a first cross-cluster service resource and a first endpoint address; the first endpoint address is used to represent an endpoint address of a service end in the first cluster;

[0025] The synchronization module is used to synchronize the mapping relationship between the first endpoint address and the first cross-cluster service resource to the nodes in the first cluster.

[0026] In a possible design, the establishment module is specifically used to:

[0027] Obtaining service information of a first cross-cluster service resource; the service information includes an endpoint address screening rule;

[0028] Determine a first scheduling unit in the first cluster that satisfies the endpoint address screening rule; the first scheduling unit is the smallest management element in the first cluster;

[0029] Using the IP address corresponding to the first scheduling unit as the first endpoint address;

[0030] A mapping relationship between the first endpoint address and the first cross-cluster service resource is established.

[0031] In a possible design, the establishment module is specifically used to:

[0032] Creating a first endpoint address resource, where the first endpoint address resource includes a first endpoint address;

[0033] An association relationship between the first cross-cluster service resource and the first endpoint address resource is established.

[0034] In a possible design, after establishing a mapping relationship between the first cross-cluster service resource and the first endpoint address, the synchronization module is further used to:

[0035] The mapping relationship between the first cross-cluster service resource and the first endpoint address is synchronized to the second cluster.

[0036] In a possible design, after creating the first cross-cluster service resource, the synchronization module is further used to:

[0037] The service information of the first cross-cluster service resource is synchronized to the second cluster, so that the second cluster establishes a second cross-cluster service resource according to the service information; the second cluster is a cluster other than the first cluster among the multiple clusters.

[0038] In one possible design, the synchronization module is also used to:

[0039] Receive a mapping relationship between a second cross-cluster service resource and a second endpoint address sent by the second cluster; the second endpoint address is used to represent an endpoint address of a server in the second cluster;

[0040] The mapping relationship between the second cross-cluster service resource and the second endpoint address is synchronized to the nodes in the first cluster.

[0041] In a possible design, after synchronizing the mapping relationship between the second cross-cluster service resource and the second endpoint address to the node in the first cluster, the synchronization module is further used to:

[0042] Determine the number of endpoints, where the number of endpoints is the number of endpoint addresses in the mapping relationship set; the mapping relationship set includes a mapping relationship between the second cross-cluster service resource and the second endpoint address and a mapping relationship between the first cross-cluster service resource and the first endpoint address;

[0043] The load balancing rules of the nodes in the first cluster are updated according to the number of endpoints.

[0044] In one possible design, the domain name of the first cross-cluster service resource is the same as the domain name of the second cross-cluster service resource.

[0045] In a possible design, the first cluster and the second cluster are Kubernetes clusters.

[0046] In a third aspect, the present application provides a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is executed by a computing device cluster, the method in the above-mentioned first aspect or any possible implementation of the first aspect is implemented.

[0047] In a fourth aspect, the present application provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a computing device cluster, the computing device cluster implements the method in the above-mentioned first aspect or any possible implementation of the first aspect.

[0048] The technical effects that can be achieved in any of the second to fifth aspects mentioned above can refer to the description of the beneficial effects in the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A schematic diagram of an application scenario of a cluster service creation method provided in an embodiment of the present application;

[0050] Figure 2 A schematic diagram of the architecture of a cluster provided in an embodiment of the present application;

[0051] Figure 3 A schematic diagram of a cluster service creation method provided in an embodiment of the present application;

[0052] Figure 4 A schematic diagram of interaction for creating a cluster service instance provided in an embodiment of the present application;

[0053] Figure 5 A schematic diagram of a cross-cluster service access process provided in an embodiment of the present application;

[0054] Figure 6 A complete flow chart of a cluster service creation method provided in an embodiment of the present application;

[0055] Figure 7 A schematic diagram of the structure of a possible cluster service creation device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0056] To facilitate understanding, exemplary descriptions of concepts related to the present application are provided for reference.

[0057] 1) Kubernetes, also known as K8s, is an open source system for automatically deploying, scaling, and managing containerized applications.

[0058] 2) Scheduling unit (Pod) refers to the smallest management element in the K8s cluster.

[0059] 3) K8s Service is an abstract concept that defines a logical collection of Pods and the strategy for accessing them.

[0060] 4) Node refers to the host that actually runs in the Pod, which can be a physical machine or a virtual machine.

[0061] 5) IPTables is a set of rules that allows customization. Each rule in an Internet Protocol (IP) table consists of multiple classifiers (IPTables matches) and a connected action (IPTables target), allowing for the processing and forwarding of IP messages.

[0062] 6) Endpoint IP refers to the access address of all copies corresponding to a service.

[0063] 7) Cross-cluster service resources refer to objects in the K8s cluster that are used to provide cross-cluster services. All content in the K8s cluster is abstracted as resources, and resources are called objects after being instantiated. In the K8s cluster, any object that can be applied for, allocated, and ultimately used is a resource in the K8s cluster.

[0064] With the development and popularity of container technology represented by application container engines (docker), the industry has gradually begun to accept and popularize container technology. The problems solved by stand-alone container engines and images are very limited. If you want to use containers directly in a production environment, you still need to rely on container management clusters. Container management clusters are usually dedicated to solving problems such as container orchestration, scheduling, and cluster management. The current container management clusters in the industry are mainly Kubernetes clusters. However, in the actual use of Kubernetes (K8s) clusters, it is necessary to consider the scale of virtual machines and scheduling units (Pod) that can be managed by the K8s cluster, the requirements for disaster recovery and backup isolation, and the need to improve the speed of local access. For example, the number of virtual machines that can be managed by the K8s cluster can be 5,000, and the number of Pods that can be managed can be 150,000. When the number of virtual machines that actually need to be managed is greater than 5,000, and the number of Pods is greater than 150,000, multiple K8s clusters need to be deployed for management. Therefore, in actual production, multiple K8s clusters need to be deployed for management. Among them, the services between clusters in multiple K8s clusters can access each other.

[0065] At present, cross-cluster service access often uses a cross-cluster reverse proxy method. When a client in a cluster uses a reverse proxy method to access services across clusters, the domain name address and edge node address in the cluster are managed by the domain name server (DNS), and the mapping relationship between cluster service resources and endpoint addresses is managed by the reverse proxy component in the edge node. Therefore, when using a reverse proxy method to access cross-cluster services, access needs to be completed through DNS and edge nodes, resulting in a long access process and low efficiency.

[0066] In view of this, an embodiment of the present application provides a cluster service creation method, i.e., a device, which is applied to a multi-cluster environment. In the method, after a cluster in a multi-cluster environment creates a cross-cluster service resource and establishes a mapping relationship between the cross-cluster service resource and the endpoint address, the established mapping relationship between the cross-cluster service resource and the endpoint address is synchronized to the nodes in the cluster, so that when a client in the cluster accesses a cross-cluster service, it directly passes through the nodes in the cluster without passing through the edge nodes, thereby shortening the process length of the cross-cluster service access and further improving the access efficiency of the cross-cluster service.

[0067] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0068] The embodiments of the present application may be applicable to application scenarios involving multiple clusters. Figure 1 A schematic diagram of an application scenario of a cluster service creation method. Figure 1In the scenario shown, multiple clusters implement distributed multi-cluster networking to form a distributed multi-cluster environment, in which the same central control components are installed on each cluster.

[0069] In some embodiments, at least one node may be deployed in a cluster. The node may be a physical machine or a virtual machine (VM), and the node may be deployed in different regions or use different operator networks. The node may maintain a mapping relationship between cross-cluster service resources and endpoint addresses in the node based on the scheduling of the central control component.

[0070] In some embodiments, after the central control component of the cluster creates a cross-cluster service resource, a mapping relationship between the cross-cluster service resource and the endpoint address is established. Among them, the endpoint address is the endpoint address of the service end in the cluster. Then, the cluster can synchronize the mapping relationship between the cross-cluster service resource and the endpoint address to the nodes in the cluster, and the nodes save the mapping relationship. In this way, the cluster can directly maintain the mapping relationship between the cross-cluster service resources and the endpoint addresses in the nodes, without setting up edge nodes in the cluster and deploying reverse proxy components in the edge nodes, thereby shortening the process of cross-cluster service access and improving the efficiency of cross-cluster service access.

[0071] In some embodiments, the multi-cluster environment may be a distributed K8s cluster environment. Exemplarily, the cluster service creation method provided in the embodiment of the present application may be applied to other branches of cross-cluster management, such as edge cluster service discovery.

[0072] Figure 2 The schematic diagram of the architecture of a cluster provided in the embodiment of the present application is shown in FIG. Figure 1 Any cluster in the multi-cluster environment shown. The cluster includes an application programming interface (API) server, a cross-cluster controller, an intra-cluster controller, and at least one node. Each node includes a network proxy component and a set of mapping relationships. Exemplarily, the cluster in an embodiment of the present application may be a K8s cluster. The API server, cross-cluster controller, intra-cluster controller, and network proxy component in the cluster constitute the central control component of the cluster.

[0073] The API server is used to create cross-cluster service resources and communicate with the cross-cluster controller, intra-cluster controller, and network proxy components within the cluster.

[0074] The cross-cluster controller is used to synchronize the cross-cluster service resources created by clusters in a multi-cluster environment, as well as the mapping relationship between the cross-cluster service resources and the endpoint addresses.

[0075] The controller within the cluster is used to establish a mapping relationship between cross-cluster service resources and endpoint addresses.

[0076] The network proxy component is used to synchronize the mapping relationship between cross-cluster service resources and endpoint addresses to the nodes in the cluster, wherein the mapping relationship between cross-cluster service resources and endpoint addresses can be stored in a mapping relationship set in the node.

[0077] In some embodiments, when the cross-cluster service code written by the user is referenced, the API server creates a cross-cluster service resource. After the cross-cluster controller monitors the creation of a new cross-cluster service resource in the cluster, it obtains the service information of the cross-cluster service resource and synchronizes the service information to other clusters in the multi-cluster environment. After the controller in the cluster monitors the creation of a new cross-cluster service resource, it establishes a mapping relationship between the cross-cluster service resource and the endpoint address. The cross-cluster server synchronizes the mapping relationship between the cross-cluster service resources and the endpoint address established in the cluster to other clusters, and receives the mapping relationship between the cross-cluster service resources and the endpoint address sent by other clusters. The network proxy component obtains the mapping relationship between the cross-cluster service resources and the endpoint address through the API server, and synchronizes the mapping relationship to the nodes in this cluster.

[0078] In order to facilitate understanding of the cluster service creation method provided by this application, the following Figures 3 to 7 The content shown introduces the implementation process of the method provided by this application.

[0079] First, a possible cluster service creation method applicable to an embodiment of the present application is introduced, which is applied to the first cluster in a multi-cluster environment. The multi-cluster environment includes multiple clusters, and the first cluster is any one of the multiple clusters. The first cluster can be Figure 2 The cluster and multi-cluster environment shown are multi-K8s cluster environments. Figure 3 A schematic diagram of a cluster service creation method provided in an embodiment of the present application. The method comprises the following steps:

[0080] S301: A first central control component of a first cluster creates a first cross-cluster service resource.

[0081] In some embodiments, the first cluster may be a K8s cluster. Exemplarily, the first central control component of the first cluster includes, but is not limited to, an API server, a cross-cluster controller, an intra-cluster controller, and a network proxy component. The network proxy component runs on a node in the cluster.

[0082] In some examples, a user may create a cross-cluster service resource in a first cluster in a multi-cluster environment. In response to a creation operation triggered by the user, the first central control component creates a first cross-cluster service resource in the first cluster.

[0083] Exemplarily, an API server in a first cluster creates a first cross-cluster service resource, and obtains service information of the first cross-cluster service resource.

[0084] For example, the key fields of the cross-cluster service resources in the embodiment of the present application are as follows:

[0085]

[0086] Among them, the user can set specific tags in "annotations" to specify that the created service is a cross-cluster service; the "selector" field is used to represent the endpoint address filtering rule. Exemplarily, multiple key-value pairs can be defined in the "selector" field, and each key-value pair represents an endpoint filtering rule. When the first scheduling unit satisfies all endpoint filtering rules, it is determined that the first scheduling unit satisfies the endpoint address filtering rule.

[0087] In some embodiments, the API server may create a first cross-cluster service resource according to the key field of the cross-cluster service resource. Since "spec.selector" is not configured in the key field, the API server will create an empty first cross-cluster service resource in the first cluster and obtain service information of the first cross-cluster service resource.

[0088] In some examples, the service information includes, but is not limited to: a cluster IP and endpoint filtering rules of the first cross-cluster service resource.

[0089] In some embodiments, after creating the first cross-cluster service resource, the first central control component may synchronize service information of the first cross-cluster service resource to a second cluster, wherein the second cluster is a cluster other than the first cluster among the multiple clusters.

[0090] In some examples, the cross-cluster controller in the first cluster obtains service information of the first cross-cluster service resource by monitoring K8s of the cluster, and synchronizes the service information to the second cluster.

[0091] After receiving the service information of the first cross-cluster service resource, the cross-cluster controller of the second cluster creates a second cross-cluster service resource in the second cluster based on the cluster IP through the API server interface of the second cluster. The process of the second cluster creating the second cross-cluster service resource is the same as the process of the first cluster creating the first cross-cluster service resource, which will not be repeated here.

[0092] In some embodiments, the domain name of the first cross-cluster service resource established in the second cluster is the same as the domain name of the first cross-cluster service resource.

[0093] For example, the domain name of the first cross-cluster service resource and the domain name of the first cross-cluster service resource may be configured as: zk.fintech.svc.cluster.local.

[0094] In some embodiments, after creating the first cross-cluster service resource, the first central control component may further associate the first cross-cluster service resource with the endpoint address.

[0095] S302: The first central control component establishes a mapping relationship between a first cross-cluster service resource and a first endpoint address.

[0096] In some embodiments, the first endpoint address is used to represent an endpoint address of a server in the first cluster.

[0097] In some examples, the first central control component may establish a mapping relationship between the first cross-cluster service resource and the first endpoint address in the following manner:

[0098] A1: The first central control component obtains service information of the first cross-cluster service resource.

[0099] In some embodiments, the intra-cluster controller in the first cluster obtains service information of the first cross-cluster service resource by monitoring K8s in the cluster.

[0100] A2: The first central control component determines a first scheduling unit in the first cluster that meets the endpoint address screening rule, wherein the first scheduling unit is the smallest management element in the first cluster.

[0101] In some embodiments, the intra-cluster controller in the first cluster determines a first scheduling unit from within the first cluster that satisfies the endpoint address screening rule.

[0102] A3: The first central control component uses the IP address corresponding to the first scheduling unit as the first endpoint address.

[0103] In some embodiments, the intra-cluster controller in the first cluster uses the IP address corresponding to the first scheduling unit as the first endpoint address.

[0104] A4: The first central control component establishes a mapping relationship between the first endpoint address and the first cross-cluster service resource.

[0105] In some embodiments, the first central control component may establish a mapping relationship between the first endpoint address and the cluster IP address of the first cross-cluster service resource.

[0106] In some examples, the first central control component may also create a first endpoint address resource, the first endpoint address resource including the first endpoint address. Then, the first central control component may establish an association relationship between the first cross-cluster service resource and the first endpoint address resource. The first cross-cluster service resource includes the service IP of the first cross-cluster service resource.

[0107] In some embodiments, the intra-cluster controller in the first cluster may create a first endpoint address resource through an API server interface, and establish an association relationship between the first cross-cluster service resource and the first endpoint address resource.

[0108] S303: The first central control component synchronizes the mapping relationship between the first endpoint address and the first cross-cluster service resource to the nodes in the first cluster.

[0109] In some embodiments, the network proxy component in the node in the first cluster monitors the change of information in the first cross-cluster service resource through the API server interface. When the network proxy component determines that the first cross-cluster service resource has changed, it obtains the mapping relationship between the first cross-cluster service resource and the first endpoint address through the API server interface, and stores the mapping relationship on the node corresponding to the device.

[0110] In some embodiments, after establishing a mapping relationship between the first endpoint address and the first cross-cluster service resource, the first central control component may synchronize the mapping relationship to a mapping relationship set in a node in the first cluster, and may also synchronize the mapping relationship to the second cluster.

[0111] In some embodiments, after synchronizing the mapping relationship of the first cluster to the mapping relationship set, the first central control component creates a load balancing rule according to the mapping relationship in the mapping relationship set.

[0112] In some embodiments, after obtaining the mapping relationship between the first cross-cluster service resource and the first endpoint address, the network proxy component may create a load balancing rule in IPTables based on the mapping relationship.

[0113] In some examples, the network proxy component determines the number of endpoints, and creates a load balancing rule for the nodes in the first cluster according to the determined number of endpoints, wherein the number of endpoints is the number of endpoint addresses in the mapping relationship set.

[0114] In some embodiments, the load balancing rule may be a forwarding probability of forwarding a cross-cluster service to an endpoint address.

[0115] The network proxy component can determine the probability of forwarding the cross-cluster service to the endpoint address according to the number of endpoints. For example, when the number of endpoints is 2, the network proxy component determines that the probability of forwarding the cross-cluster service to each endpoint address is 50%; or when the number of endpoints is 4, the network proxy component determines that the probability of forwarding the cross-cluster service to each endpoint address is 25%.

[0116] For example, the mapping relationship contained in the mapping relationship set in the nodes in the first cluster is: zk.fintech.svc.cluster.local: [192.168.0.1, 192.168.0.2]; the network proxy component can create the following load balancing rules according to the number of endpoints in the mapping relationship set:

[0117] zk.fintech.svc.cluster.local service is forwarded to 192.168.0.1 with a probability of 50%

[0118] The zk.fintech.svc.cluster.local service is forwarded to 192.168.0.2 with a probability of 50%.

[0119] In some embodiments, the first central control component may also receive a mapping relationship between a second cross-cluster service resource and a second endpoint address sent by the second cluster, wherein the second endpoint address is used to represent an endpoint address of a service end in the second cluster.

[0120] In some examples, the cross-cluster controller in the first cluster may receive a mapping relationship between the second cross-cluster service resource and the second endpoint address sent by the second cluster, and may also obtain a mapping relationship between the second cross-cluster service resource and the second endpoint address from the second cluster.

[0121] In some embodiments, after the cross-cluster controller of the second cluster creates the second cross-cluster service resource through the API server interface, the cross-cluster controller of the second cluster can also select a second scheduling unit that meets the endpoint address screening rule in the second cluster through the API server interface of the second cluster. Then, the cross-cluster controller of the second cluster uses the IP address corresponding to the second scheduling unit as the second endpoint address, and sends the mapping relationship between the second endpoint address and the second cross-cluster service resource to the first cluster.

[0122] In some embodiments, the specific implementation process of the second cluster establishing a mapping relationship between the second cross-cluster service resource and the second endpoint address is the same as the implementation process of the first central control component of the first cluster establishing a mapping relationship between the first cross-cluster service resource and the first endpoint address. For the specific process, please refer to the implementation process of A1-A4, which will not be repeated here.

[0123] The first cluster and the second cluster may transmit endpoint address information through an inter-cluster controller; wherein the endpoint address information includes a service name field and an endpoint address field.

[0124] In some embodiments, the service name field is used to represent the cross-cluster service resource corresponding to the second endpoint address; and the endpoint address field is used to indicate the second endpoint address list.

[0125] In some embodiments, after receiving the mapping relationship between the second cross-cluster service resource and the second endpoint address, the first central control component may also synchronize the mapping relationship between the second cross-cluster service resource and the second endpoint address to the nodes of the first cluster.

[0126] In some examples, after receiving the mapping relationship between the second cross-cluster service resource and the second endpoint address, the cross-cluster controller of the first cluster may also establish the mapping relationship between the second cross-cluster service resource and the second endpoint address in the first cluster through the API server interface.

[0127] After determining the information change of the cross-cluster service resource in the first cluster through the API server interface, the network proxy component of the first cluster obtains the mapping relationship between the second cross-cluster service resource and the second endpoint address, and synchronizes the mapping relationship to the nodes in the first cluster.

[0128] In some embodiments, the network proxy component of the first cluster may synchronize the mapping relationship between the second cross-cluster service resource and the second endpoint address to a mapping relationship set in the nodes in the first cluster. Then, the network proxy component of the first cluster may update the load balancing rules of the nodes in the first cluster according to the number of endpoints in the mapping relationship set.

[0129] For example, the mapping relationship between the second cross-cluster service resource of the second cluster and the second endpoint address obtained by the network proxy component of the first cluster from the API server is: zk.fintech:[192.168.10.10], and the received mapping relationship is updated to the mapping relationship set. The network proxy component of the first cluster updates the load balancing rules of the nodes in the first cluster according to the number of endpoints in the updated mapping relationship set. The updated load balancing rules are as follows:

[0130] zk.fintech.svc.cluster.local service is forwarded to 192.168.0.1 with a probability of 33%

[0131] zk.fintech.svc.cluster.local service is forwarded to 192.168.0.2 with a probability of 33%

[0132] The zk.fintech.svc.cluster.local service is forwarded to 192.168.10.10 with a probability of 33%.

[0133] For another example, the network proxy component of the first cluster obtains the mapping relationship between the second cross-cluster service resource of the second cluster and the second endpoint address from the API server. The mapping relationship is: zk.fintech:[192.168.20.20]; where the domain name of the first cross-cluster service resource is: zk.fintech.svc.cluster.local. The load balancing rules updated by the network proxy component in the local IPTables are as follows:

[0134] zk.fintech.svc.cluster.local service is forwarded to 192.168.0.1 with a probability of 25%

[0135] zk.fintech.svc.cluster.local service is forwarded to 192.168.0.2 with a probability of 25%

[0136] zk.fintech.svc.cluster.local service is forwarded to 192.168.10.10 with a probability of 25%

[0137] The zk.fintech.svc.cluster.local service is forwarded to 192.168.20.20 with a probability of 25%.

[0138] Figure 4 A cluster service creation instance is provided for an embodiment of the present application. In the cluster service creation process, after the API server of the first cluster creates the first cross-cluster service resource, the cross-cluster controller of the first cluster synchronizes the service information of the first cross-cluster service resource to the cross-cluster controllers in the second cluster A and the second cluster B. Then, after the second cluster A and the second cluster B receive the service information through the cross-cluster controller, they respectively create the second cross-cluster service resource A and the second cross-cluster service resource B through the API server in the cluster.

[0139] In some embodiments, the domain name of the first cross-cluster service resource is the same as the domain name of the second cross-cluster service resource A and the second cross-cluster service resource B, and the cluster IP is the same.

[0140] like Figure 4As shown, after the first cluster creates the first cross-cluster service resource, the cluster controller of the first cluster establishes a mapping relationship between the first cross-cluster service resource and the first endpoint address according to the service information. Then, the network proxy component on the virtual machine in the first cluster can obtain the mapping relationship between the first cross-cluster service resource and the first endpoint address through the API server interface, and synchronize the mapping relationship to the virtual machine. Among them, the mapping relationship set in the virtual machine is used to store the mapping relationship between the cross-cluster service resource and the endpoint address.

[0141] After establishing the mapping relationship between the first cross-cluster service resource and the first endpoint address, the first cluster may synchronize the mapping relationship to the virtual machines in the second cluster A and the second cluster B through the cross-cluster controller to achieve synchronization of the mapping relationship.

[0142] Figure 5 A schematic diagram of a cross-cluster service access process provided for an embodiment of the present application. When a client in cluster 2 accesses a cross-cluster service, it sends the domain name of the cross-cluster service to the DNS and receives the cluster IP corresponding to the cross-cluster service returned by the DNS. The client of cluster 2 can determine the endpoint address corresponding to the cluster IP based on the set of mapping relationships maintained by the virtual machine.

[0143] like Figure 5 As shown, the endpoint addresses corresponding to the cluster IP are: endpoint address 1, endpoint address 2, endpoint address 3, endpoint address 4, and endpoint address 5. The solid line connecting the mapping relationship set and the endpoint address indicates that the server corresponding to the endpoint address is located in cluster 2, and the dotted line indicates that the server corresponding to the endpoint address is located outside cluster 2. The client of cluster 2 accesses the server service according to the determined endpoint address.

[0144] like Figure 5 As shown, the client's access request is directly forwarded to the endpoint address of the server. The forwarding rule follows the access probability of the endpoint address. For example, when the number of endpoint addresses forwarded by the client is 5, the access probability of the server corresponding to each endpoint address is 20%.

[0145] like Figure 6 As shown, an embodiment of the present application provides a complete flow diagram of a cluster service creation method, which is applied to a first cluster in a multi-cluster environment, and includes the following steps:

[0146] S601: A first central control component of a first cluster creates a first cross-cluster service resource.

[0147] In some embodiments, the multi-cluster environment may be a multi-K8s cluster environment, and the first cluster may be a K8s cluster.

[0148] S602: The first central control component obtains service information of a first cross-cluster service resource.

[0149] In some embodiments, the service information includes endpoint address filtering rules.

[0150] S603: The first central control component synchronizes the service information of the first cross-cluster service resource to the second cluster, so that the second cluster establishes a second cross-cluster service resource according to the service information.

[0151] In some embodiments, the second cluster is a cluster other than the first cluster in the plurality of clusters. The domain name of the first cross-cluster service resource is the same as the domain name of the second cross-cluster service resource.

[0152] S604: The first central control component determines a first scheduling unit in the first cluster that meets the endpoint address screening rule.

[0153] In some embodiments, the first scheduling unit is the smallest management element in the first cluster.

[0154] In some embodiments, there is no particular order in which step S603 and step S604 are executed.

[0155] S605: The first central control component uses the IP address corresponding to the first scheduling unit as the first endpoint address.

[0156] S606: The first central control component establishes a mapping relationship between the first cross-cluster service resource and the first endpoint address.

[0157] In some embodiments, the first endpoint address is used to represent an endpoint address of a server in the first cluster.

[0158] In some examples, the first central control component may establish a mapping relationship between the first endpoint address and the first cross-cluster service resource in the following manner:

[0159] The first central control component creates a first endpoint address resource; wherein the first endpoint address resource includes a first endpoint address;

[0160] The first central control component establishes an association relationship between the first cross-cluster service resource and the first endpoint address resource.

[0161] S607: The first central control component synchronizes the mapping relationship between the first endpoint address and the first cross-cluster service resource to the nodes in the first cluster.

[0162] S608: The first central control component receives a mapping relationship between a second cross-cluster service resource and a second endpoint address sent by the second cluster.

[0163] In some embodiments, the second endpoint address is used to represent an endpoint address of a server in the second cluster.

[0164] S609: The first central control component synchronizes the mapping relationship between the second cross-cluster service resource and the second endpoint address to the nodes in the first cluster.

[0165] S610: The first central control component determines the number of endpoints.

[0166] In some embodiments, the number of endpoints is the number of endpoint addresses in the mapping relationship set; the mapping relationship set includes a mapping relationship between the second cross-cluster service resource and the second endpoint address and a mapping relationship between the first cross-cluster service resource and the first endpoint address.

[0167] S611: The first central control component updates the load balancing rules of the nodes in the first cluster according to the number of endpoints.

[0168] S612: The first central control component synchronizes the mapping relationship between the first cross-cluster service resource and the first endpoint address to the second cluster.

[0169] based on Figure 6 As shown in the content, the embodiment of the present application can maintain the mapping relationship between cross-cluster service resources and endpoint addresses within the cluster on each node, as well as the mapping relationship between cross-cluster service resources and endpoint addresses in other clusters in a multi-cluster environment through the central control component, thereby realizing mesh direct access to cross-cluster services, eliminating the reverse proxy of the edge node, and thereby improving the reliability of the network.

[0170] Based on the above embodiments and the same concept, the embodiment of the present application also provides a cluster service creation device, which can be applied to the first cluster in a multi-cluster environment, where the multi-cluster environment includes multiple clusters, and the first cluster is any one of the multiple clusters. Figure 7 As shown in , the cluster service creation device 700 may include:

[0171] A creation module 701 is used to create a first cross-cluster service resource;

[0172] Establishing module 702, used to establish a mapping relationship between a first cross-cluster service resource and a first endpoint address; the first endpoint address is used to represent an endpoint address of a service end in the first cluster;

[0173] The synchronization module 703 is used to synchronize the mapping relationship between the first endpoint address and the first cross-cluster service resource to the nodes in the first cluster.

[0174] In a possible implementation, the establishing module 702 is specifically used to:

[0175] Obtaining service information of a first cross-cluster service resource; the service information includes an endpoint address screening rule;

[0176] Determine a first scheduling unit in the first cluster that satisfies the endpoint address screening rule; the first scheduling unit is the smallest management element in the first cluster;

[0177] Using the IP address corresponding to the first scheduling unit as the first endpoint address;

[0178] A mapping relationship between the first endpoint address and the first cross-cluster service resource is established.

[0179] In a possible implementation, the establishing module 702 is specifically used to:

[0180] Creating a first endpoint address resource, where the first endpoint address resource includes a first endpoint address;

[0181] An association relationship between the first cross-cluster service resource and the first endpoint address resource is established.

[0182] In a possible implementation manner, after establishing a mapping relationship between the first cross-cluster service resource and the first endpoint address, the synchronization module 703 is further configured to:

[0183] The mapping relationship between the first cross-cluster service resource and the first endpoint address is synchronized to the second cluster.

[0184] In a possible implementation, after creating the first cross-cluster service resource, the synchronization module 703 is further configured to:

[0185] The service information of the first cross-cluster service resource is synchronized to the second cluster, so that the second cluster establishes a second cross-cluster service resource according to the service information; the second cluster is a cluster other than the first cluster among the multiple clusters.

[0186] In a possible implementation, the synchronization module 703 is further configured to:

[0187] Receive a mapping relationship between a second cross-cluster service resource and a second endpoint address sent by the second cluster; the second endpoint address is used to represent an endpoint address of a server in the second cluster;

[0188] The mapping relationship between the second cross-cluster service resource and the second endpoint address is synchronized to the nodes in the first cluster.

[0189] In a possible implementation, after synchronizing the mapping relationship between the second cross-cluster service resource and the second endpoint address to the nodes in the first cluster, the synchronization module 703 is further used to:

[0190] Determine the number of endpoints, where the number of endpoints is the number of endpoint addresses in the mapping relationship set; the mapping relationship set includes a mapping relationship between the second cross-cluster service resource and the second endpoint address and a mapping relationship between the first cross-cluster service resource and the first endpoint address;

[0191] The load balancing rules of the nodes in the first cluster are updated according to the number of endpoints.

[0192] In a possible implementation manner, the domain name of the first cross-cluster service resource is the same as the domain name of the second cross-cluster service resource.

[0193] In a possible implementation, the first cluster and the second cluster are Kubernetes clusters.

[0194] In some embodiments, the cluster service creation device can be applied to virtual machines deployed in a K8s cluster, and can also be applied to bare metal servers deployed in a K8s cluster.

[0195] Among them, the creation module, the establishment module and the synchronization module can all be implemented by software, or can be implemented by hardware. Exemplarily, the implementation method of the creation module is introduced below by taking the creation module as an example. Similarly, the implementation method of the establishment module and the synchronization module can refer to the implementation method of the creation module.

[0196] As an example of a software functional unit, the creation module may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the above-mentioned computing instance may be one or more. For example, the creation module may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple data centers with close geographical locations. Among them, usually a region may include multiple AZs.

[0197] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.

[0198] As an example of a hardware functional unit, the creation module may include at least one computing device, such as a server, etc. Alternatively, the creation module may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0199] The multiple computing devices included in the creation module can be distributed in the same region or in different regions. The multiple computing devices included in the creation module can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the creation module can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0200] It should be noted that, in other embodiments, the creation module can be used to execute any step in the cluster service creation method, the establishment module can be used to execute any step in the cluster service creation method, the synchronization module can be used to execute any step in the cluster service creation method, and the steps that the creation module, the establishment module, and the synchronization module are responsible for implementing can be specified as needed. The full functions of the cluster service creation device are realized by respectively implementing different steps in the cluster service creation method through the creation module, the establishment module, and the synchronization module.

[0201] Based on the above content and the same concept, the present application provides a device, including a processor, the processor is connected to a memory, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the data storage device executes the above Figure 3 The method in the related embodiments.

[0202] Based on the above content and the same concept, the present application provides a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is executed by a data storage device, the above Figure 3 The method in the related embodiments.

[0203] Based on the above content and the same concept, the present application provides a computer program product, which includes a computer program or an instruction. When the computer program or the instruction is executed by a data storage device, the data storage device implements the above Figure 3 The method in the related embodiments.

[0204] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0205] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0206] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0207] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0208] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A cluster service creation method, applied to a first cluster in a multi-cluster environment, wherein the multi-cluster environment includes multiple clusters, and the first cluster is any one of the multiple clusters, characterized in that: The method comprises: The first central control component of the first cluster creates a first cross-cluster service resource; The first central control component establishes a mapping relationship between the first cross-cluster service resource and a first endpoint address; the first endpoint address is used to represent an endpoint address of a service end within the first cluster; The first central control component synchronizes the mapping relationship between the first endpoint address and the first cross-cluster service resource to the nodes in the first cluster.

2. The method according to claim 1, characterized in that The first central control component establishes a mapping relationship between the first cross-cluster service resource and the first endpoint address, including: The first central control component obtains service information of the first cross-cluster service resource; the service information includes the endpoint address screening rule; The first central control component determines a first scheduling unit in the first cluster that satisfies the endpoint address screening rule; the first scheduling unit is the smallest management element in the first cluster; The first central control component uses the IP address corresponding to the first scheduling unit as the first endpoint address; The first central control component establishes a mapping relationship between the first endpoint address and the first cross-cluster service resource.

3. The method according to claim 2, characterized in that The first central control component establishes a mapping relationship between the first endpoint address and the first cross-cluster service resource, including: The first central control component creates a first endpoint address resource, where the first endpoint address resource includes the first endpoint address; The first central control component establishes an association relationship between the first cross-cluster service resource and the first endpoint address resource.

4. The method according to any one of claims 1 to 3, characterized in that: After the first central control component establishes a mapping relationship between the first cross-cluster service resource and the first endpoint address, the method further includes: The first central control component synchronizes the mapping relationship between the first cross-cluster service resource and the first endpoint address to the second cluster.

5. The method according to any one of claims 1 to 4, characterized in that: After the first central control component of the first cluster creates the first cross-cluster service resource, the method further includes: The first central control component synchronizes the service information of the first cross-cluster service resource to a second cluster, so that the second cluster establishes a second cross-cluster service resource according to the service information; the second cluster is a cluster among the multiple clusters except the first cluster.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: The first central control component receives a mapping relationship between a second cross-cluster service resource and a second endpoint address sent by the second cluster; the second endpoint address is used to represent an endpoint address of a server in the second cluster; The first central control component synchronizes the mapping relationship between the second cross-cluster service resource and the second endpoint address to the nodes in the first cluster.

7. The method according to claim 6, characterized in that After the first central control component synchronizes the mapping relationship between the second cross-cluster service resource and the second endpoint address to the nodes in the first cluster, the method further includes: The first central control component determines the number of endpoints, where the number of endpoints is the number of endpoint addresses in a mapping relationship set; the mapping relationship set includes a mapping relationship between the second cross-cluster service resource and the second endpoint address and a mapping relationship between the first cross-cluster service resource and the first endpoint address; The first central control component updates the load balancing rules of the nodes in the first cluster according to the number of endpoints.

8. The method according to any one of claims 5 to 7, characterized in that: The domain name of the first cross-cluster service resource is the same as the domain name of the second cross-cluster service resource.

9. The method according to any one of claims 5 to 8, characterized in that: The first cluster and the second cluster are Kubernetes clusters.

10. A cluster service creation device, applied to a first cluster in a multi-cluster environment, wherein the multi-cluster environment includes a plurality of clusters, and the first cluster is any one of the plurality of clusters, characterized in that: The device comprises: A creation module, used to create a first cross-cluster service resource; An establishment module is used to establish a mapping relationship between the first cross-cluster service resource and a first endpoint address; the first endpoint address is used to represent the endpoint address of the service end in the first cluster; A synchronization module is used to synchronize the mapping relationship between the first endpoint address and the first cross-cluster service resource to the nodes in the first cluster.

11. The device according to claim 10, characterized in that The establishment module is specifically used for: Acquire service information of the first cross-cluster service resource; the service information includes the endpoint address screening rule; Determine a first scheduling unit in the first cluster that satisfies the endpoint address screening rule; The first scheduling unit is the smallest management element in the first cluster; Using the IP address corresponding to the first scheduling unit as the first endpoint address; A mapping relationship between the first endpoint address and the first cross-cluster service resource is established.

12. The device according to claim 11, characterized in that The establishment module is specifically used for: Creating a first endpoint address resource, wherein the first endpoint address resource includes the first endpoint address; An association relationship between the first cross-cluster service resource and the first endpoint address resource is established.

13. The device according to any one of claims 10 to 12, characterized in that: After establishing a mapping relationship between the first cross-cluster service resource and the first endpoint address, the synchronization module is further used to: The mapping relationship between the first cross-cluster service resource and the first endpoint address is synchronized to the second cluster.

14. The device according to any one of claims 10 to 13, characterized in that: After creating the first cross-cluster service resource, the synchronization module is further used to: The service information of the first cross-cluster service resource is synchronized to a second cluster, so that the second cluster establishes a second cross-cluster service resource according to the service information; the second cluster is a cluster among the multiple clusters except the first cluster.

15. The device according to any one of claims 10 to 14, characterized in that: The synchronization module is also used for: Receive a mapping relationship between a second cross-cluster service resource and a second endpoint address sent by a second cluster; the second endpoint address is used to represent an endpoint address of a server in the second cluster; The mapping relationship between the second cross-cluster service resource and the second endpoint address is synchronized to the nodes in the first cluster.

16. The device according to claim 15, characterized in that After synchronizing the mapping relationship between the second cross-cluster service resource and the second endpoint address to the nodes in the first cluster, the synchronization module is further used to: Determine the number of endpoints, where the number of endpoints is the number of endpoint addresses in a mapping relationship set; the mapping relationship set includes a mapping relationship between the second cross-cluster service resource and the second endpoint address and a mapping relationship between the first cross-cluster service resource and the first endpoint address; According to the number of endpoints, load balancing rules of nodes in the first cluster are updated.

17. The device according to any one of claims 14 to 16, characterized in that: The domain name of the first cross-cluster service resource is the same as the domain name of the second cross-cluster service resource.

18. The device according to any one of claims 14 to 17, characterized in that The first cluster and the second cluster are Kubernetes clusters.

19. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster is caused to perform the method according to any one of claims 1 to 9.

20. A computer-readable storage medium, characterized in that: The method comprises computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster performs the method according to any one of claims 1 to 9.