Cross-node topology awareness and load balancing scheduling method for distributed computing power cluster

By deploying topology-aware monitoring components in member clusters and a unified entry point for the control plane cluster, closed-loop linkage between cross-cluster topology awareness and load balancing is achieved, solving resource management and traffic scheduling problems in multi-cluster environments and improving the system's flexibility and automation level.

CN123185084APending Publication Date: 2026-11-27SI-TECH INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611325394.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-28
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing technologies cannot achieve cross-cluster topology awareness, unified service access entry, and fine-grained load balancing in multi-cluster environments, resulting in low resource management efficiency and inflexible traffic scheduling.

Method used

By deploying a topology-aware listening component in the member cluster, the Kubernetes Watch mechanism is used to monitor Deployment resource change events in real time, extract topology information and report it to the control plane cluster and store it in a custom resource CRD. Combined with the control plane cluster maintaining the Ingress Controller address, the top-level Ingress Controller is deployed as a unified entry point to achieve closed-loop linkage between cross-cluster topology awareness and load balancing.

Benefits of technology

It achieves real-time cross-cluster topology information and flexible traffic scheduling, improves resource management efficiency and traffic scheduling automation in multi-cluster environments, supports dynamic weight distribution and fine-grained routing, and solves the problems of information silos and scattered service addresses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123185084A_ABST
    Figure CN123185084A_ABST
Patent Text Reader

Abstract

The application discloses a cross-node topology awareness and load balancing scheduling method for a distributed computing power cluster, relates to the technical field of cloud native multi-cluster management, and comprises the following steps: deploying a listening component in each member cluster, listening to a Deployment resource change event through a Watch mechanism, extracting information after new creation verification, and reporting the information to a control plane cluster to realize cross-cluster topology awareness by storing and distributing the information to other member clusters in a self-defined CRD; the control plane cluster distributes applications and services to each member cluster, each cluster exposes services through Ingress, the control plane maintains Endpoints resources, and a top-level Ingress Controller is deployed as a unified entrance, and cross-cluster load balancing is realized according to a traffic proportion or a message header strategy. The application realizes linkage of topology awareness and load balancing, and solves the problems of resource topology information island and lack of unified access entrance in a multi-cluster environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cloud-native multi-cluster management technology, and in particular to a cross-node topology awareness and load balancing scheduling method for distributed computing power clusters. Background Technology

[0002] With the rapid development of cloud computing and containerization technologies, Kubernetes has become the mainstream container orchestration platform in the industry. As business scale continues to expand and computing power demands diversify, a single Kubernetes cluster can no longer meet the high availability, elastic scaling, and resource isolation requirements of large-scale applications. Multi-cluster management architecture has become an inevitable development trend in the cloud-native field.

[0003] Karmada (Kubernetes Armada) is an open-source cloud-native multi-cluster management platform from Huawei. Based on the native Kubernetes API, it provides cross-cluster application distribution, resource scheduling, and fault migration capabilities. Karmada's core architecture adopts a star topology structure consisting of a control plane and member clusters. The control plane cluster defines application resource templates through ResourceTemplate, declares resource distribution policies through PropagationPolicy, and implements differentiated configurations at the cluster level through OverridePolicy. Scheduling decisions are generated as Work objects in CRD form and distributed to each member cluster for execution, thereby achieving multi-cluster deployment and unified management of applications.

[0004] The existing technical solutions that are closest to this solution include the following: Existing technical solution 1: Multi-cluster application distribution solution based on Karmada This solution leverages Karmada's control plane architecture to achieve unified distribution of application resource templates (such as Deployments and Services) across multiple member clusters. The specific process is as follows: Deployment resources are defined in the control plane cluster, and the target cluster is specified via PropagationPolicy. Karmada's ResourceBinding controller binds the resources to the target cluster, generates Work objects, and distributes them to each member cluster for execution. While this solution enables multi-cluster deployment of applications, it has the following limitations: resources created or modified within a member cluster cannot be reverse-synchronized to the control plane cluster or other member clusters, and the application topology information of each cluster remains isolated.

[0005] Existing technical solution 2: Single cluster service exposure solution based on Ingress Controller In a single Kubernetes cluster environment, external access to services within the cluster is typically achieved through Ingress resources in conjunction with an Ingress Controller (such as Nginx Ingress or Traefik). The Ingress Controller uses an externally accessible IP address as a unified entry point, and routes external requests to the corresponding service within the cluster based on the domain name and path configuration in the Ingress rules, which in turn distributes them to the backend Pods. This solution is mature and stable in a single-cluster environment, but in a multi-cluster environment, each cluster's Ingress Controller runs independently and holds its own independent external access address, failing to provide a unified cross-cluster service access entry point.

[0006] Existing technical solution 3: Service discovery and load balancing solution based on federated clusters In multi-cluster scenarios, some solutions employ federated DNS or global load balancers to achieve cross-cluster service discovery and traffic distribution. By registering the service addresses of each cluster with a global DNS server, clients distribute requests to different clusters through DNS round-robin or geolocation-aware strategies. However, this approach has significant shortcomings in terms of DNS caching latency and fine-grained routing strategies (such as flexible scheduling based on message headers and traffic ratios), failing to meet the requirements of high real-time performance and fine-grained scheduling scenarios.

[0007] In summary, existing technologies have varying degrees of shortcomings in multi-cluster application distribution, service exposure, and load balancing. In particular, they cannot simultaneously address cross-cluster topology awareness, a unified service access point, fine-grained load balancing, and the interplay between topology awareness and load balancing. Therefore, a cross-node topology awareness and load balancing scheduling method for distributed computing clusters is needed to solve these problems. Summary of the Invention

[0008] To address the problems in the background technology, this invention provides a cross-node topology awareness and load balancing scheduling method for distributed computing power clusters. By deploying a listening component in the member cluster and utilizing the Kubernetes Watch mechanism to detect newly created Deployment resources in real time, the topology information is reported to the control plane cluster and distributed to other member clusters after being stored in a custom resource CRD. At the same time, the control plane cluster maintains the Ingress Controller addresses of each member cluster to the Endpoints resource and deploys the top-level Ingress Controller as a unified entry point, realizing a complete closed-loop linkage of cross-cluster topology awareness and load balancing scheduling, thereby improving the resource management efficiency and traffic scheduling flexibility in a multi-cluster environment.

[0009] To achieve the above objectives, this invention provides a cross-node topology-aware and load-balanced scheduling method for distributed computing clusters, applicable to a Karmada multi-cluster management environment comprising a control plane cluster and at least two member clusters, including: Topology sensing stage: Deploy topology-aware monitoring components in each member cluster. These monitoring components establish long connections with the API Server of the member clusters through the Kubernetes Watch mechanism to monitor changes to Deployment resources in the member clusters in real time. When the listening component detects the creation event of a new Deployment resource, it performs a new creation verification on the Deployment resource to determine whether the Deployment resource is a newly created resource. For a newly created Deployment resource that passes verification, the listening component extracts the topology configuration information of the Deployment resource and reports the topology configuration information to the control plane cluster through a secure channel; The control plane cluster stores the topology configuration information reported by each member cluster in the form of a custom resource CRD, and distributes the topology configuration information to other member clusters to achieve cross-cluster topology awareness. Load balancing scheduling phase: The control plane cluster determines the set of application resources that need to be load balanced across clusters based on the topology information synchronized during the topology awareness phase and / or according to a predefined distribution strategy, and distributes the Service resources corresponding to each application resource to each member cluster or confirms that the corresponding Service resources already exist in each member cluster. Each member cluster exposes its own Service as an externally accessible service through its respective Ingress Controller, thereby obtaining the external access address of each member cluster. The control plane cluster maintains the Endpoints resource, and records the external access addresses of the Ingress Controller of each member cluster as address entries in the Endpoints resource; The control plane cluster creates a unified service associated with the Endpoints resource, and creates an Ingress resource to route external requests to the unified service; The control plane cluster deploys a top-level Ingress Controller as a unified external access point, which receives external requests and distributes them to each member cluster according to the load balancing strategy configured in the Ingress resource. Specifically, the Deployment resources discovered during the topology awareness phase are automatically incorporated into the service discovery system during the load balancing scheduling phase, thereby achieving closed-loop linkage between topology awareness and load balancing.

[0010] As a further improvement of the present invention, the listening component runs in each member cluster in the form of Deployment or DaemonSet, and has the permission to communicate with the Kubernetes API Server and the RBAC configuration to listen to Deployment resources. The listening component initiates listening requests for Deployment resources to the member cluster API Server through the Kubernetes Watch mechanism. The scope of resources to be listened to is precisely limited by a tag selector, and only Deployment resources with specific tags are listened to. The types of events to be listened to include: ADDED (addition), MODIFIED (modification), and DELETED (deletion).

[0011] As a further improvement of the present invention, the newly created verification specifically includes: the listening component maintains a cached list of UIDs of processed Deployment resources in memory, compares the UID of the Deployment resource in the current ADDED event with the cached list, and if the UID is not in the cached list, it is determined that the Deployment resource is a newly created resource and enters the synchronization process; if the UID already exists in the cached list, the event is ignored.

[0012] As a further improvement of the present invention, the UID cache list adopts an LRU caching mechanism to support expiration and eviction.

[0013] As a further improvement of the present invention, the topology configuration information includes at least one of the following: Deployment resource name, namespace, associated tag, number of replicas, container image name and version, port configuration, resource requests and restrictions, and affinity rules; the topology configuration information is serialized and encapsulated according to a predefined topology data structure and then reported to the topology management center of the control plane cluster.

[0014] As a further improvement of the present invention, each address entry in the Endpoints resource records the identification information of the corresponding member cluster for subsequent fine-grained routing.

[0015] As a further improvement of the present invention, the load balancing strategy includes a load balancing strategy based on traffic ratio, specifically including configuring the traffic weight ratio of each member cluster in the annotation of the Ingress resource, and the top-level Ingress Controller distributing requests to each member cluster according to the weight ratio; the weight ratio supports dynamic adjustment and takes effect in real time after adjustment.

[0016] As a further improvement of the present invention, the load balancing strategy includes a message header-based load balancing strategy, specifically including configuring message header routing rules in the Ingress resource annotation, the top-level Ingress Controller parsing the request message header, and routing the request to the specified member cluster according to the message header routing rules.

[0017] As a further improvement of the present invention, the topology-aware monitoring component is deployed in a multi-replica form. Each replica instance achieves master-slave election through a distributed lock based on Etcd. Only the master instance executes the Watch monitoring task, while the backup instance is in a standby state and automatically switches over when the master instance fails.

[0018] As a further improvement of the present invention, the monitoring component only synchronizes incremental change information to the control plane cluster, and the control plane cluster periodically initiates a full topology check to ensure the consistency of topology data of each member cluster; the top-level Ingress Controller provides an extensible load balancing algorithm interface, which supports dynamically loading custom routing algorithms in the form of plug-ins.

[0019] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention provides a cross-node topology awareness and load balancing scheduling method for distributed computing clusters. It deploys a topology awareness monitoring component in member clusters and utilizes the Kubernetes Watch mechanism to monitor Deployment resource change events in real time. Newly created resources are verified, and their topology configuration information is extracted and reported to the control plane cluster. This information is then stored in a custom CRD and distributed to other member clusters. Simultaneously, the control plane cluster maintains the external access addresses of each member cluster's Ingress Controller to the Endpoints resource, creates a unified Service and Ingress, deploys the top-level Ingress Controller as a unified entry point, and configures load balancing strategies. Deployment resources discovered during the topology awareness phase are automatically incorporated into the service discovery system during the load balancing scheduling phase. This achieves a complete closed-loop linkage between cross-cluster topology awareness, a unified service access entry point, and load balancing scheduling. Compared with existing technologies, this invention effectively solves the problems of information silos where locally created resources in member clusters cannot be detected in real time in multi-cluster environments, the complexity of client access due to the dispersed service addresses of each cluster, and the lack of a linkage mechanism between topology awareness and load balancing. It significantly improves the real-time performance of application topology information and the flexibility and automation level of cross-cluster traffic scheduling in multi-cluster architectures.

[0020] This invention enables dynamic weight distribution based on traffic ratios and fine-grained routing scheduling based on request message headers by configuring the traffic weight ratios or message header routing rules for each member cluster in the annotations of the top-level Ingress resource. Compared to the shortcomings of existing federated DNS schemes, such as DNS caching latency and the inability to perform fine-grained routing based on message headers, the traffic ratio strategy of this invention supports real-time dynamic adjustment of weights, and the message header strategy supports precise routing of traffic to specified clusters based on business request characteristics (such as regional identifiers, user groups, etc.). The two strategies can be used independently or in combination, meeting the fine-grained traffic scheduling needs of diverse business scenarios such as multi-regional deployment, canary releases, and A / B testing, and significantly improving the flexibility and business adaptability of cross-cluster load balancing.

[0021] This invention deploys a topology-aware monitoring component in a multi-replica configuration and implements master-slave election based on Etcd distributed locks. Only the master instance executes the Watch monitoring task, and the slave instance automatically switches over to take over when the master instance fails, effectively ensuring the continuity of the topology-aware service and avoiding single-point-of-failure risks. Simultaneously, by synchronizing incremental change information only to the control plane cluster through the monitoring component, and by periodically initiating a full topology check to ensure the consistency of topology data across member clusters, this invention reduces network bandwidth and storage overhead while guaranteeing eventual consistency of cross-cluster topology information. Compared to existing solutions that lack fault tolerance and consistency guarantee mechanisms, this invention significantly improves the reliability and data accuracy of multi-cluster topology-aware systems during long-term operation. Attached Figure Description

[0022] Figure 1 This is an overall system architecture diagram of a cross-node topology awareness and load balancing scheduling method for distributed computing power clusters disclosed in one embodiment of the present invention.

[0023] Figure 2 This is a flowchart of a cross-node topology sensing method disclosed in one embodiment of the present invention; Figure 3 This is a flowchart of a cross-cluster unified load balancing scheduling method disclosed in one embodiment of the present invention; Figure 4 This is a timing diagram of the monitoring and synchronization of a topology-aware monitoring component disclosed in one embodiment of the present invention; Figure 5 This is a diagram of a multi-layer Ingress access architecture disclosed in one embodiment of the present invention. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0025] The present invention will now be described in further detail with reference to the accompanying drawings: This invention provides a cross-node topology awareness and load balancing scheduling method for distributed computing power clusters, applicable to Karmada multi-cluster management environments that include a control plane cluster and at least two member clusters.

[0026] like Figure 1As shown, the overall system architecture of the method of this invention comprises three components: a control plane cluster, member cluster A, and member cluster B. The control plane cluster deploys a topology management center (implemented as a custom CRD), a Karmada control plane (including components such as the Karmada API Server, Karmada Controller Manager, and Karmada Scheduler), and a top-level Ingress Controller. Each member cluster deploys components such as a topology-aware agent, application instances (Pods), services, and Ingress Controllers.

[0027] The control plane cluster communicates with each member cluster via a Karmadada control plane-member cluster star topology. The control plane cluster provides a unified API entry point through the Karmadada API Server, and each member cluster connects to the Karmadada control plane using the karmadactl join command.

[0028] The following describes in detail the specific implementation of the two core modules of the present invention, the cross-node topology awareness module and the cross-cluster unified load balancing scheduling module, with reference to the accompanying drawings.

[0029] The cross-node topology awareness mechanism in this invention aims to solve the problem that the control plane cluster and other member clusters cannot perceive the creation of new Deployment resources in real time when member clusters create new Deployment resources.

[0030] 1. Deployment of the monitoring component like Figure 2 As shown, the process of the cross-node topology awareness method begins with deploying a topology awareness listening component in each member cluster.

[0031] (1) Component development and packaging The listening component is developed in Go and uses the `client-go` library to interact with the Kubernetes API Server. It runs as either a Deployment or a DaemonSet on each member cluster. When deployed as a Deployment, a Pod template must be defined in the YAML file, specifying the container image, resource requests and limits, environment variables, and other configurations. When deployed as a DaemonSet, one Pod instance runs on each node, suitable for scenarios where listening tasks need to be executed on every node.

[0032] (2) RBAC permission configuration The listening component needs permission to communicate with the Kubernetes API Server and RBAC configuration to listen to Deployment resources. Specifically, a dedicated ServiceAccount needs to be created, and get, list, and watch permissions for Deployment resources need to be defined through ClusterRole. These permissions are then granted to the ServiceAccount through ClusterRoleBinding. When the listening component starts, it uses the authentication token of the ServiceAccount to establish an authenticated communication connection with the API Server.

[0033] (3) Establish a long connection with the API Server After the listening component starts, it establishes a connection with the member cluster API Server through the `Clientset` object of `client-go`. This connection is a persistent HTTP connection, continuously receiving resource change events pushed by the API Server using HTTP chunked transfer encoding. Specifically, the listening component uses the `watch` interface of `client-go` to initiate a `Watch` request. This request returns a `watch` interface object, whose `ResultChan` method returns a channel. The API Server continuously pushes resource change events to this channel through the persistent HTTP connection.

[0034] 2. Long-lived connection monitoring based on the Watch mechanism The listening component uses the Kubernetes Watch mechanism to send listening requests for Deployment resources to the API Server of the member cluster.

[0035] (1) Limitation of monitoring range The scope of resources to be monitored is precisely limited using a label selector, allowing monitoring only of Deployment resources with specific labels (such as `topology-sync:enabled`). This filtering is achieved by setting the `LabelSelector` field in the `ListOptions` of the Watch request. Limiting the monitoring scope using label selectors reduces unnecessary network overhead and API server pressure, avoiding the performance degradation caused by monitoring all Deployment resources in the cluster.

[0036] (2) Event types to listen to The event types to be monitored include: ADDED (addition), MODIFIED (modification), and DELETED (deletion). The monitoring component distinguishes the event type through the Type field of the watch.Event object and obtains the specific Deployment object through the Object field.

[0037] (3) Watch connection keep-alive The Watch connection must remain active for a long time. When the connection is interrupted due to network fluctuations or API Server restarts, the listening component must implement an automatic reconnection mechanism: capture the event when the ResultChan channel of the watch interface is closed, and re-initiate the Watch request after an exponential backoff delay to ensure the continuity of the listening service.

[0038] 3. Verify newly created resources When the listening component receives the ADDED event, it needs to validate the Deployment corresponding to the event to determine whether the Deployment is a newly created resource.

[0039] (1) Maintenance of UID cache list The listening component maintains a cached list of processed Deployment UIDs in memory. This cache list uses an LRU caching mechanism and supports expiration and eviction. The cache capacity can be configured based on the number of Deployments in the member cluster, typically set to 10,000 to 50,000 entries.

[0040] (2) Verification logic The listening component compares the Deployment UID in the current ADDED event with the cache list: if the UID is not in the cache list, it determines that the Deployment is a newly created resource, enters the synchronization process, and adds the UID to the cache list; if the UID already exists in the cache list (such as a duplicate event caused by API Server reconnection), the event is ignored to avoid duplicate processing.

[0041] (3) Cache eviction policy LRU caching supports an expiration and eviction mechanism. When the cache reaches its capacity limit, the least used entry is automatically evicted. Furthermore, it can be combined with a scheduled cleanup mechanism to periodically remove entries from the cache that have exceeded a set time (e.g., 24 hours), preventing the cache from growing indefinitely.

[0042] 4. Topology Information Extraction For a new Deployment that passes verification, the listening component extracts its complete topology configuration information.

[0043] (1) Extracted information content The extracted information includes, but is not limited to: Deployment name, namespace, associated tags, number of replicas, container image name and version, port configuration, resource requests and limits, affinity rules, etc.

[0044] (2) Encapsulation of topology data structure The extracted information is serialized and encapsulated according to a predefined topology data structure. This data structure can be in Protocol Buffers or JSON format and includes the following fields: resource UID, name, namespace, tag mapping, replica count, container information list, resource requirements, affinity rules, cluster identifier, timestamp, etc. The encapsulated data is serialized via JSON and prepared for reporting to the control plane cluster.

[0045] 5. Topology information synchronization The listening component reports the encapsulated topology information to the topology management center of the control plane cluster through a secure channel.

[0046] (1) Establishment of safety passage Communication between the listening component and the control plane cluster is conducted through a secure TLS-encrypted channel. The listening component establishes a two-way TLS-authenticated connection using the control plane cluster's CA certificate and the client certificate, ensuring the confidentiality and integrity of data transmission.

[0047] (2) The control plane is stored in a custom CRD. The control plane cluster stores the topology information reported by each member cluster in the form of a custom CRD. This CRD can be named TopologySync, with the group topology.karmada.io, version v1alpha1, and scope Namespaced. The Spec field of the TopologySync resource contains the reported topology information (Deployment name, namespace, tag, number of replicas, container image, etc.), and the Status field records the synchronization status (such as Synced, Pending, Failed).

[0048] (3) Distribute topology information to other member clusters The control plane distributes the TopologySync CRD to other member clusters that need to be aware of the topology using Karmada's PropagationPolicy. Specifically, a PropagationPolicy resource is created in the control plane cluster, the TopologySync resource type is selected via resourceSelectors, and the target member cluster list is specified via placement. Through the above configuration, the TopologySync CRD is distributed to the specified member clusters, realizing a closed loop of cross-cluster topology awareness: "Member cluster A creates Deployment → Control plane awareness → Synchronization to member clusters B, C..."

[0049] (4) Temporal relationship like Figure 4 As shown, the entire timeline of the listening component from establishing a Watch connection to capturing the new Deployment creation event, verifying the UID, extracting information, and reporting synchronization is as follows: Listening component starts up → establishes a long Watch connection with the API Server → new Deployment creation event is triggered → ADDED event is pushed to the listening component → UID cache comparison and verification → topology information extraction → TLS encrypted reporting to the control plane → the control plane stores it as a TopologySync CRD → it is distributed to other member clusters through PropagationPolicy → other member clusters perceive the topology information.

[0050] This invention's cross-cluster unified load balancing scheduling mechanism aims to solve the problem that after Karmada distributes applications across multiple clusters, each cluster's Service operates independently and cannot be uniformly accessed externally. Specific implementation methods include: 1. Multi-cluster application distribution like Figure 3 As shown, the process of the cross-cluster unified load balancing scheduling method begins with the distribution of multi-cluster applications.

[0051] Define the Deployment application resource in the Karmada control plane cluster, and configure basic information such as container image, number of replicas, and port. Then create a PropagationPolicy resource, select the Deployment through resourceSelectors, specify the target cluster list (such as member-cluster-a and member-cluster-b) in the placement, and distribute the application instance to two or more member clusters.

[0052] During distribution, the `OverridePolicy` property can be used to configure different parameters for different clusters. For example, three replicas can be configured for member-cluster-a, two replicas for member-cluster-b, or different image versions and resource quotas can be configured for different clusters. Each member cluster receives the Work object issued by Karmada and creates the corresponding Pod instance.

[0053] 2. Multi-cluster Service Distribution Define Service resources in the Karmada control plane cluster, configuring service names, label selectors, port mappings, etc. Distribute the Service to each member cluster via PropagationPolicy, with configuration similar to Deployment distribution. Each Service in each member cluster is responsible for network access and load balancing of Pods within its own cluster, but at this point, each Service is only reachable within its own cluster's network space (ClusterIP type) and is not visible to the outside world.

[0054] 3. Sub-cluster service exposure Each member cluster exposes its own cluster's Service as an externally accessible service through its own Ingress Controller (such as Nginx IngressController, Traefik, etc.).

[0055] (1) Deploy the Ingress Controller Deploy the Ingress Controller in each member cluster. For the Nginx Ingress Controller, deployment can be done via Helm installation or by directly using the official YAML file.

[0056] (2) Create Ingress resource Create Ingress resources in each member cluster to expose the Service as an externally accessible service. Configure hostnames and path rules in the Ingress resource to route requests for specific domain names or paths to the corresponding Service and port.

[0057] (3) Obtain the external access address Each member cluster's Ingress Controller obtains an independent external access address. The address format is IP:Port or domain name. For example, the Ingress Controller address for sub-cluster A is 192.168.1.100:32080, and the Ingress Controller address for sub-cluster B is 192.168.1.200:32080. The external access address can be obtained by querying the external IP and port of the Ingress Controller Service.

[0058] 4. Control plane address maintenance In the control plane cluster, create an Endpoints resource and maintain the external access addresses of the Ingress Controllers of each member cluster as address entries in it.

[0059] The Endpoints resource must have the same name as the Service created subsequently. Define a list of addresses in subsets, with each address entry recording the IP address of a member cluster Ingress Controller and specifying the port number in ports. Additionally, each address entry records the corresponding cluster's identification information (such as cluster-id) through the nodeName field or annotations, for subsequent fine-grained routing.

[0060] 5. Unified creation of Service and Ingress in the control plane (corresponding to step S8 in claim 1) In the control plane cluster, create a Service resource and an Ingress resource.

[0061] (1) Create a unified service The control plane cluster creates a Service of type ClusterIP (not directly exposed to the outside world). By associating with Endpoints resources, it abstracts the address of the backend sub-cluster Ingress Controller into a Service endpoint accessible within the cluster. This Service does not set a label selector; service discovery is achieved through Endpoints with the same name.

[0062] (2) Create the control plane Ingress Create an Ingress resource in the control plane to route the domain name and path of external requests to the unified Service mentioned above, and configure the corresponding host and path forwarding rules.

[0063] 6. Unified access to the top-level Ingress Controller Deploy a top-level Ingress Controller in the control plane cluster. This Ingress Controller serves as the unified external access point for the entire multi-cluster system.

[0064] (1) Deploy the top-level Ingress Controller The top-level Ingress Controller is deployed in the same way as the Ingress Controllers in each member cluster. It must be ensured that the top-level Ingress Controller has a publicly accessible IP address or domain name to serve as the unified entry point.

[0065] (2) Traffic forwarding path The top-level Ingress Controller receives all external requests and distributes them to the backend member clusters according to the routing rules configured in the control plane Ingress resource. The traffic forwarding path is: external client → top-level Ingress Controller (unified entry point) → control plane Ingress → control plane Service → Endpoints → member cluster Ingress Controllers → member cluster Services → Pod instances.

[0066] like Figure 5 As shown, the architecture consists of three layers: Unified entry point: The top-level Ingress Controller receives all external requests.

[0067] Routing and forwarding layer: Control plane Ingress and Service, which forward requests to the corresponding address according to routing rules.

[0068] Business service layer: Each member cluster's Ingress Controller and Service ultimately distributes requests to specific Pod instances.

[0069] In this invention, the top-level Ingress Controller supports two load balancing strategies, which can be configured in the annotations of the control plane Ingress resources.

[0070] 1. Load balancing strategy based on traffic ratio Configure the traffic weight ratio for each member cluster in the annotations of the Ingress resource on the control plane (e.g., cluster-a has a weight of 2, cluster-b has a weight of 1). The top-level Ingress Controller distributes requests to each member cluster according to the weight ratio. For example, with a 2:1 ratio, 2 out of every 3 requests will be routed to sub-cluster A, and 1 will be routed to sub-cluster B. The weight ratio supports dynamic adjustment, and the adjustment takes effect immediately without restarting the Ingress Controller or redeploying the service.

[0071] The specific configuration method is as follows: Add a custom annotation supported by Nginx IngressController to the metadata.annotations of Ingress, and specify the weight distribution of each backend through the annotation value.

[0072] 2. Load balancing strategy based on message headers Configure message header routing rules in the annotations of the control plane Ingress resource (such as determining the target cluster based on the value of the X-Region or X-Cluster-ID request header). The top-level Ingress Controller parses the request message header and routes the request to the specified member cluster according to the rules. For example, configuring the rule "X-Region: east → cluster-a, X-Region: west → cluster-b" will ensure that requests carrying different Region identifiers are accurately routed to the corresponding clusters.

[0073] The specific configuration method is as follows: Configure the message header matching rules in Ingress's metadata.annotations, specifying the request header name and target value to be matched, as well as the corresponding routing backend, through annotations.

[0074] The two strategies can be used in combination. For example, based on message header routing, a default traffic ratio distribution strategy can be set for message headers that do not match any rules, to achieve more flexible cross-cluster traffic scheduling.

[0075] This invention also organically combines the topology sensing phase with the load balancing scheduling phase to form a complete closed-loop linkage mechanism.

[0076] When a new Deployment resource with a specific tag (such as topology-sync:enabled) is created in a member cluster through the automated operation and maintenance platform, the topology-aware monitoring component captures the creation event in real time through the Watch mechanism. After new creation verification and topology information extraction, it reports the event to the control plane cluster. The control plane stores this topology information as a TopologySync CRD and distributes it to other member clusters through PropagationPolicy.

[0077] During the load balancing scheduling phase, after the Service resource corresponding to the newly created Deployment resource is exposed (or already exists) by each member cluster, its Ingress Controller's external access address is incorporated into the unified service management system of the control plane through the Endpoints resource. The top-level Ingress Controller routes external requests to the newly created application instance through the configuration of the control plane Ingress and Service.

[0078] Through the above mechanism, newly created application resources are automatically included in the service discovery scope of the load balancer after the topology synchronization is completed. They can be identified and routed by the top-level Ingress Controller, realizing a complete closed-loop linkage from "perception → synchronization → access → load" without manual intervention.

[0079] This invention also includes a high availability and incremental synchronization mechanism for the monitoring component, specifically including: 1. Listener component master / slave election mechanism The topology-aware monitoring component is deployed in multiple replicas across each member cluster. Each replica instance uses a distributed lock based on Etcd to achieve master / slave election. Specifically, after startup, each replica instance attempts to create a specific key as a lock in Etcd. The instance that successfully creates the lock becomes the master instance, and the remaining instances become slave instances. Only the master instance executes the Watch monitoring task; slave instances remain in standby mode, periodically attempting to acquire the lock. When the master instance fails or the network disconnects, its lock automatically expires and is released, allowing a slave instance to successfully acquire the lock and take over the monitoring task, ensuring the continuity of the topology-aware service.

[0080] 2. Incremental synchronization mechanism The monitoring component only synchronizes incremental change information to the control plane cluster, rather than synchronizing all changes, to reduce network bandwidth and storage overhead. Specifically, the monitoring component only reports newly created Deployment topology information (ADDED event) and change information (MODIFIED event) to the control plane; DELETED events are also reported as incremental changes. The control plane cluster periodically (e.g., hourly) initiates a full topology check, comparing the topology information stored in the control plane with the actual Deployment deployment status of each member cluster to correct data inconsistencies caused by network packet loss or other anomalies, ensuring eventual consistency of topology data across clusters.

[0081] 3. Custom load balancing algorithm plugin The top-level Ingress Controller provides an extensible load balancing algorithm interface, allowing users to customize routing algorithms (such as those based on minimum connections, response time, or geographic location) according to business needs, and dynamically load them as plugins. Specifically, the top-level Ingress Controller defines a load balancing algorithm interface (including the selectBackend method). Users implement this interface and compile it into a dynamic link library (.so file) or load it through the Go plugin mechanism. By specifying the custom algorithm name in the Ingress annotation, the custom routing algorithm can be integrated into the load balancing scheduling process of the top-level Ingress Controller.

[0082] In a preferred implementation, after the topology configuration information is reported to the control plane, the control plane maintains the synchronization status of this topology information through the Status field of TopologySyncCRD, including: reporting time, last synchronization time, list of target clusters for synchronization, and the synchronization status of each cluster (synchronized / synchronizing in progress / failed). When the synchronization of a target cluster fails, the control plane automatically retryes, with the retry interval employing an exponential backoff strategy (e.g., an initial interval of 1 second, a maximum interval of 60 seconds), until synchronization is successful or the maximum number of retry attempts is reached (e.g., 10 times).

[0083] As a preferred implementation, in addition to the LRU eviction mechanism, the UID cache list of the monitoring component also supports a manual cleanup interface. Operation and maintenance personnel can trigger cache cleanup through HTTP endpoints or signals for troubleshooting or forced resynchronization scenarios.

[0084] As a preferred implementation, the top-level Ingress Controller supports percentage configuration for traffic ratio weights (e.g., cluster-a:70%, cluster-b:30%). The system automatically verifies that the sum of the weights of all clusters is 100%. If it does not meet the requirement, an alarm will be issued to avoid abnormal traffic allocation due to configuration errors.

[0085] As a preferred implementation, when the external access address of the Ingress Controller of each member cluster changes (such as IP change or port change), the control plane detects the change through periodic health checks or Watch mechanism and automatically updates the corresponding address entries in the Endpoints resource without manual intervention. Example 1:

[0086] This embodiment uses the Karmada multi-cluster management environment as an example, including two member clusters (sub-cluster A and sub-cluster B) and a control plane cluster, and fully demonstrates the entire process from creating a new Deployment resource locally in sub-cluster A to cross-cluster load balancing access.

[0087] 1. Topology sensing stage In sub-cluster A, operations personnel created a new Deployment resource using an automated operations platform (such as a CI / CD pipeline or GitOps tools) to deploy a web application service. This Deployment resource carries the specific tag `topology-sync: enabled` during creation so that it can be recognized by listening components. The Deployment is configured with 3 replicas, container image `web-app:v1.0`, and container port 8080.

[0088] The topology-aware agent deployed in sub-cluster A establishes a persistent HTTP connection with the API server of sub-cluster A via the Kubernetes Watch mechanism, listening in real time for Deployment resource change events tagged with `topology-sync:enabled`. When the Deployment resource is created, the API server pushes an `ADDED` event to the agent via the persistent connection.

[0089] Upon receiving the ADDED event, the listening component retrieves the Deployment's metadata (including UIDd-12345-abcde) and compares the current Deployment UID with the LRU cache list maintained in the listening component's memory. If the comparison confirms that the UID is not in the cache list, the Deployment is determined to be a newly created resource, and the UID is then added to the cache list to avoid subsequent duplicate processing.

[0090] The listening component extracts the complete topology configuration information of the Deployment, including: Deployment name web-app, namespace default, associated tags, number of replicas (3), container image name and version web-app:v1.0, port configuration 8080, resource requests and limits, affinity rules, etc. The extracted information is serialized and encapsulated according to a predefined topology data structure (JSON format).

[0091] The listening component reports the encapsulated topology information to the topology management center of the control plane cluster via a TLS encrypted channel. The control plane cluster stores this topology information in the form of a TopologySync CRD. The Spec field of the CRD records the complete configuration of the reported Deployment name, namespace, number of replicas, container image, etc., and the Status field is marked as Synced.

[0092] The control plane cluster creates a PropagationPolicy resource and distributes the TopologySync CRD to sub-cluster B. Sub-cluster B receives this CRD through Karmada's resource synchronization mechanism and learns that a new web-app application and its complete topology configuration information have been added to sub-cluster A, completing cross-cluster topology awareness. At this point, the Deployment resource created locally in sub-cluster A has been perceived by the control plane cluster and synchronized to sub-cluster B, achieving a closed loop of cross-cluster topology awareness: "Sub-cluster A creation → Control plane awareness → Synchronization to sub-cluster B".

[0093] 2. Load balancing scheduling phase In the Karmada control plane cluster, operations personnel define Deploymentweb-app and Serviceweb-app-svc. The Service is configured with a tag selector app:web-app and port mapping (80→8080). The Deployment and Service are distributed to sub-cluster A and sub-cluster B via PropagationPolicy. Sub-cluster A and sub-cluster B each create corresponding Pod instances (3 replicas per cluster) and Service resources (ClusterIP type, reachable only within their own cluster network).

[0094] Sub-cluster A creates an Ingress resource through its Nginx Ingress Controller, exposing web-app-svc as an externally accessible service with an external address of 192.168.1.100:32080; Sub-cluster B creates an Ingress resource through its Nginx Ingress Controller, exposing web-app-svc as an externally accessible service with an external address of 192.168.1.200:32080.

[0095] The control plane cluster creates an Endpoints resource web-app-ep, adding the addresses 192.168.1.100:32080 of sub-cluster A and 192.168.1.200:32080 of sub-cluster B as address entries. The nodeName field of each address entry is marked as member-cluster-a and member-cluster-b, respectively, for subsequent fine-grained routing.

[0096] The control plane cluster creates a Service web-app-global-svc of type ClusterIP (without a label selector). This Service is associated with Endpoints web-app-ep, abstracting the access address of the backend sub-clusters into a Service endpoint accessible within the cluster. Subsequently, the control plane cluster creates an Ingress web-app-global-ingress, routing the domain web-app.example.com to web-app-global-svc. The traffic ratio is configured in the annotations of this Ingress as cluster-a:2, cluster-b:1.

[0097] The control plane cluster deploys a top-level Nginx Ingress Controller, which obtains a unified entry address of 203.0.113.10:80. When an external client accesses this unified entry address via http: / / web-app.example.com, the top-level Ingress Controller receives the request and, according to the traffic ratio configuration in the control plane Ingress annotation, distributes the request at a 2:1 ratio to sub-cluster A (address 192.168.1.100:32080) and sub-cluster B (address 192.168.1.200:32080). Each sub-cluster's Ingress Controller further forwards the request to the Service within its own cluster, ultimately distributing the load to the backend Pod instances.

[0098] Through the above process, this embodiment fully demonstrates the entire process from creating a Deployment locally in sub-cluster A to cross-cluster unified load balancing access. After the newly created web-app is automatically discovered and synchronized in the topology awareness phase, it is automatically incorporated into the service discovery system of the top-level Ingress Controller in the load balancing scheduling phase, realizing a complete closed-loop linkage from "awareness → synchronization → access → load balancing", and the entire process requires no manual intervention. Example 2:

[0099] This embodiment demonstrates an application scenario of a load balancing strategy based on message headers. This embodiment builds upon the basic deployment environment of Embodiment 1, where web-app applications have been deployed in sub-cluster A and sub-cluster B, and a multi-layered Ingress unified access architecture has been established on the control plane.

[0100] 1. Scenario Requirements A business system deployed across multiple regions has sub-cluster A deployed in East China (serving users in the eastern region) and sub-cluster B deployed in South China (serving users in the western region). The business wants to accurately route requests to the corresponding regional cluster based on the region identifier X-Region in the HTTP request header, in order to reduce cross-regional access latency and meet data localization compliance requirements.

[0101] 2. Configuration and Implementation The operations and maintenance personnel configure header-based routing rules in the annotations of the Ingressweb-app-global-ingress of the control plane cluster. Specifically, the following rules are configured: when the value of the request header X-Region is east, the request should be routed to sub-cluster A; when the value of the request header X-Region is west, the request should be routed to sub-cluster B. A default policy is also configured: when the request header X-Region does not exist or its value does not match any rule, traffic is distributed proportionally (e.g., 50% to sub-cluster A and 50% to sub-cluster B).

[0102] Once configured, the top-level Ingress Controller in the control plane loads the updated annotation configuration in real time without requiring a service restart.

[0103] 3. Request route verification Client A (located in the East China region) sends an HTTP request to the unified entry address of the top-level Ingress Controller, 203.0.113.10:80, with the request header containing X-Region: east. Upon receiving the request, the top-level Ingress Controller parses the X-Region field in the request header, matches it against the configuration rules, and routes the request to the external address of the Ingress Controller in sub-cluster A, 192.168.1.100:32080. The Ingress Controller in sub-cluster A forwards the request to the web-app-svc Service within the same cluster. Ultimately, the Pod instance in sub-cluster A processes the request and returns a response. Users in the East China region receive a low-latency, localized service response.

[0104] Client B (located in the South China region) sends an HTTP request to the top-level Ingress Controller, carrying X-Region: west in the request header. The top-level Ingress Controller parses the request header, matches the configuration rules, and routes the request to the external address 192.168.1.200:32080 of sub-cluster B. The Ingress Controller of sub-cluster B forwards the request to the Service and Pod instances within its local cluster. Users in the South China region also receive a localized service response.

[0105] Client C (without a region identifier or with a mismatched value, such as X-Region: north) sends an HTTP request to the top-level Ingress Controller. The top-level Ingress Controller checks the request headers and finds no matching rules. It then randomly distributes the request to either sub-cluster A or sub-cluster B according to the default traffic distribution strategy (50%:50%).

[0106] 4. Dynamic adjustment Operations personnel can adjust message header routing rules at any time according to business needs. For example, when the number of users in the South China region increases, and a new sub-cluster C (deployed in South China Region 2) needs to be added on top of sub-cluster B to carry some traffic, the rule X-Region: west-south → cluster-c can be added to the Ingress annotation, and some clients can be configured to carry the X-Region: west-south request header. The new rule takes effect in real time without restarting or redeploying any service components.

[0107] This embodiment demonstrates that the load balancing strategy based on message headers enables precise traffic scheduling to different regional clusters based on business request characteristics (regional identifiers), meeting the fine-grained traffic scheduling requirements for low-latency access, data localization compliance, and canary releases in multi-region deployment scenarios. Furthermore, this strategy, along with the traffic ratio strategy in Embodiment 1, can be used in combination within the same Ingress resource, providing operations personnel with rich cross-cluster traffic management capabilities.

[0108] Advantages of this invention: This invention utilizes a custom listening component based on a Go plugin and the Kubernetes Watch long-connection mechanism to enable newly created Deployments in member clusters to be detected and synchronized to the control plane cluster and other member clusters within milliseconds. Compared to the manual inspection and configuration methods of traditional solutions, this invention achieves topology awareness capabilities at the second or even millisecond level, significantly improving the real-time performance and accuracy of application topology information in multi-cluster architectures.

[0109] This invention integrates application instances distributed across multiple member clusters into a unified external service access point through a multi-layered Ingress Controller architecture. External clients only need to access the top-level Ingress Controller address of the control plane cluster, without needing to be aware of the backend multi-cluster architecture details, thus reducing client access complexity and operation and maintenance costs.

[0110] This invention supports a traffic ratio-based load balancing strategy, allowing operations personnel to dynamically adjust traffic allocation weights based on the computing capacity and real-time load of each cluster; and a message header-based load balancing strategy, allowing businesses to route specific types of requests to designated clusters based on request characteristics. These two strategies can be used in combination to meet diverse cross-cluster traffic scheduling needs.

[0111] This invention organically combines the topology awareness module and the load balancing module. Newly created application resources can automatically enter the service discovery system of the load balancer after topology synchronization, and can be identified and routed by the top-level Ingress Controller. This realizes a complete closed loop from "awareness → synchronization → access → load", solving the problem of the two being separated in the existing solution.

[0112] In the method of this invention, operations and maintenance personnel do not need to configure service exposure and load balancing rules separately for each cluster, nor do they need to manually maintain the application topology list for each cluster. The automated topology awareness and unified load balancing mechanism of this invention significantly reduces the daily operations and maintenance workload in multi-cluster environments, and improves overall operations and maintenance efficiency and system reliability.

[0113] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A cross-node topology awareness and load balancing scheduling method for distributed computing power clusters, characterized in that, Applicable to Karmada multi-cluster management environments that include a control plane cluster and at least two member clusters, including: Topology sensing stage: Deploy topology-aware monitoring components in each member cluster. These monitoring components establish long connections with the API Server of the member clusters through the Kubernetes Watch mechanism to monitor changes to Deployment resources in the member clusters in real time. When the listening component detects the creation event of a new Deployment resource, it performs a new creation verification on the Deployment resource to determine whether the Deployment resource is a newly created resource. For a newly created Deployment resource that passes verification, the listening component extracts the topology configuration information of the Deployment resource and reports the topology configuration information to the control plane cluster through a secure channel; The control plane cluster stores the topology configuration information reported by each member cluster in the form of a custom resource CRD, and distributes the topology configuration information to other member clusters to achieve cross-cluster topology awareness. Load balancing scheduling phase: The control plane cluster determines the set of application resources that need to be load balanced across clusters based on the topology information synchronized during the topology awareness phase and / or according to a predefined distribution strategy, and distributes the Service resources corresponding to each application resource to each member cluster or confirms that the corresponding Service resources already exist in each member cluster. Each member cluster exposes its own Service as an externally accessible service through its respective Ingress Controller, thereby obtaining the external access address of each member cluster. The control plane cluster maintains the Endpoints resource, and records the external access addresses of the Ingress Controller of each member cluster as address entries in the Endpoints resource; The control plane cluster creates a unified service associated with the Endpoints resource, and creates an Ingress resource to route external requests to the unified service; The control plane cluster deploys a top-level Ingress Controller as a unified external access point, which receives external requests and distributes them to each member cluster according to the load balancing strategy configured in the Ingress resource. Specifically, the Deployment resources discovered during the topology awareness phase are automatically incorporated into the service discovery system during the load balancing scheduling phase, thereby achieving closed-loop linkage between topology awareness and load balancing.

2. The cross-node topology awareness and load balancing scheduling method for distributed computing power clusters according to claim 1, characterized in that: The listening component runs in each member cluster in the form of Deployment or DaemonSet, and has the permission to communicate with the Kubernetes API Server and the RBAC configuration to listen to Deployment resources. The listening component initiates listening requests for Deployment resources to the member cluster API Server through the Kubernetes Watch mechanism. The scope of resources to be listened to is precisely limited by a tag selector, and only Deployment resources with specific tags are listened to. The types of events to be listened to include: ADDED (addition), MODIFIED (modification), and DELETED (deletion).

3. The cross-node topology awareness and load balancing scheduling method for distributed computing power clusters according to claim 1, characterized in that, The newly created verification specifically includes: the listening component maintains a cached list of UIDs of processed Deployment resources in memory, compares the UID of the Deployment resource in the current ADDED event with the cached list, and if the UID is not in the cached list, it is determined that the Deployment resource is a newly created resource and enters the synchronization process; if the UID already exists in the cached list, the event is ignored.

4. The cross-node topology awareness and load balancing scheduling method for distributed computing power clusters according to claim 3, characterized in that: The UID cache list uses an LRU caching mechanism and supports expiration and eviction.

5. The cross-node topology awareness and load balancing scheduling method for distributed computing power clusters according to claim 1, characterized in that: The topology configuration information includes at least one of the following: Deployment resource name, namespace, associated tag, number of replicas, container image name and version, port configuration, resource requests and restrictions, and affinity rules; the topology configuration information is serialized and encapsulated according to a predefined topology data structure and then reported to the topology management center of the control plane cluster.

6. The cross-node topology awareness and load balancing scheduling method for distributed computing power clusters according to claim 1, characterized in that: Each address entry in the Endpoints resource records the identification information of the corresponding member cluster, which is used for subsequent fine-grained routing.

7. The cross-node topology awareness and load balancing scheduling method for distributed computing power clusters according to claim 1, characterized in that: The load balancing strategy includes a traffic ratio-based load balancing strategy, specifically including configuring the traffic weight ratio of each member cluster in the annotation of the Ingress resource. The top-level Ingress Controller distributes requests to each member cluster according to the weight ratio. The weight ratio supports dynamic adjustment and takes effect in real time after adjustment.

8. The cross-node topology awareness and load balancing scheduling method for distributed computing power clusters according to claim 1, characterized in that: The load balancing strategy includes a header-based load balancing strategy, specifically including configuring header routing rules in the Ingress resource annotation, the top-level Ingress Controller parses the request header and routes the request to the specified member cluster according to the header routing rules.

9. The cross-node topology awareness and load balancing scheduling method for distributed computing power clusters according to claim 1, characterized in that: The topology-aware monitoring component is deployed in a multi-replica configuration. Each replica instance achieves primary / standby election through a distributed lock based on Etcd. Only the primary instance executes the Watch monitoring task, while the standby instances are in a standby state and automatically switch over when the primary instance fails.

10. The cross-node topology awareness and load balancing scheduling method for distributed computing power clusters according to claim 1, characterized in that: The monitoring component only synchronizes incremental change information to the control plane cluster. The control plane cluster periodically initiates a full topology check to ensure the consistency of topology data in each member cluster. The top-level Ingress Controller provides an extensible load balancing algorithm interface, supporting the dynamic loading of custom routing algorithms as plugins.