Multi-cluster management method and management system

By dynamically creating resource synchronizers in the management system and synchronizing multi-cluster resource information in real time, it solves the problems of high multi-cluster management costs and scattered data that are difficult to search, and achieves efficient multi-cluster management and data integration analysis.

CN118550642APending Publication Date: 2024-08-27ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410551291.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-06
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

In big data processing scenarios, a single Kubernetes cluster cannot meet the increasing infrastructure scale and complex application scenarios, resulting in high multi-cluster management costs and scattered data that makes it difficult to search and maintain quickly and accurately.

Method used

By dynamically creating resource synchronizers in the management system, multi-cluster resource information can be synchronized in real time, cross-cluster search and insight functions are provided, and resource data can be quickly and accurately integrated and analyzed.

Benefits of technology

It achieves efficient management of multiple clusters, reduces management and maintenance costs, and improves the efficiency of data search and analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118550642A
    Figure CN118550642A
Patent Text Reader

Abstract

The embodiment of the invention provides a management method and a management system for multi-cluster management. The management system comprises a resource manager and a storage layer. The corresponding management method comprises the following steps: when a first cluster is registered, a resource manager starts a first resource synchronizer for the first cluster; then, a monitoring component in the first resource synchronizer obtains first resource information of a first resource in the first cluster; wherein the first resource is a resource specified in first configuration information set for the first cluster. Moreover, a processing component in the first resource synchronizer calls a standard interface provided by the storage layer based on the first resource information. The storage layer responds to calling of the interface, and data operation on the first resource information is executed in the back-end storage area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present specification relate to computing clusters in the computer field, and more particularly, to a multi-cluster management method and apparatus. Background Art

[0002] In big data processing scenarios, virtualized and containerized computing clusters, such as Kubernetes clusters, are often used to elastically and flexibly perform computing tasks. As container cluster-related technologies become increasingly mature, the scale and demand for cluster usage by many cloud vendors and enterprises have reached new heights. A single Kubernetes cluster can no longer support the growing scale of infrastructure and increasingly complex application scenarios, so expanding a single cluster to multiple clusters has become a natural choice and trend. For example, in scenarios such as big data analysis platforms, cloud computing platforms, and search engines, multiple clusters are required to search and analyze data.

[0003] However, when clusters are expanded from a single cluster to multiple clusters, new problems arise. First, as the number and size of multiple clusters continue to increase, the management and maintenance costs are also increasing. Second, the data of multiple clusters is often scattered in different places, making it difficult to search quickly and accurately. This greatly increases the difficulty of managing and maintaining multiple clusters.

[0004] Therefore, an improved solution is needed to manage multiple clusters more efficiently. Summary of the invention

[0005] One or more embodiments of this specification describe a management method and a management system for multi-cluster management, which can achieve resource information synchronization and efficient management of multiple clusters.

[0006] According to a first aspect, a multi-cluster management method is provided, which is performed by a management system, wherein the management system includes a resource manager and a storage layer; the method includes:

[0007] A listening component in a first resource synchronizer obtains first resource information of a first resource in a first cluster; wherein the first cluster is one of several clusters that have been registered with the management system, the first resource synchronizer is started by the resource manager for the first cluster, and the first resource is a resource specified in first configuration information set for the first cluster;

[0008] The processing component in the first resource synchronizer calls a first interface provided by the storage layer based on the first resource information;

[0009] The storage layer executes data operations on the first resource information in the backend storage area in response to the call of the first interface.

[0010] According to a second aspect, a management system for performing multi-cluster management is provided, the management system comprising a resource manager and a storage layer; wherein:

[0011] The resource manager is configured to start a first resource synchronizer for a first cluster, wherein the first cluster is one of several clusters that have registered with the management system;

[0012] The monitoring component in the first resource synchronizer is configured to obtain first resource information of a first resource in the first cluster; wherein the first resource is a resource specified in the first configuration information set for the first cluster;

[0013] The processing component in the first resource synchronizer is configured to call a first interface provided by the storage layer based on the first resource information;

[0014] The storage layer is configured to perform data operations on the first resource information in a backend storage area in response to a call of the first interface.

[0015] According to a third aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the method described in the first aspect.

[0016] According to a fourth aspect, a computer program product is provided, comprising a computer program / instruction, which implements the method described in the first aspect when executed by a processor.

[0017] According to a fifth aspect, a computing device is provided, comprising a memory and a processor, wherein an executable code is stored in the memory, and when the processor executes the executable code, the method of the first aspect is implemented.

[0018] In the embodiments of this specification, the management system for multi-cluster management synchronizes resource information in multiple clusters in real time through dynamically created resource synchronizers, thereby maintaining the latest resource status. Based on the real-time and accurate resource status, the management system can also provide cross-cluster search and insight functions, quickly and accurately search for resource data in multiple clusters, and integrate and analyze the data. In this way, efficient management of multiple clusters can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0020] Figure 1 A schematic diagram showing a framework of a multi-cluster management system according to an embodiment;

[0021] Figure 2 Shows sample code for creating an index for the ES data engine at the storage layer;

[0022] Figure 3 A schematic diagram showing synchronization of resource information in one embodiment;

[0023] Figure 4 A flow chart showing a resource synchronization operation according to one embodiment;

[0024] Figure 5 A schematic diagram of the logical structure of a management system according to an embodiment is shown. DETAILED DESCRIPTION

[0025] The solution provided in this specification is described below in conjunction with the accompanying drawings.

[0026] In view of the difficulties and shortcomings in multi-cluster management in the related art, the embodiments of this specification provide a method and management system for multi-cluster management. The management system can dynamically synchronize resource information in multiple clusters, thereby maintaining the latest resource status in real time. Based on the real-time and accurate resource status, the management system also provides cross-cluster search and insight functions, which can quickly and accurately search for resource data of multiple clusters, and integrate and analyze the data. In this way, efficient management of multiple clusters can be achieved.

[0027] Regarding the above cluster concepts, for the sake of ease of description, the following uses the Kubernetes cluster (referred to as K8s cluster) as an example. The K8s cluster is a container cluster that deploys the container management software Kubernetes. Usually, depending on the configuration of the container management software, a container cluster may include management nodes and worker nodes. The management node is used as the control plane (Master) of the container cluster, responsible for cluster management and coordination. The worker node is used to run application containers.

[0028] A container cluster can provide resources to users. A resource refers to an entity or object in a cluster. These resources may include persistent entities, such as computing resources (such as Pod), network resources (such as Service), storage resources (Volume), etc. Specifically, a Pod can be deployed in a working node. A Pod is an encapsulation of one or more containers that share storage, network, and running configuration. As a single application instance, a Pod ensures that the containers inside it can work closely together and be managed in a unified manner. Service defines a way to access a Pod, which can provide a stable IP address and port for one or more Pods, while providing load balancing and service discovery capabilities to ensure the continuity and accessibility of the application, while hiding the complexity of the backend Pod. Volume provides an abstraction for Pod storage, which can be local storage or network storage. K8s clusters also typically include resource types such as Namespace and Deployment.

[0029] However, it should be understood that the concept of the embodiments of the specification is also applicable to other clusters with similar resource concepts, for example, some clusters modified or improved based on K8s. This specification is not limited to this.

[0030] In order to perform efficient multi-cluster management, a management system is first provided in the embodiments of the specification. Figure 1 FIG. 2 shows a schematic diagram of a multi-cluster management system according to an embodiment. Figure 1 As shown, the management system for implementing multi-cluster management includes a cluster resource synchronization module and a storage layer as basic modules. The cluster resource synchronization module includes a system-specific resource manager and a resource synchronizer dynamically created by the resource manager for each cluster. Specifically, the resource manager creates and starts its exclusive resource synchronizer for each registered cluster. The resource synchronizer is used to synchronize the resource information in the corresponding cluster to the management system.

[0031] The storage layer is used to perform read and write operations on the backend storage area. It shields the differences between different types of backend storage areas and provides a unified interface so that other modules can implement data operations on the backend storage area through these interfaces. Specifically, the resource information synchronized by the cluster resource synchronization module is stored in the backend storage area through the interface of the storage layer.

[0032] On this basis, the management system may also optionally include a retrieval module, an insight module, and a front-end interface. The retrieval module is used to process query requests for resources and retrieve the required resource information through the above storage layer. The insight module is used to integrate, count or analyze the resource information of resources in multiple clusters to obtain some insight results. The front-end interface is used to interact with users, such as receiving user query requests / insight requests and presenting corresponding processing results.

[0033] The following first describes the implementation of the storage layer.

[0034] The resource information of multiple clusters is stored in the backend storage area through the storage layer. As the middle layer between the upper modules and the backend storage area, the storage layer is used to provide a unified interface for the upper modules and shield the differences in the backend storage area. When the upper modules need to perform data operations such as data storage, update, and retrieval, they only need to call the interface provided by the storage layer without paying attention to the specific implementation of the backend storage area.

[0035] Specifically, in one embodiment, the storage layer provides the following interfaces for the upper layer module to call:

[0036]

[0037] The Create interface is used to create data in the backend storage area, the Get interface is used to read data in the backend storage area, and Update and Delete are used to update or delete data in the backend storage area. When calling these interface functions, some input parameters need to be passed in a certain format. In the above example, the input parameters include the following items: ctx, which is used to pass the request context, cluster is used to indicate the cluster identifier, and obj represents the specific resource object.

[0038] When the upper-layer module calls the above interface request to perform data operations, the storage layer converts the upper-layer request into the request language and request format supported by the back-end storage area according to the specific implementation method of the back-end storage area to implement the corresponding data operations.

[0039] Different implementations of the backend storage area may include using different databases, or different data engines.

[0040] In one embodiment, the backend storage area is implemented using a relational database. In this case, the storage layer can create several tables in the backend storage area to store resource information, and use SQL or similar structured query statements to operate on the tables, thereby realizing storage and retrieval of resource information.

[0041] In another embodiment, the backend storage area uses the Elastic Search (ES) data engine to perform data operations. In the ES data engine, documents are stored and retrieved in an indexing manner. The index may include a mapping, which defines the fields and data structures of the data. In this case, the storage layer may pre-create an index in the ES data engine for storing resource information, and define the data structure of the resource information therein.

[0042] Figure 2The following is a sample code for creating an index for the ES data engine in the storage layer. It should be noted that in this sample code, some format characters (a large number of brackets and reverse brackets) are omitted (using ellipsis...) in order to clearly show the core information. Figure 2 As shown in section 201, when creating an index, several attribute fields of resource information are defined in the mappings section, and separate mappings are established for these fields. These attribute fields include apiVersion, kind, name, namespace, cluster, etc. Among them, apiVersion represents the resource api version, kind represents the resource type (for example, pod, service or other), name is the name of the resource, and namespace is the namespace to which the resource belongs. The above four attribute fields are existing attributes of resources in the K8s cluster. Cluster represents the cluster identifier, which is a field newly created by the management system to distinguish clusters for multi-cluster management. The storage layer separately establishes mappings for the above five fields to facilitate data storage and retrieval. When performing CRUD (create, read, update, delete) operations on resource information, the storage layer will first retrieve documents matching the above five fields under the index, and call the interface functions provided by the ES data engine to perform corresponding operations on the documents.

[0043] In addition to the above five fields, the index further defines some metadata fields of resource objects, including annotation fields, creation timestamp, deletion timestamp, label, owner reference relationship field, etc. These fields record detailed information of resource objects to facilitate subsequent insight analysis.

[0044] In other embodiments, the backend storage area can also adopt other implementation methods, such as using the OpenSearch data engine. Accordingly, the storage layer prepares and defines the data structure and data format that meet the requirements of the backend storage area, and converts the operation request of the upper-level module into a data operation instruction supported by the backend storage area. In this way, the storage layer shields the differences in the backend storage area and simplifies the data operation of the upper-level module by providing a unified interface for the upper-level module.

[0045] Based on the above functions of the storage layer, the resource information synchronization process implemented on this basis is described below.

[0046] Figure 3 A schematic diagram of resource information synchronization in one embodiment is shown. The schematic diagram shows the entire process of resource information synchronization, including a cluster registration process as a preparation phase, and an information synchronization process in a synchronization phase. First, the cluster registration process is described.

[0047] When a new cluster needs to be connected, the user of the management system (such as an administrator) can enter the registration information through the front-end interface and set the configuration information of the new cluster. Specifically, the registration information may include the server address of the new cluster and the identity certificate. After receiving such registration information, the front-end interface can send the registration information to the multi-cluster proxy component, and the multi-cluster proxy component can then establish a connection with the new cluster based on the registration information. In particular, the multi-cluster proxy component obtains the identity authorization by obtaining the identity certificate of the new cluster, and can subsequently connect and communicate with the cluster and perform necessary monitoring and information pulling operations.

[0048] On the other hand, the front-end interface sends the received configuration information for the new cluster to the resource manager. Based on the configuration information, the resource manager creates and starts a dedicated resource synchronizer for the new cluster. The resource synchronizer is used to synchronize resource information in the cluster later.

[0049] In a specific example, it is assumed that cluster A and cluster B have been registered in the management system, and a new cluster C needs to be connected for unified management. Therefore, the administrator can enter the registration information Re-C and configuration information Conf-C of cluster C in the front-end interface. The registration information Re-C is sent to the multi-cluster proxy component, and the multi-cluster proxy component then establishes a connection with cluster C based on it. In one embodiment, the multi-cluster proxy component can merge the identity certificates of multiple clusters it obtains into a whole certificate, for example, merge the identity certificates of clusters A, B, and C into a whole certificate, and use the whole certificate to establish connections with clusters A, B, and C respectively.

[0050] The front-end interface also sends the configuration information Conf-C to the resource manager. The resource manager then starts a dedicated resource synchronizer Syc-C for cluster C. The resource manager manages and controls the resource synchronizer Syc-A for cluster A, the resource synchronizer Syc-B for cluster B, and the resource synchronizer Syc-C for cluster C.

[0051] In one embodiment, the resource manager and the resource synchronizer are centrally deployed. Specifically, the resource manager and the resource synchronizer are located in the same process of the device where the management system is located. The resource manager starts a resource synchronizer for each cluster in a multi-threaded manner, and each resource synchronizer is executed by a thread in the process. In this way, the deployment cost can be reduced.

[0052] In another embodiment, the resource manager and the resource synchronizer are deployed in a distributed manner. Specifically, the resource manager deploys its dedicated resource synchronizer in the corresponding cluster. For example, in the aforementioned example, the resource synchronizer Syc-A is deployed in cluster A, the resource synchronizer Syc-B is deployed in cluster B, and the resource synchronizer Syc-C is deployed in cluster C. This can avoid single-point performance issues in large-scale scenarios.

[0053] When the resource manager starts the resource synchronizer for a cluster, it needs to refer to the configuration information set for the cluster. Generally, the configuration information can specify the resource objects in the cluster that need to be paid attention to and synchronized. Because a cluster often includes a large number of resources, usually only a part of the resources are of interest, and it is not necessary to pay attention to all resources. In addition, some synchronization rules can also be specified in the configuration information, for example, setting labels for some resources, implementing some transformations by intercepting (or clipping) the attribute information of the resources, and so on.

[0054] The following code gives the configuration code for setting configuration information for a cluster.

[0055]

[0056]

[0057] As you can see, in this code, the cluster name and cluster information are first specified. Then, the information of the resource objects that need to be concerned in the cluster is specified, for example, apiVersion is "v1", resource type is "pod", and the namespace to which it belongs. These fields belong to Figure 2 The mapped fields are established separately in the created index. Then, the corresponding labels are selected for some resources through labelselector in the configuration code. In addition, transform rules are also specified in the configuration code. These rules indicate the rules for trimming or intercepting resource information when synchronizing resource information. This is because, even for resource objects of concern, it is not necessary to pay attention to all of their metadata fields. Therefore, the transform rules can be used to define how to handle fields that do not need to be paid attention to, such as deleting or intercepting them. In the above exemplary code, the transform rules define the deletion of the fields "annotation" and "finalizers" in the metadata of resource objects. As described in the above code, in addition to defining transform rules by yourself, you can also reference existing rules.

[0058] Based on the above configuration information, the resource manager creates and starts a targeted resource synchronizer, which is then configured to perform subsequent resource synchronization operations according to the instructions in the configuration information.

[0059] See below Figure 4 , and combined with Figure 3 , describes the resource synchronization operation after the resource synchronizer is started. Figure 4 A flow chart of a resource synchronization operation according to an embodiment is shown. The flow chart includes at least the following steps.

[0060] In step S41, the monitoring component in the first resource synchronizer obtains first resource information of a first resource in the first cluster, wherein the first cluster i is any one of a plurality of clusters that have been registered with the management system, the first resource synchronizer Syn-i is created and started by the resource manager for the first cluster i, and the first resource is a resource specified in the first configuration information set for the first cluster.

[0061] In one case, the first cluster is a newly registered cluster, and the first resource synchronizer is a newly started synchronizer. In this case, during the initial information synchronization process, the first resource synchronizer sequentially acquires resource information for all resources of interest specified in the first configuration information. At this time, the resources specified in the first configuration information are sequentially used as the above-mentioned first resources, and the corresponding first resource information is acquired. Afterwards, the first resource synchronizer can enter a normal listening state.

[0062] In another case, the first resource synchronizer is a synchronizer that is already in a normal listening state. At this time, the first resource synchronizer monitors changes in resources in the first cluster, and only obtains the first resource information corresponding to the changed first resource. The first resource information may specifically include several attribute information of the first resource, such as apiVersion, kind, name, namespace, etc., and some metadata fields, such as label, annotation, etc.

[0063] In one embodiment, the monitoring component in the first resource synchronizer passes Figure 3 The multi-cluster proxy component shown monitors the resources in the first cluster to obtain the first resource information. In another embodiment, when the first resource synchronizer is deployed in the first cluster, the monitoring component can also directly obtain the first resource information.

[0064] Next, in step S43, the processing component in the first resource synchronizer calls the first interface provided by the storage layer based on the first resource information.

[0065] In one embodiment, the first configuration information for the first cluster may include an interception rule (transformation rule) for the resource information. At this time, the processing component in the first resource synchronizer firstly intercepts and processes the first resource information according to the interception rule. The interception process may include deleting some uninteresting or redundant metadata fields in the first resource information. For example, as shown in the aforementioned exemplary configuration code, the fields "annotation" and "finalizers" in the metadata are deleted. Then, the first interface is called using the first resource information after the interception process.

[0066] In one embodiment, a local cache is introduced to store the processed resource hash values ​​to avoid repeated processing of resource information. In this embodiment, the processing component uses a predetermined hash algorithm to calculate the first hash value H1 corresponding to the first resource information (after interception if there is interception). In a specific example, Figure 3 As shown, the above-mentioned hash algorithm adopts the md5 algorithm which is relatively simple to calculate. In other examples, a more rigorous hash algorithm can also be used, such as SHA256. After calculating the first hash value H1, the processing component searches the local cache to determine whether the first hash value H1 is stored in the local cache. If the first hash value H1 has been stored in the local cache, it is considered that the resource information has been processed, and the process is terminated without subsequent processing. In the case where it is determined that the local cache does not store the first hash value, it is determined that the first resource information needs to be stored and processed. At this time, the processing component calls the first interface to store it in the back-end storage area, and stores the first hash value H in the local cache for subsequent query.

[0067] When the processing component determines that the first resource information needs to be stored, Figure 3 In the illustrated embodiment, the processing component adds the first resource information to the work queue, so that the work process or coroutine that processes the work queue reads the first resource information therefrom and calls the first interface. The work process or coroutine can be shared among multiple resource synchronizers. In this way, the resource information submitted by each resource synchronizer is stored and processed in sequence.

[0068] It can be understood that the first interface is the unified interface provided by the storage layer described above. Specifically, in a typical case, the first interface called by the resource synchronizer can be the Create interface, so that the first resource information is stored in the backend storage area. In the case where the first resource information involves the modification or deletion of the original resource, the first interface can also be an update interface or a delete interface.

[0069] In combination with the above description of the implementation of the storage layer, in step S45, the storage layer executes data operations on the first resource information in the backend storage area in response to the call to the first interface.

[0070] As mentioned above, the backend storage area can use different databases or different data engines to store several attribute fields of resource information. The data engine used is referred to as the target data engine, and the target data engine supports operation requests in the target format. In the typical case of storing the first resource information, in step S45, the storage layer sends a storage request in the target format to the target data engine, and the storage request contains field values ​​corresponding to at least some of the several attribute fields extracted based on the first resource information.

[0071] More specifically, in one example, the target data engine uses an index to store and retrieve documents, such as the Elastic Search data engine. In this regard, the storage layer pre-creates a target index in the target data engine for storing resource information. The target index defines the above-mentioned several attribute fields, such as Figure 2 In this case, the storage request is, for example, a PUT request, which includes the target index index to indicate writing data to the target index.

[0072] In the case of update operations, delete operations, etc., the storage layer sends corresponding data operation requests to the target data engine accordingly to implement data operations through the target data engine.

[0073] In this way, resource information in any first cluster is synchronously stored in the backend storage area through the first resource synchronizer corresponding to the first cluster. The backend storage area thus stores the latest resource status of multiple clusters. Based on the stored multi-cluster resource information, a multi-cluster resource retrieval capability can be provided. The resource retrieval process is described below.

[0074] like Figure 1As shown, the management system may include a retrieval module for resource retrieval. In addition, a search bar or other search page may be designed and arranged in the front-end interface of the management system. Users (administrators, cluster resource users, or other inquirers) may search for resources through DSL (domain-specific language) in the search bar. The DSL may be designed to be very user-friendly and intuitive, for example, simply listing multiple search conditions, with the search conditions separated by specific symbols (such as commas). For example, when a user wants to retrieve resources with apiVersion v1 and name test1, the following query request may be directly entered: apiVersion=v1, name=test1. It can be understood that the query request is the user's original query request, which includes several fields of resource information as query conditions.

[0075] The front-end interface calls the search module in response to the user's query operation and passes the user's original query request to the search module. The search module then calls the second interface for querying provided by the storage layer according to the user's original query request (including several query conditions). The storage layer queries the back-end storage area in response to the call of the second interface and returns the target resource information that meets the query conditions.

[0076] In one embodiment, the storage layer provides not only interfaces for CRUD operations (Create, Get, Update, Delete interfaces), but also an interface Search for query or retrieval. In a specific example, the interface is defined as:

[0077] type SearchStorage interface{

[0078] Search(ctx context.Context,queries string)(*SearchResult,error)

[0079] }

[0080] Among them, queries is the input parameter passed in when calling the interface, which specifies the query conditions; the SerachResult part is used to fill in the return value.

[0081] In a specific example, the search module formats the original query request of the user and fills it into the above-mentioned queries input parameter field, thereby calling the Search interface.

[0082] In response to the Search interface being called, the storage layer extracts the fields in the query conditions from queries, and generates a converted query request that meets the requirements of the target data engine in the backend storage area. In other words, the storage layer formats the query conditions in the original query request and converts it into a query request that meets the target format, which is the format required by the target data engine.

[0083] Continuing with the previous Elastic Search data engine example, for the user's original query request: apiVersion = v1, name = test1, the storage layer converts it into the following conversion query request and sends it to the ES data engine:

[0084]

[0085] Such a converted query request contains the fields specified by the original query conditions (apiVersion=v1, name=test1) and meets the language and format requirements of the ES data engine. The ES data engine then queries the backend storage area and returns the query results to the storage layer. The storage layer uses this query result to fill the aforementioned Search Result field, and then returns the query results to the retrieval module that calls the second interface. The retrieval module organizes the query results and displays them to the user through the front-end interface.

[0086] In this way, through the conversion of the retrieval module and the storage layer, users only need to enter simple and intuitive query conditions to obtain query results for resources in multiple clusters, thereby quickly obtaining the status of resources in the cluster.

[0087] According to some implementations, the management system also provides an insight module to provide users with a more comprehensive and integrated resource information display. Accordingly, in these implementations, the management system's management process of cluster resources may also include the insight module obtaining resource comprehensive information by analyzing or counting the resources in the cluster; and the front-end interface displays the above resource comprehensive information.

[0088] The comprehensive resource information obtained through analysis by the insight module may include the following categories: single resource insight information, aggregate resource insight information, and cluster resource insight information.

[0089] Single resource insight information includes comprehensive information about a single resource obtained by analyzing, diagnosing, and mining a single resource, which may include a resource overview, relationship diagram, question list, score, etc.

[0090] The resource overview shows the key basic information of the resource. This information can be read directly from the backend storage area by the insight module through the storage layer. This information can include the cluster to which the resource belongs, name, type, creation time, etc. Through the resource overview, users can quickly understand the overall situation of the resource and better manage the resources.

[0091] The relationship diagram shows the dependency between resources. For example, for pod, the relationship between Deployment->ReplicaSet->Pod can be shown. For the target resource whose relationship diagram is to be analyzed, the insight module can obtain the field content of the specific attribute field of the target resource from the backend storage area (through the storage layer). The specific attribute field is used to record the upstream and downstream dependency of the resource. Then, based on the field content of the specific field, the insight module can determine the relationship between the target resource and other resources and classify it into the comprehensive information of the single resource.

[0092] Specifically, in a k8s cluster, resource metadata contains an existing field called ownerReference, which is used to record the reference relationship between resource owners. When synchronizing resources, the resource synchronizer will write this field to the corresponding field in the backend storage area as is. In addition, during resource synchronization, you can also select a label according to the definition in the labelselector in the configuration information, and read a direct reference to the resource. The resource synchronizer will write this information into the annotate field of the resource metadata and store it in the backend storage area.

[0093] For example, if resource A selects a group of resources whose label contains app=pod through labelSelector, the annotation of resource A will contain the following label information:

[0094] annotations:

[0095] example.com / selector:"{groupVersion=v1.pods,labelSelector=app=pod"}

[0096] If resource A directly references the pod of namespace-b / name-b, the annotation of resource A will contain the following label information:

[0097] annotations:

[0098] example.com / selector:"{groupVersion=v1.pods,directRef=namespace-b / name-b"}

[0099] Therefore, by reading the ownerReference and annotation fields of the target resource metadata, the upstream and downstream dependencies of the target resource can be obtained, and its association with other resources can be obtained. In this way, the association graph of a single resource can be obtained.

[0100] The problem list of a single resource is the result of scanning the resource using some existing tools. In these results, the problems can be divided into four levels: severe, high, medium, and low according to the severity of the problem, so that users can better understand the health of the resources they use. These problem lists can help users discover and solve potential problems in a timely manner, thereby improving the stability and reliability of the cluster.

[0101] The score of a single resource can be a quantitative score determined based on the number of problems in the problem list and the severity of each problem. In a specific example, corresponding deduction scores, such as 5, 3, 2, and 1, can be defined for problems at four levels: severe, high, medium, and low. For example, warning is a minor problem, and a single warning is deducted 1 point; error is a high-level problem, and a single error is deducted 3 points, and so on. Thus, based on the predetermined total score (for example, 100), the number of problems, and the severity of each problem, the score of a single resource can be calculated. The score intuitively reflects the overall health of the single resource. The higher the score, the fewer problems the resource has and the healthier it is.

[0102] Aggregate resource insight information is the data summary or statistical information of the search results obtained based on specific search conditions. This information supports cross-resource statistics. For example, the search result statistics for Deployment resources can show how many Deployments are retrieved, how many clusters are spanned, etc. Click a specific resource to jump to the insight information display page for a single resource.

[0103] Cluster resource insight information can include basic information overview of the cluster, status information, problem list, cluster score, etc. The basic information overview of the cluster shows the main information of the cluster, including joining time, cluster version, number of nodes, health status, etc. The cluster status information shows the current status of the cluster, including CPU, memory usage, and the proportion of healthy pods.

[0104] The cluster problem list is a list of problems obtained by using some scanning tools to detect and scan the cluster (for example, CISBenchmark detection and CVE vulnerability scanning), which may include the problems and severity of each resource in the cluster. According to the severity of the problem of each resource, a score level can be assigned to each resource. For example, according to the severity of the problem, the resources are divided into S / A / B / C / D, and the scores are assigned 5 / 3 / 2 / 1 / 0 in turn. The smaller the score, the more serious the problem. Therefore, the cluster health score can be determined based on the total number of resources in the cluster and the score level of each resource. Specifically, the final cluster score can be determined as 100*(the sum of the scores of all resources in the cluster / the highest score that can be obtained). For example, a cluster has 3000 resources, including 1000 S, 1000 A, and 1000 C. The final cluster score is 100*(1000*5+1000*3+1000*1) / (3000*5)=60. This score directly reflects the overall health of the cluster. The higher the score, the fewer problems the cluster has and the healthier it is. Of course, based on the above concept, other similar resource level division methods and cluster scoring methods can also be used to obtain the cluster health score, which are not listed here one by one.

[0105] The single resource insight information, aggregated resource insight information, and cluster resource insight information summarized by the above insight modules can be displayed on the front-end interface in various graphical / chart forms, so that users can quickly and intuitively obtain the overall information of cluster resources.

[0106] Looking back at the overall process above, the management system for multi-cluster management synchronizes resource information in multiple clusters in real time through dynamically created resource synchronizers, thereby maintaining the latest resource status. Based on the real-time and accurate resource status, the management system can also provide cross-cluster search and insight functions, quickly and accurately search for resource data in multiple clusters, and integrate and analyze the data. In this way, efficient management of multiple clusters can be achieved.

[0107] According to an embodiment of another aspect, a management system for performing multi-cluster management is provided. Figure 5 FIG. 1 is a schematic diagram showing the logical structure of a management system according to an embodiment. It is understood that the management system can be implemented by any device, platform or device cluster with data storage, computing and processing capabilities. Figure 5 As shown, the management system 500 includes at least a resource manager 51 and a storage layer 53, wherein:

[0108] The resource manager 51 is configured to start a first resource synchronizer 52 for a first cluster, wherein the first cluster is one of several clusters that have registered with the management system;

[0109] The monitoring component in the first resource synchronizer 52 is configured to obtain first resource information of a first resource in the first cluster; wherein the first resource is a resource specified in the first configuration information set for the first cluster;

[0110] The processing component in the first resource synchronizer 52 is configured to call a first interface provided by the storage layer based on the first resource information;

[0111] The storage layer 53 is configured to perform data operations on the first resource information in the backend storage area in response to the call of the first interface.

[0112] For examples of specific implementations of the management system 500, please refer to the examples and descriptions of the aforementioned combined management method, which will not be repeated here.

[0113] According to another aspect of the embodiment, there is also provided a computer-readable storage medium on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the aforementioned management method.

[0114] According to yet another embodiment, a computer program product is provided, comprising a computer program / instruction, which implements the aforementioned management method when executed by a processor.

[0115] According to yet another embodiment, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the aforementioned management method is implemented.

[0116] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, firmware or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0117] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. A multi-cluster management method, executed by a management system, the management system comprising a resource manager and a storage layer; the method comprising: A listening component in a first resource synchronizer obtains first resource information of a first resource in a first cluster; wherein the first cluster is one of several clusters that have been registered with the management system, the first resource synchronizer is started by the resource manager for the first cluster, and the first resource is a resource specified in first configuration information set for the first cluster; The processing component in the first resource synchronizer calls a first interface provided by the storage layer based on the first resource information; The storage layer executes data operations on the first resource information in the backend storage area in response to the call of the first interface.

2. The method according to claim 1, wherein: The management system further includes a front-end interface; before obtaining the first resource information of the first resource in the first cluster, the method further includes: The front-end interface receives the first registration information of the first cluster and the first configuration information; The resource manager starts the first resource synchronizer according to the first configuration information.

3. The method according to claim 2, wherein: The management system also includes a multi-cluster proxy component; The first registration information includes the server address and identity certificate of the first cluster; The method further comprises: The front-end interface sends the first registration information to the multi-cluster proxy component; The multi-cluster proxy component establishes a connection with the first cluster according to the first registration information.

4. The method according to claim 3, wherein: Obtaining first resource information of a first resource in a first cluster includes: The monitoring component monitors the resources in the first cluster through the multi-cluster proxy component to obtain the first resource information.

5. The method according to claim 1, wherein: The resource manager and the first resource synchronizer are located in the same process of the device where the management system is located, and the first resource synchronizer is executed through a thread in the process.

6. The method according to claim 1, wherein: The first resource synchronizer is deployed in the first cluster.

7. The method according to claim 1, wherein: The first configuration information also includes a rule for intercepting resource information; calling a first interface provided by the storage layer based on the first resource information includes: The processing component intercepts and processes the first resource information according to the interception rule; The first interface is called using the intercepted first resource information.

8. The method according to claim 1, wherein: The calling a first interface provided by the storage layer based on the first resource information includes: The processing component calculates a first hash value of the first resource information; It is determined whether the first Hash value is stored in the local cache. If it is determined that the first Hash value is not stored in the local cache, the first interface is called and the first Hash value is stored in the local cache.

9. The method according to claim 1, wherein: Calling a first interface provided by the storage layer based on the first resource information includes: The processing component adds the first resource information to a work queue, so that a target process or coroutine that processes the work queue reads the first resource information therefrom and calls the first interface.

10. The method according to claim 1, wherein: The backend storage area uses a target data engine to store several attribute fields of resource information, and the target data engine supports operation requests in a target format; Performing data operations on the first resource information in the backend storage area includes: The storage layer sends a storage request in the target format to the target data engine, wherein the storage request includes field values ​​corresponding to at least part of the plurality of attribute fields extracted based on the first resource information.

11. The method according to claim 10, wherein: The target data engine uses indexes to store and retrieve documents; the storage layer pre-creates a target index for storing resource information in the target data engine, and the target index defines the several attribute fields; the storage request also includes the target index to indicate that data is written to the target index.

12. The method according to claim 1, wherein: The management system further includes a retrieval module; the method further includes: The retrieval module calls the second interface provided by the storage layer according to the first query request of the user; the first query request includes several fields of resource information as query conditions; The storage layer queries the backend storage area in response to the call of the second interface, and returns target resource information that meets the query condition.

13. The method according to claim 12, wherein: The backend storage area uses a target data engine to store several attribute fields of resource information, and the target data engine supports operation requests in a target format; Querying the backend storage area includes: The storage layer sends a second query request in the target format to the target data engine, where the second query request includes the plurality of fields.

14. The method according to claim 1, wherein: The management system further includes an insight module and a front-end interface, and the method further includes: The insight module obtains comprehensive resource information by analyzing or counting the resources in the plurality of clusters; The front-end interface displays the comprehensive resource information.

15. The method according to claim 14, wherein: Get a comprehensive list of resources, including: The field content of the target attribute field of the second resource in the first cluster is obtained from the backend storage area through the storage layer, and the association relationship between the second resource and other resources is determined according to the field content and included in the resource comprehensive information, wherein the target attribute field records the upstream and downstream dependencies of the resources.

16. The method according to claim 15, wherein: The field content of the target attribute field is filled in by the processing component according to the second resource information and the first configuration information, and the second resource information is the resource information monitored by the monitoring component for the second resource.

17. The method according to claim 14, wherein: Get a comprehensive list of resources, including: Get a list of issues related to the target resource; According to the number of problems in the problem list and the severity of each problem, a first score of the health of the target resource is determined and included in the resource comprehensive information.

18. The method according to claim 14, wherein: Get a comprehensive list of resources, including: Get the health score of each resource in the target cluster; According to the number of resources in the target cluster and the score level of each resource, a second score of the health of the target cluster is determined and included in the resource comprehensive information.

19. The method according to claim 14, wherein: The resource comprehensive information includes one or more of the following: basic information of a single resource, a list of questions about a single resource, statistical information of resource search results, basic information of a cluster, and status information of a cluster.

20. A management system for multi-cluster management, the management system comprising a resource manager and a storage layer; wherein: The resource manager is configured to start a first resource synchronizer for a first cluster, wherein the first cluster is one of several clusters that have registered with the management system; The monitoring component in the first resource synchronizer is configured to obtain first resource information of a first resource in the first cluster; wherein the first resource is a resource specified in the first configuration information set for the first cluster; The processing component in the first resource synchronizer is configured to call a first interface provided by the storage layer based on the first resource information; The storage layer is configured to perform data operations on the first resource information in a backend storage area in response to a call of the first interface.

21. A computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 19.

22. A computing device comprising a memory and a processor, characterized in that: The memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 19 is implemented.

Citation Information

Cited By

  • Synchronous configuration method and device for configuration management data, equipment and storage medium

    CN120768908A