Cluster resource scheduling method, device, computer equipment and storage medium
By obtaining the scheduling resource package information of the main cluster and generating the distribution scheduling resource package, the problem of KubeFed technology being unable to configure the overall resource chart package for multiple Kubernetes clusters is solved, and efficient scheduling of multi-cluster resources is achieved.
Patent Information
- Application Number
- CN202310826202.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-06
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2043-07-06
AI Technical Summary
The existing KubeFed technology can only schedule and configure a single native resource in multiple Kubernetes clusters, and cannot configure the integrated resource Chart package as a whole, resulting in low multi-cluster resource scheduling efficiency.
By obtaining the scheduling resource package information of the master cluster, generating the distribution scheduling resource package of the slave cluster, and assigning it to each slave cluster, the distribution and configuration of the integrated resource chart package is realized, avoiding the scheduling and configuration of only native resources.
The efficiency of multi-cluster resource scheduling is improved, allowing the server to directly distribute and configure integrated resource chart packages, improving the overall resource scheduling efficiency.
Smart Images

Figure CN116800819B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data technology, and in particular to a cluster resource scheduling method, apparatus, computer equipment and storage medium. Background Art
[0002] To deploy an application in a Kubernetes cluster, users often need to deploy a variety of Kubernetes native resources, such as Deployment (API for managing release controllers), Service (logical grouping) or Configmap (resource object), etc. However, the YAML files (Yet Another Markup Language) of these different resources are very scattered and inconvenient to manage. Technicians use Helm technology to organize various Kubernetes resources into an integrated resource Chart package, so as to implement the installation, uninstallation, and upgrade of applications in the Kubernetes cluster through the Chart package. Therefore, Helm technology has become the standard technology for Kubernetes application management.
[0003] When multiple clusters need to deploy applications at the same time, they need to be uniformly scheduled and configured. In related technologies, the integrated resource Chart packages corresponding to the application resources of multiple Kubernetes clusters are usually decomposed through KubeFed technology, and each native resource in the Chart package is scheduled and configured in each cluster respectively. However, due to the technical limitations of KubeFed technology, this method can only schedule and configure a single native resource, and cannot configure the integrated resource Chart package as a whole, resulting in low resource scheduling efficiency for multiple clusters. Summary of the invention
[0004] Based on this, it is necessary to provide a cluster resource scheduling method, apparatus, computer equipment, computer readable storage medium and computer program product to address the above technical issues.
[0005] In a first aspect, the present application provides a cluster resource scheduling method. The method comprises:
[0006] Obtaining scheduling resource package information of the master cluster; the scheduling resource package includes application resource package information corresponding to application information of each slave cluster, and cluster configuration information of application information of each slave cluster;
[0007] Based on the scheduling resource information of the master cluster, the distribution scheduling resource package information of each slave cluster is generated, and each distribution scheduling resource package information is respectively distributed to the slave cluster corresponding to each distribution scheduling resource package information; the distribution scheduling resource package information is used to establish the application information of the slave cluster.
[0008] Optionally, the generating the distribution scheduling resource package information of each of the slave clusters based on the scheduling resource information of the master cluster includes:
[0009] Parse the scheduling resource information of the master cluster to obtain the application resource package information and the cluster configuration information, wherein the cluster configuration information includes cluster location information of the application resource package information in each slave cluster, difference configuration information of the application resource package in each slave cluster, and application resource configuration information of the application resource package, and generate first distribution scheduling resource package information based on the application resource package information and the application resource configuration information of the application resource package;
[0010] For each slave cluster, based on the differential configuration information of the application resource package in the slave cluster, the first distribution scheduling resource package information is adjusted to obtain the second distribution scheduling resource package information of the slave cluster, and the second distribution scheduling resource package information is marked with the cluster location information of the application resource package information in the slave cluster to obtain the distribution scheduling resource package information of the slave cluster.
[0011] Optionally, after allocating each of the distribution scheduling resource package information to a slave cluster corresponding to each of the distribution scheduling resource package information, the method further includes:
[0012] Acquire application status information of application information of each slave cluster from each slave cluster respectively;
[0013] If the application status information of the slave cluster meets a condition for deleting the application information of the slave cluster, deleting the application information of the slave cluster;
[0014] When the application status information of the slave cluster meets the condition for updating the application information of the slave cluster, the application information of the slave cluster is updated by applying a resource update policy.
[0015] Optionally, when the application status information of the slave cluster meets a condition for deleting the application information of the slave cluster, deleting the application information of the slave cluster includes:
[0016] An application resource deletion instruction is generated, and the application resource deletion instruction is transmitted to the slave cluster whose application information needs to be deleted; the application resource deletion instruction is used to indicate the application information of the slave cluster whose application information needs to be deleted.
[0017] Optionally, when the application status information of the slave cluster meets the condition for updating the application information of the slave cluster, updating the application information of the slave cluster by applying a resource update policy includes:
[0018] For each slave cluster that meets the conditions for updating the application information of the slave cluster, based on the application status information of the slave cluster, the update scheduling resource package information of the slave cluster is generated, and the update scheduling resource package information is distributed to the slave cluster; the update scheduling resource package information includes application resource update information, and the application resource update information is used to update the application information of the slave cluster to obtain new application information of the slave cluster.
[0019] In a second aspect, the present application provides a cluster resource scheduling method. The method comprises:
[0020] Receiving distribution scheduling resource package information sent by the main cluster; the distribution scheduling resource package is generated for the scheduling resource information of the main cluster;
[0021] Parsing the distribution scheduling resource package information to obtain application resource configuration information of the slave cluster and application resource package information of the slave cluster; the application resource package information includes a plurality of initial application resource data, and the application resource configuration information includes a configuration value of each of the initial application resource data;
[0022] Based on the application resource configuration information, the configuration value of each initial application resource data is configured respectively to obtain each application resource data, and all the application resource data are used as the application information of the slave cluster.
[0023] In a third aspect, the present application also provides a cluster resource scheduling device. The device includes:
[0024] An acquisition module, used to acquire the scheduling resource package information of the master cluster; the scheduling resource package includes application resource package information corresponding to the application information of each slave cluster, and cluster configuration information of the application information of each slave cluster;
[0025] A generation module is used to generate distribution scheduling resource package information of each slave cluster based on the scheduling resource information of the main cluster, and distribute each distribution scheduling resource package information to the slave cluster corresponding to each distribution scheduling resource package information; the distribution scheduling resource package information is used to establish application information of the slave cluster.
[0026] Optionally, the generating module is specifically used for:
[0027] Parse the scheduling resource information of the master cluster to obtain the application resource package information and the cluster configuration information, wherein the cluster configuration information includes cluster location information of the application resource package information in each slave cluster, difference configuration information of the application resource package in each slave cluster, and application resource configuration information of the application resource package, and generate first distribution scheduling resource package information based on the application resource package information and the application resource configuration information of the application resource package;
[0028] For each slave cluster, based on the differential configuration information of the application resource package in the slave cluster, the first distribution scheduling resource package information is adjusted to obtain the second distribution scheduling resource package information of the slave cluster, and the second distribution scheduling resource package information is marked with the cluster location information of the application resource package information in the slave cluster to obtain the distribution scheduling resource package information of the slave cluster.
[0029] Optionally, the device further comprises:
[0030] A status acquisition module, used for acquiring application status information of application information of each slave cluster from each slave cluster respectively;
[0031] A deleting module, configured to delete the application information of the slave cluster if the application status information of the slave cluster meets a condition for deleting the application information of the slave cluster;
[0032] The updating module is used to update the application information of the slave cluster by applying a resource update strategy when the application status information of the slave cluster meets the condition for updating the application information of the slave cluster.
[0033] Optionally, the deletion module is specifically used to:
[0034] An application resource deletion instruction is generated, and the application resource deletion instruction is transmitted to the slave cluster whose application information needs to be deleted; the application resource deletion instruction is used to indicate the application information of the slave cluster whose application information needs to be deleted.
[0035] Optionally, the update module is specifically used to:
[0036] For each slave cluster that meets the conditions for updating the application information of the slave cluster, based on the application status information of the slave cluster, the update scheduling resource package information of the slave cluster is generated, and the update scheduling resource package information is distributed to the slave cluster; the update scheduling resource package information includes application resource update information, and the application resource update information is used to update the application information of the slave cluster to obtain new application information of the slave cluster.
[0037] In a fourth aspect, the present application further provides a cluster resource scheduling device. The device comprises:
[0038] A receiving module, used to receive the distribution scheduling resource package information sent by the main cluster; the distribution scheduling resource package is generated for the scheduling resource information of the main cluster;
[0039] A parsing module, used to parse the distribution scheduling resource package information to obtain application resource configuration information of the slave cluster and application resource package information of the slave cluster; the application resource package information includes a plurality of initial application resource data, and the application resource configuration information includes a configuration value of each of the initial application resource data;
[0040] The configuration module is used to configure the configuration value of each initial application resource data based on the application resource configuration information, obtain each application resource data, and use all the application resource data as the application information of the slave cluster.
[0041] In a fifth aspect, the present application further provides a cluster resource scheduling system, characterized in that the system comprises a resource master scheduling unit and a resource slave scheduling unit:
[0042] The resource master scheduling unit is arranged in the master cluster, the resource slave scheduling unit is arranged in the master cluster and each slave cluster, and the resource slave scheduling units arranged in the master cluster and each slave cluster are communicatively connected;
[0043] The resource master scheduling unit is used to generate scheduling resource package information of the master cluster, and generate distribution scheduling resource package information of each slave cluster based on the scheduling resource information of the master cluster;
[0044] The resource slave scheduling unit is used to distribute each of the distribution scheduling resource package information to the slave clusters corresponding to each of the distribution scheduling resource package information, and receive the distribution scheduling resource package information sent by the main cluster; parse the distribution scheduling resource package information to obtain the application resource configuration information of the slave cluster and the application resource package information of the slave cluster; the application resource package information includes multiple initial application resource data, and the application resource configuration information includes the configuration value of each of the initial application resource data; based on the application resource configuration information, respectively configure the configuration value of each initial application resource data to obtain each application resource data, and use all the application resource data as the application information of the slave cluster.
[0045] In a sixth aspect, the present application provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method described in any one of the first aspect or the second aspect are implemented.
[0046] In a seventh aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the method described in any one of the first aspect or the second aspect are implemented.
[0047] In an eighth aspect, the present application provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the method described in any one of the first aspect or the second aspect are implemented.
[0048] The above-mentioned cluster resource scheduling method, device, computer equipment and storage medium obtain the scheduling resource package information of the main cluster; the scheduling resource package contains the application resource package information corresponding to the application information of each slave cluster, and the cluster configuration information of the application information of each slave cluster; based on the scheduling resource information of the main cluster, the distribution scheduling resource package information of each slave cluster is generated, and each distribution scheduling resource package information is respectively distributed to the slave cluster corresponding to each distribution scheduling resource package information; the distribution scheduling resource package information is used to establish the application information of the slave cluster. On the main cluster side, the distribution scheduling resource package information of each slave cluster is generated through the scheduling resource package information of the main cluster containing the application resource package information corresponding to the application information of each slave cluster and the cluster configuration information of the application information of each slave cluster, and then each distribution scheduling resource package information is sent to each slave cluster respectively, and then, on the slave cluster side, based on the distribution scheduling resource package information, the application information of the slave cluster is established, so that the server directly distributes and configures the integrated resource chart package, avoiding the process of scheduling and configuring only the native resource, thereby improving the resource scheduling efficiency of multiple clusters. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 A schematic diagram of a flow chart of a cluster resource scheduling method in an embodiment;
[0050] Figure 2 A schematic diagram of the contents of generating the distribution scheduling resource package information of each slave cluster in an embodiment;
[0051] Figure 3 A schematic diagram of a structure for allocating information of distribution scheduling resource packages in one embodiment;
[0052] Figure 4 A schematic diagram of a flow chart of a cluster resource scheduling method in another embodiment;
[0053] Figure 5 A schematic diagram of the structure of a cluster resource scheduling system in one embodiment;
[0054] Figure 6 A schematic diagram of a process flow of a cluster resource scheduling example in an embodiment;
[0055] Figure 7 It is a structural block diagram of a cluster resource scheduling device in one embodiment;
[0056] Figure 8 It is a structural block diagram of a cluster resource scheduling device in another embodiment;
[0057] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0059] The cluster resource scheduling method provided in the embodiment of the present application is applied to the server of the cluster resource scheduling system in the federal Kubernetes (K8s) cluster environment. The system includes a resource master scheduling unit 501 arranged in the main cluster, a resource slave scheduling unit 502 arranged in the main cluster, and a resource slave scheduling unit 502 arranged in the slave cluster, and a communication connection is arranged between the resource slave scheduling units 502 arranged in the main cluster and each slave cluster. The server can be implemented with an independent server or a server cluster composed of multiple servers. Among them, the server generates the distribution scheduling resource package information of each slave cluster on the main cluster side through the scheduling resource package information of the main cluster containing the application information corresponding to each slave cluster, and the cluster configuration information of the application information of each slave cluster, and then sends each distribution scheduling resource package information to each slave cluster respectively, and then, on the slave cluster side, based on the distribution scheduling resource package information, establishes the application information of the slave cluster, so that the server directly distributes and configures the integrated resource chart package, avoiding the process of scheduling and configuring only the native resource, and improving the resource scheduling efficiency of multiple clusters.
[0060] In one embodiment, Figure 1 As shown, a cluster resource scheduling method is provided, which is described by taking the method applied to a server as an example, and includes the following steps:
[0061] Step S101, obtaining scheduling resource package information of the main cluster.
[0062] The scheduling resource package includes application resource package information corresponding to the application information of each slave cluster and cluster configuration information of the application information of each slave cluster.
[0063] In this embodiment, the server responds to the user's multi-cluster resource scheduling operation, obtains the federated cluster that needs to be scheduled, and then the server selects the cluster corresponding to the root node in the federated cluster as the main cluster, and uses each cluster except the main cluster as a slave cluster. Among them, the cluster is a Kubernetes (K8s) cluster. Secondly, based on the user's multi-cluster resource scheduling operation, the server obtains the integrated resource chart package that needs to be scheduled and the configuration information of the integrated resource chart package, and obtains the scheduling resource package information. Among them, the integrated resource chart package is a resource group of native resources that need to be scheduled for the cluster integrated by the Helm cluster resource scheduling technology. Then, the server sets the resource master scheduling unit in the main cluster, and sets the resource slave scheduling unit in the main cluster and each slave cluster. Among them, the resource master scheduling unit is a FedRelease-controller-manager established based on the custom resource extension strategy CustomResourceDefinition (abbreviated as CRD), and the resource slave scheduling unit is a HelmRelease-controller-manager established based on the custom resource extension strategy CustomResourceDefinition (abbreviated as CRD). The scheduling resource package information is FedReleaseCRD, which contains:
[0064] 1.Chart information. The chart package information required to create a helmrelease.
[0065] 2. Release information. Create the name (name), namespace (namespace), time (time) and other information of helmrelease.
[0066] 3. Values information: When creating a helmrelease, the values of the relevant configurations of the chart package according to user requirements.
[0067] 4.Placement information: The cluster location information for creating the helmrelease.
[0068] 5. Override information. Different configurations of helmrelease deployments in different clusters. The distribution scheduling resource package information is HelmReleaseCRD, which contains:
[0069] 1.Chart information. The chart package information required to create a helmrelease.
[0070] 2. Release information. Create the name (name), namespace (namespace), time (time) and other information of helmrelease.
[0071] 3. Values information: When creating a helmrelease, the values of the relevant configurations of the chart package according to user requirements.
[0072] Among them, helmrelease is the application information of each slave cluster.
[0073] Step S102: generating distribution scheduling resource package information of each slave cluster based on the scheduling resource information of the master cluster, and distributing each distribution scheduling resource package information to the slave cluster corresponding to each distribution scheduling resource package information.
[0074] The distribution scheduling resource package information is used to establish application information from the cluster.
[0075] In this embodiment, the server generates the distribution scheduling resource package information of each slave cluster based on the scheduling resource information of the master cluster through the resource master scheduling unit of the master cluster. Then, the server distributes each distribution scheduling resource package information to the slave clusters corresponding to each distribution scheduling resource package information through the resource slave scheduling unit of the master cluster. Specifically, Figure 2 As shown in the figure, the resource master scheduling unit of the main cluster generates the Chart information in HelmReleaseCRD based on the Chart information in FedReleaseCRD; generates the Release information in HelmReleaseCRD based on the Release information in FedReleaseCRD; and generates the Values information in HelmReleaseCRD based on the Values information in FedReleaseCRD combined with the Override information. Figure 3 As shown, the resource slave scheduling unit of the master cluster sends the distribution scheduling resource package information of each slave cluster to the resource slave scheduling unit of each slave cluster. The specific generation process will be described in detail later.
[0076] For each slave cluster, the server parses the distribution scheduling resource package information through the resource slave scheduling unit of the slave cluster, and determines the configuration information of each application resource data based on the parsed distribution scheduling resource package information to obtain the application information of the slave cluster. The specific establishment process will be described in detail later.
[0077] Based on the above scheme, on the main cluster side, the distribution scheduling resource package information of each slave cluster is generated through the scheduling resource package information of the main cluster that contains the application resource package information corresponding to the application information of each slave cluster, and the cluster configuration information of the application information of each slave cluster, and then each distribution scheduling resource package information is sent to each slave cluster respectively. Then, on the slave cluster side, based on the distribution scheduling resource package information, the application information of the slave cluster is established, so that the server directly distributes and configures the integrated resource chart package, avoiding the process of scheduling and configuring only the native resource, thereby improving the resource scheduling efficiency of multiple clusters.
[0078] Optionally, based on the scheduling resource information of the main cluster, the distribution scheduling resource package information of each slave cluster is generated, including: parsing the scheduling resource information of the main cluster to obtain application resource package information and cluster configuration information, the cluster configuration information includes cluster location information of the application resource package information in each slave cluster, differential configuration information of the application resource package in each slave cluster, and application resource configuration information of the application resource package, and generating first distribution scheduling resource package information based on the application resource package information and the application resource configuration information of the application resource package; for each slave cluster, based on the differential configuration information of the application resource package in the slave cluster, adjusting the first distribution scheduling resource package information to obtain second distribution scheduling resource package information of the slave cluster, and marking the second distribution scheduling resource package information with the cluster location information of the application resource package information in the slave cluster to obtain distribution scheduling resource package information of the slave cluster.
[0079] In this embodiment, the server parses the scheduling resource information of the main cluster to obtain the application resource package information (i.e., the Chart information in FedReleaseCRD), the cluster location information of the application resource package information in each slave cluster (i.e., the Placement information in FedReleaseCRD), the differential configuration information of the application resource package in each slave cluster (i.e., the Override information in FedReleaseCRD), and the application resource configuration information of the application resource package (i.e., the Values information in FedReleaseCRD). Then, the server uses the combination of the application resource package information and the application resource configuration information of the application resource package as the first distribution scheduling resource package information. Then, for each slave cluster, the server adjusts the application resource configuration information of the application resource package in the first distribution scheduling resource package information based on the differential configuration information of the application resource package in the slave cluster through the resource master scheduling unit of the main cluster, and obtains the second distribution scheduling resource package information of the slave cluster. Finally, the server marks the cluster location information of the application resource package information in the slave cluster to the second distribution scheduling resource package information, and obtains the distribution scheduling resource package information of the slave cluster.
[0080] Based on the above solution, by applying the differential configuration information of the resource package in the slave cluster, the distribution scheduling resource package information of each slave cluster is determined, thereby improving the data scheduling accuracy of each slave cluster.
[0081] Optionally, after each distribution scheduling resource package information is respectively allocated to the slave cluster corresponding to each distribution scheduling resource package information, it also includes: obtaining application status information of the application information of each slave cluster from each slave cluster through the resource master scheduling unit of the master cluster; when the application status information of the slave cluster meets the condition of deleting the application information of the slave cluster, deleting the application information of the slave cluster through the resource slave scheduling unit of the slave cluster; when the application status information of the slave cluster meets the condition of updating the application information of the slave cluster, updating the application information of the slave cluster through the application resource update strategy.
[0082] In this embodiment, after establishing the application information of each slave cluster, the server obtains the application status information of each slave cluster's application information from each slave cluster respectively through the resource master scheduling unit of the master cluster in real time. The application status information is the running status information of the application information in the slave cluster. Then, the server presets the conditions for deleting the application information of the slave cluster and the conditions for updating the application information of the slave cluster, and determines whether the application status information meets the conditions for deleting the application information of the slave cluster, or whether the application status information meets the conditions for updating the application information of the slave cluster. When the application status information of the slave cluster meets the conditions for deleting the application information of the slave cluster, the server deletes the application information of the slave cluster through the resource slave scheduling unit of the slave cluster. When the application status information of the slave cluster meets the conditions for updating the application information of the slave cluster, the server updates the application information of the slave cluster by applying the resource update policy. The specific process of deleting the application information and updating the application information will be described in detail later.
[0083] Based on the above solution, by detecting the application status information of each slave cluster, the application information of each slave cluster is adjusted to ensure that the application information of each slave cluster can run normally.
[0084] Optionally, when the application status information of the slave cluster meets the conditions for deleting the application information of the slave cluster, the application information of the slave cluster is deleted through the resource slave scheduling unit of the slave cluster, including: generating an application resource deletion instruction, and transmitting the application resource deletion instruction to the slave cluster where the application information needs to be deleted; the application resource deletion instruction is used to indicate the application information of the slave cluster where the application information needs to be deleted.
[0085] In this embodiment, the server generates an application resource deletion instruction through the master resource scheduling unit of the master cluster, and transmits the application resource deletion instruction to the slave cluster that needs to delete application information through the slave resource scheduling unit of the master cluster. Finally, the server deletes the application information of the slave cluster through the slave resource scheduling unit of the slave cluster that needs to delete application information.
[0086] Based on the above solution, by applying resource deletion instructions, the operation of deleting application information is uniformly executed on all slave clusters that need to delete application information, thereby improving the efficiency of deleting application information of each slave cluster.
[0087] Optionally, when the application status information of the slave cluster meets the conditions for updating the application information of the slave cluster, the application information of the slave cluster is updated by applying the resource update strategy, including: for each slave cluster that meets the conditions for updating the application information of the slave cluster, based on the application status information of the slave cluster, generating update scheduling resource package information of the slave cluster, and distributing the update scheduling resource package information to the slave cluster; the update scheduling resource package information includes application resource update information, and the application resource update information is used to update the application information of the slave cluster to obtain new application information of the slave cluster.
[0088] In this embodiment, for each slave cluster that meets the conditions for updating the application information of the slave cluster, the server generates the update scheduling resource package information of the slave cluster through the resource master scheduling unit of the master cluster based on the application status information of the slave cluster. The update scheduling resource package information is the integrated resource chart package information of the update configuration information of each application resource data. The server distributes the update scheduling resource package information to the slave cluster through the resource slave scheduling unit of the master cluster. Then, the server parses the application resource update information of the update scheduling resource package information through the resource slave scheduling unit of the slave cluster, and updates the application information of the slave cluster based on the update resource information to obtain the new application information of the slave cluster.
[0089] Based on the above scheme, the update scheduling resource package information of each slave cluster is generated respectively through the resource master scheduling unit of the main cluster and distributed to each slave cluster, so as to update the application information of the slave cluster. By directly distributing the configuration update of the integrated resource chart package of the updated configuration information, the process of separately configuring only the native resources of the updated configuration information of the slave cluster is avoided, thereby improving the update efficiency of the application information of multiple clusters.
[0090] In one embodiment, Figure 4 As shown, a cluster resource scheduling method is provided, which is described by taking the method applied to a server as an example, and includes the following steps:
[0091] Step S401: receiving the distribution scheduling resource package information sent by the main cluster.
[0092] The distribution scheduling resource package is generated based on the scheduling resource information of the main cluster.
[0093] In this embodiment, the server receives the distribution scheduling resource package information sent by the master cluster through the resource slave scheduling unit of the master cluster to the resource slave scheduling unit of each slave cluster.
[0094] Step S402, parse the distribution scheduling resource package information to obtain the application resource configuration information of the slave cluster and the application resource package information of the slave cluster.
[0095] The application resource package information includes a plurality of initial application resource data, and the application resource configuration information includes a configuration value of each initial application resource data.
[0096] In this embodiment, the server parses the distribution scheduling resource package information for each slave cluster through the resource slave scheduling unit of the slave cluster to obtain the application information of the slave cluster and the application resource package information of the slave cluster. The application resource package information includes multiple initial application resource data, and the application information includes the configuration value of each initial application resource data.
[0097] Step S403: Based on the application resource configuration information, respectively configure the configuration value of each initial application resource data to obtain each application resource data, and use all the application resource data as the application information of the slave cluster.
[0098] In this embodiment, the server configures the configuration value of each initial application resource data based on the application information to obtain each application resource data. Finally, the server configures the application information of the slave cluster corresponding to each application resource data.
[0099] Based on the above solution, the resource slave scheduling unit parses and distributes the scheduling resource package information from the cluster, and then configures the configuration value of each application resource data. While ensuring the accuracy of the scheduling resource configuration of the cluster, the resource scheduling efficiency of each cluster is improved at the same time.
[0100] In one embodiment, Figure 5 As shown, a cluster resource scheduling system is provided, and the method is applied to a server as an example for explanation, including the following steps:
[0101] The resource master scheduling unit 501 is set in the master cluster, and the resource slave scheduling unit 502 is set in the master cluster and each slave cluster, and the resource slave scheduling units 502 set in the master cluster and each slave cluster are communicated with each other; the resource master scheduling unit 501 is used to generate scheduling resource package information of the master cluster, and based on the scheduling resource information of the master cluster, generate distribution scheduling resource package information of each slave cluster; the resource slave scheduling unit 501 is used to distribute each distribution scheduling resource package information to the slave cluster corresponding to each distribution scheduling resource package information, and receive the distribution scheduling resource package information sent by the master cluster; parse the distribution scheduling resource package information to obtain the application resource configuration information of the slave cluster and the application resource package information of the slave cluster; the application resource package information includes multiple initial application resource data, and the application resource configuration information includes the configuration value of each initial application resource data; based on the application resource configuration information, configure the configuration value of each initial application resource data respectively to obtain each application resource data, and use all the application resource data as the application information of the slave cluster.
[0102] In this embodiment, a communication connection is set between the resource slave scheduling unit 502 of the master cluster and each slave cluster, and the resource master scheduling unit 501 is used to generate scheduling resource package information of the master cluster, and based on the scheduling resource information of the master cluster, generate distribution scheduling resource package information of each slave cluster; the resource slave scheduling unit 501 is used to distribute each distribution scheduling resource package information to the slave cluster corresponding to each distribution scheduling resource package information, and receive the distribution scheduling resource package information sent by the master cluster; parse the distribution scheduling resource package information to obtain application resource configuration information of the slave cluster and application resource package information of the slave cluster; the application resource package information includes multiple initial application resource data, and the application resource configuration information includes the configuration value of each initial application resource data; based on the application resource configuration information, the configuration value of each initial application resource data is configured respectively to obtain each application resource data, and all the application resource data are used as the application information of the slave cluster.
[0103] This application also provides a cluster resource scheduling example, such as Figure 6 As shown, the specific processing process includes the following steps:
[0104] Step S601: Obtain scheduling resource package information of the main cluster.
[0105] Step S602, parse the scheduling resource information of the main cluster to obtain application resource package information and cluster configuration information, the cluster configuration information includes cluster location information of the application resource package information in each slave cluster, difference configuration information of the application resource package in each slave cluster, and application resource configuration information of the application resource package, and based on the application resource package information and the application resource configuration information of the application resource package, generate the first distribution scheduling resource package information.
[0106] Step S603, for each slave cluster, based on the difference configuration information of the application resource package in the slave cluster, adjust the first distribution scheduling resource package information to obtain the second distribution scheduling resource package information of the slave cluster, and mark the cluster location information of the application resource package information in the slave cluster on the second distribution scheduling resource package information to obtain the distribution scheduling resource package information of the slave cluster.
[0107] Step S604: distribute each distribution scheduling resource package information to the slave cluster corresponding to each distribution scheduling resource package information.
[0108] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0109] Based on the same inventive concept, the embodiment of the present application also provides a cluster resource scheduling device for implementing the cluster resource scheduling method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more cluster resource scheduling device embodiments provided below can refer to the limitations of the cluster resource scheduling method above, and will not be repeated here.
[0110] In one embodiment, Figure 7 As shown, a cluster resource scheduling device is provided, including: an acquisition module 710 and a generation module 720, wherein:
[0111] The acquisition module 710 is used to acquire the scheduling resource package information of the master cluster; the scheduling resource package includes the application resource package information corresponding to the application information of each slave cluster, and the cluster configuration information of the application information of each slave cluster;
[0112] Generation module 720 is used to generate distribution scheduling resource package information of each slave cluster based on the scheduling resource information of the main cluster, and distribute each distribution scheduling resource package information to the slave cluster corresponding to each distribution scheduling resource package information; the distribution scheduling resource package information is used to establish application information of the slave cluster.
[0113] Optionally, the generating module 720 is specifically configured to:
[0114] Parse the scheduling resource information of the master cluster to obtain the application resource package information and the cluster configuration information, wherein the cluster configuration information includes cluster location information of the application resource package information in each slave cluster, difference configuration information of the application resource package in each slave cluster, and application resource configuration information of the application resource package, and generate first distribution scheduling resource package information based on the application resource package information and the application resource configuration information of the application resource package;
[0115] For each slave cluster, based on the differential configuration information of the application resource package in the slave cluster, the first distribution scheduling resource package information is adjusted to obtain the second distribution scheduling resource package information of the slave cluster, and the second distribution scheduling resource package information is marked with the cluster location information of the application resource package information in the slave cluster to obtain the distribution scheduling resource package information of the slave cluster.
[0116] Optionally, the device further comprises:
[0117] A status acquisition module, used for acquiring application status information of application information of each slave cluster from each slave cluster respectively;
[0118] A deleting module, configured to delete the application information of the slave cluster if the application status information of the slave cluster meets a condition for deleting the application information of the slave cluster;
[0119] The updating module is used to update the application information of the slave cluster by applying a resource update strategy when the application status information of the slave cluster meets the condition for updating the application information of the slave cluster.
[0120] Optionally, the deletion module is specifically used to:
[0121] An application resource deletion instruction is generated, and the application resource deletion instruction is transmitted to the slave cluster whose application information needs to be deleted; the application resource deletion instruction is used to indicate the application information of the slave cluster whose application information needs to be deleted.
[0122] Optionally, the update module is specifically used to:
[0123] For each slave cluster that meets the conditions for updating the application information of the slave cluster, based on the application status information of the slave cluster, the update scheduling resource package information of the slave cluster is generated, and the update scheduling resource package information is distributed to the slave cluster; the update scheduling resource package information includes application resource update information, and the application resource update information is used to update the application information of the slave cluster to obtain new application information of the slave cluster.
[0124] Based on the same inventive concept, the embodiment of the present application also provides a cluster resource scheduling device for implementing the cluster resource scheduling method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more cluster resource scheduling device embodiments provided below can refer to the limitations of the cluster resource scheduling method above, and will not be repeated here.
[0125] In one embodiment, Figure 8 As shown, a cluster resource scheduling device is provided, including: a receiving module 810, a parsing module 820 and a configuration module 830, wherein:
[0126] The receiving module 810 is used to receive the distribution scheduling resource package information sent by the main cluster; the distribution scheduling resource package is generated for the scheduling resource information of the main cluster;
[0127] The parsing module 820 is used to parse the distribution scheduling resource package information to obtain the application resource configuration information of the slave cluster and the application resource package information of the slave cluster; the application resource package information includes a plurality of initial application resource data, and the application resource configuration information includes the configuration value of each of the initial application resource data;
[0128] The configuration module 830 is used to configure the configuration value of each initial application resource data based on the application resource configuration information, obtain each application resource data, and use all the application resource data as the application information of the slave cluster.
[0129] Each module in the above cluster resource scheduling device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0130] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig. 9As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external server in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a cluster resource scheduling method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, a trackball or a touch pad set on the computer device housing, or an external keyboard, touch pad or mouse, etc.
[0131] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0132] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, steps of the method described in any one of the first aspect or the second aspect are implemented.
[0133] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in any one of the first aspect or the second aspect are implemented.
[0134] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the steps of the method described in any one of the first aspect or the second aspect. It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0135] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0136] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0137] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A cluster resource scheduling method, characterized in that: The method comprises: Obtain the scheduling resource package information of the main cluster; the scheduling resource package includes application resource package information corresponding to the application information of each slave cluster, and cluster configuration information of the application information of each slave cluster; the main cluster is provided with a resource master scheduling unit, and the main cluster and each slave cluster are provided with a resource slave scheduling unit; wherein the resource master scheduling unit is a FedRelease-controller-manager established based on a custom resource extension strategy CRD, and the resource slave scheduling unit is a HelmRelease-controller-manager established based on the custom resource extension strategy CRD; the scheduling resource package information is FedReleaseCRD, and the FedReleaseCRD includes Chart information, Release information, Values information, Placement information, and Override information; the distribution scheduling resource package information is HelmReleaseCRD, and the HelmReleaseCRD includes Chart information, Release information, and Values information; Parse the scheduling resource package information of the master cluster to obtain the application resource package information and cluster configuration information, wherein the cluster configuration information includes cluster location information of the application resource package information in each slave cluster, differential configuration information of the application resource package in each slave cluster, and application resource configuration information of the application resource package; wherein the application resource package information is the Chart information in the FedReleaseCRD, the cluster location information of the application resource package information in each slave cluster and the cluster configuration information are the Placement information in the FedReleaseCRD, the differential configuration information of the application resource package in each slave cluster is the Override information in the FedReleaseCRD, and the application resource configuration information of the application resource package is the Values information in the FedReleaseCRD; Based on the application resource package information and the application resource configuration information of the application resource package, the first distribution scheduling resource package information is generated, and for each slave cluster, based on the Chart information in the FedReleaseCRD, the Chart information in the HelmReleaseCRD is generated; based on the Release information in the FedReleaseCRD, the Release information in the HelmReleaseCRD is generated; based on the Values information in the FedReleaseCRD and the Override information in the FedReleaseCRD, the Values information in the HelmReleaseCRD is generated, and the Chart information in the HelmReleaseCRD, the Release information in the HelmReleaseCRD, and the Values information in the HelmReleaseCRD are used as the second distribution scheduling resource package information corresponding to the slave cluster; The cluster location information of the application resource package information in the slave cluster is marked on the second distribution scheduling resource package information to obtain the distribution scheduling resource package information of the slave cluster, and each of the distribution scheduling resource package information is respectively allocated to the slave cluster corresponding to each of the distribution scheduling resource package information; the distribution scheduling resource package information is used to establish the application information of the slave cluster; Acquire application status information of application information of each slave cluster from each slave cluster respectively; If the application status information of the slave cluster meets a condition for deleting the application information of the slave cluster, deleting the application information of the slave cluster; When the application status information of the slave cluster meets the condition for updating the application information of the slave cluster, the application information of the slave cluster is updated by applying a resource update policy.
2. The method according to claim 1, characterized in that: When the application status information of the slave cluster meets the condition for deleting the application information of the slave cluster, deleting the application information of the slave cluster includes: An application resource deletion instruction is generated, and the application resource deletion instruction is transmitted to the slave cluster whose application information needs to be deleted; the application resource deletion instruction is used to indicate the application information of the slave cluster whose application information needs to be deleted.
3. The method according to claim 1, characterized in that When the application status information of the slave cluster meets the condition for updating the application information of the slave cluster, updating the application information of the slave cluster by applying a resource update policy includes: For each slave cluster that meets the conditions for updating the application information of the slave cluster, based on the application status information of the slave cluster, the update scheduling resource package information of the slave cluster is generated, and the update scheduling resource package information is distributed to the slave cluster; the update scheduling resource package information includes application resource update information, and the application resource update information is used to update the application information of the slave cluster to obtain new application information of the slave cluster.
4. A cluster resource scheduling method, characterized in that: The method comprises: Receive the distribution scheduling resource package information sent by the main cluster; the distribution scheduling resource package is generated by the scheduling resource package information of the main cluster, and the distribution scheduling resource package information is HelmReleaseCRD, and the HelmReleaseCRD includes Chart information, Release information, and Values information; Parse the distribution scheduling resource package information to obtain application resource configuration information of the slave cluster and application resource package information of the slave cluster; the application resource package information includes multiple initial application resource data, and the application resource configuration information includes configuration values of each initial application resource data; wherein the application resource package information is the Chart information in FedReleaseCRD, the cluster location information of the application resource package information in each of the slave clusters, and the cluster configuration information is the Placement information in the FedReleaseCRD, the difference configuration information of the application resource package information in each of the slave clusters is the Override information in the FedReleaseCRD, and the application resource configuration information of the application resource package information is the Values information in the FedReleaseCRD; Based on the application resource configuration information, the configuration value of each initial application resource data is configured respectively to obtain each application resource data, and all the application resource data are used as the application information of the slave cluster.
5. A cluster resource scheduling system, characterized in that: The system comprises a resource master scheduling unit and a resource slave scheduling unit; The resource master scheduling unit is arranged in the master cluster, the resource slave scheduling unit is arranged in the master cluster and each slave cluster, and the resource slave scheduling units arranged in the master cluster and each slave cluster are communicatively connected; The resource master scheduling unit is used to generate scheduling resource package information of the master cluster, and generate distribution scheduling resource package information of each slave cluster based on the scheduling resource package information of the master cluster; The resource slave scheduling unit is used to distribute each of the distribution scheduling resource package information to the slave clusters corresponding to each of the distribution scheduling resource package information, and receive the distribution scheduling resource package information sent by the master cluster, wherein the distribution scheduling resource package information is HelmReleaseCRD, and the HelmReleaseCRD contains Chart information, Release information, and Values information; parse the distribution scheduling resource package information to obtain the application resource configuration information of the slave cluster and the application resource package information of the slave cluster; the application resource package information includes a plurality of initial application resource data, and the application resource configuration information includes the configuration value of each of the initial application resource data; wherein the application resource package information is the Chart information in FedReleaseCRD, the cluster location information of the application resource package information in each of the slave clusters, and the cluster configuration information are the Placement information in the FedReleaseCRD, the difference configuration information of the application resource package information in each of the slave clusters is the Override information in the FedReleaseCRD, and the application resource configuration information of the application resource package information is the Values information in the FedReleaseCRD; Based on the application resource configuration information, the configuration value of each initial application resource data is configured respectively to obtain each application resource data, and all the application resource data are used as the application information of the slave cluster.
6. A cluster resource scheduling device, characterized in that: The device comprises: An acquisition module is used to acquire the scheduling resource package information of the main cluster; the scheduling resource package includes application resource package information corresponding to the application information of each slave cluster, and cluster configuration information of the application information of each slave cluster; a resource master scheduling unit is provided in the main cluster, and a resource slave scheduling unit is provided in the main cluster and each slave cluster; wherein the resource master scheduling unit is a FedRelease-controller-manager established based on a custom resource extension strategy CRD, and the resource slave scheduling unit is a HelmRelease-controller-manager established based on the custom resource extension strategy CRD; the scheduling resource package information is FedReleaseCRD, and the FedReleaseCRD includes Chart information, Release information, Values information, Placement information, and Override information; the distribution scheduling resource package information is HelmReleaseCRD, and the HelmReleaseCRD includes Chart information, Release information, and Values information; A generation module is used to parse the scheduling resource package information of the master cluster to obtain the application resource package information and cluster configuration information, wherein the cluster configuration information includes cluster location information of the application resource package information in each slave cluster, difference configuration information of the application resource package in each slave cluster, and application resource configuration information of the application resource package; wherein the application resource package information is the Chart information in the FedReleaseCRD, the cluster location information of the application resource package information in each slave cluster and the cluster configuration information are the Placement information in the FedReleaseCRD, the difference configuration information of the application resource package in each slave cluster The configuration information is the Override information in the FedReleaseCRD, and the application resource configuration information of the application resource package is the Values information in the FedReleaseCRD; based on the application resource package information and the application resource configuration information of the application resource package, the first distribution scheduling resource package information is generated, and for each slave cluster, based on the Chart information in the FedReleaseCRD, the Chart information in the HelmReleaseCRD is generated; based on the Release information in the FedReleaseCRD, the Release information in the HelmReleaseCRD is generated Release information of the FedReleaseCRD; based on the Values information in the FedReleaseCRD and the Override information in the FedReleaseCRD, the Values information in the HelmReleaseCRD is generated, and the Chart information in the HelmReleaseCRD, the Release information in the HelmReleaseCRD, and the Values information in the HelmReleaseCRD are used as the second distribution scheduling resource package information corresponding to the slave cluster; the second distribution scheduling resource package information is marked with the cluster location information of the application resource package information in the slave cluster to obtain the distribution scheduling resource package information of the slave cluster, and each of the distribution scheduling resource package information is respectively allocated to the slave clusters corresponding to each of the distribution scheduling resource package information; the distribution scheduling resource package information is used to establish the application information of the slave cluster; respectively, from each of the slave clusters, the application status information of the application information of each of the slave clusters is obtained; if the application status information of the slave cluster meets the condition of deleting the application information of the slave cluster, the application information of the slave cluster is deleted; if the application status information of the slave cluster meets the condition of updating the application information of the slave cluster, the application information of the slave cluster is updated through the application resource update policy.
7. The device according to claim 6, characterized in that The device also includes: The deletion module is used to generate an application resource deletion instruction and transmit the application resource deletion instruction to the slave cluster whose application information needs to be deleted; the application resource deletion instruction is used to indicate the application information of the slave cluster whose application information needs to be deleted.
8. The device according to claim 6, characterized in that The device also includes: The updating module is used to update the application information of the slave cluster by applying a resource update strategy when the application status information of the slave cluster meets the condition for updating the application information of the slave cluster.
9. A cluster resource scheduling device, characterized in that: The device comprises: A receiving module, used to receive the distribution scheduling resource package information sent by the main cluster; the distribution scheduling resource package is generated by the scheduling resource package information of the main cluster, and the distribution scheduling resource package information is HelmReleaseCRD, and the HelmReleaseCRD contains Chart information, Release information, and Values information; A parsing module, used to parse the distribution scheduling resource package information to obtain application resource configuration information of the slave cluster and the application resource package information of the slave cluster; the application resource package information includes multiple initial application resource data, and the application resource configuration information includes the configuration value of each initial application resource data; wherein the application resource package information is the Chart information in FedReleaseCRD, the cluster location information of the application resource package information in each of the slave clusters, and the cluster configuration information is the Placement information in the FedReleaseCRD, the difference configuration information of the application resource package information in each of the slave clusters is the Override information in the FedReleaseCRD, and the application resource configuration information of the application resource package information is the Values information in the FedReleaseCRD; The configuration module is used to configure the configuration value of each initial application resource data based on the application resource configuration information, obtain each application resource data, and use all the application resource data as the application information of the slave cluster.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Resource processing method and device
CN114840223A
Resource management method and system
CN115567523A
