CN113778623B - Resource processing method and device, electronic equipment and storage medium - Google Patents

Resource processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113778623B
CN113778623B CN202110991387.1A CN202110991387A CN113778623B CN 113778623 B CN113778623 B CN 113778623B CN 202110991387 A CN202110991387 A CN 202110991387A CN 113778623 B CN113778623 B CN 113778623B
Authority
CN
China
Prior art keywords
instance object
server cluster
target
resource
target instance
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110991387.1A
Other languages
Chinese (zh)
Other versions
CN113778623A (en
Inventor
孙晓飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202110991387.1A priority Critical patent/CN113778623B/en
Publication of CN113778623A publication Critical patent/CN113778623A/en
Application granted granted Critical
Publication of CN113778623B publication Critical patent/CN113778623B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45591Monitoring or debugging support
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The disclosure relates to a resource processing method and device, an electronic device and a storage medium, wherein the method comprises the following steps: monitoring an update message of resources in a first server cluster, wherein a target resource management module is a resource management module with unique processing authority in a plurality of resource management modules, when the update message indicates that resources change, selecting at least one third server cluster from the plurality of second server clusters according to the resource use condition of the plurality of second server clusters, and managing a target instance object in the at least one third server cluster according to the update message, wherein the target instance object is an instance object determined according to the updated resources, and the target instance objects in different third server clusters respectively have unique identifiers. The technical problem of low efficiency of resource processing in the related technology is solved.

Description

Resource processing method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computers, and in particular, to a method and apparatus for processing resources, an electronic device, and a storage medium.
Background
Currently, in the related art, in the process of performing multi-cluster management, a corresponding resource management module is generally configured for each cluster to perform resource processing under a multi-cluster scenario.
For example, kubernetes is an open source for managing containerized applications on multiple hosts in a cloud platform, and the goal of Kubernetes is to make deploying containerized applications simple and efficient, and Kubernetes provides a mechanism for application deployment, planning, updating, and maintenance. In the process of multi-cluster management in the Kubernetes scene, an operator+multi-cluster management module is generally configured to be deployed for each cluster, and an operator is deployed in each Kubernetes cluster, and the multi-cluster management module is responsible for managing the stateful service of each cluster.
However, since each Kubernetes cluster is required to deploy an operator, resources cannot be fully utilized: when the resources used by the service exceed the residual resources of a single cluster, the service cannot be created due to insufficient resources, and the total residual resources of all clusters meet the requirements, which causes a certain resource waste and causes the technical problem of lower resource processing efficiency.
Therefore, no effective solution exists at present for the technical problem of low efficiency of resource processing in the related art.
BRIEF SUMMARY OF THE PRESENT DISCLOSURE
The disclosure provides a resource processing method and device, an electronic device and a storage medium, so as to at least solve the technical problem of low efficiency of resource processing in the related technology. The technical scheme of the present disclosure is as follows:
According to a first aspect of an embodiment of the present disclosure, there is provided a resource processing method, including: monitoring an update message of a resource in a first server cluster, wherein the first server cluster is used for storing the resource, the resource is used for managing a group of instance objects according to an expected state, and the target resource management module is a resource management module with unique processing authority in a plurality of resource management modules; when the update message indicates that the resource is changed, selecting at least one third server cluster from the plurality of second server clusters according to the resource use condition of the plurality of second server clusters; and managing target instance objects in the at least one third server cluster according to the update message, wherein the group of instance objects comprises the target instance objects, the target instance objects are instance objects determined according to the updated resources, and the target instance objects in different third server clusters respectively have unique identifications.
Optionally, the resource comprises a custom resource CR generated based on the service creation request.
Optionally, the monitoring the update message of the resource in the first server cluster includes: monitoring a first resource type of a resource to be processed in the first server cluster; and acquiring an update message of the resource in the first server cluster under the condition that the first resource type is determined to be the same as the current allowed processing target resource type and the unique processing authority is acquired.
Optionally, managing the target instance object according to the update message in the at least one third server cluster includes: obtaining the update message from the first server cluster, wherein the update message indicates that the resource has updated at least one of: newly building the target instance object, modifying the target instance object, and deleting the target instance object; based on the update message, the target instance object in the at least one third server cluster is managed.
Optionally, managing the target instance object in the at least one third server cluster based on the update message includes at least one of: creating a new target instance object in the at least one third server cluster if the update message indicates that the target instance object needs to be newly created; modifying the created target instance object in the at least one third server cluster, in case the update message indicates that the target instance object needs to be modified; and deleting the created target instance object in the at least one third server cluster in case the update message indicates that the target instance object needs to be deleted.
Optionally, the managing, in the at least one third server cluster, the target instance object according to the update message includes: monitoring the current state of the target instance object in the third server cluster under the condition that the target instance object is created, and obtaining a state result; and when the state result shows that the current state is different from the expected state, adjusting the target instance object according to the expected state.
Optionally, when the state result indicates that the current state is different from the expected state, adjusting the target instance object according to the expected state includes: selecting a fourth server cluster from the plurality of second server clusters when the state result indicates that a first instance object in the target instance object is in an abnormal state, wherein the first instance object is any instance object in the target instance object; creating a second instance object in the fourth server cluster, and deleting the first instance object in the third server cluster, wherein the second instance object has the same identification as the first instance object.
Optionally, when the state result indicates that the current state is different from the expected state, adjusting the target instance object according to the expected state includes: selecting a fifth server cluster from the plurality of second server clusters when the state result indicates that the third server cluster in which the target instance object is located is in a fault state; and in the fifth server cluster, recreating an instance object in a third server cluster in a fault state, and deleting the instance object in the third server cluster, wherein the instance object in the fifth server cluster and the instance object in the third server cluster in the fault state have the same identification.
According to a second aspect of embodiments of the present disclosure, there is provided a resource processing system comprising: a first server cluster for storing resources; the target resource management module is used for monitoring update messages of resources in the first server cluster, wherein the resources are used for managing a group of instance objects according to an expected state, and the target resource management module is a resource management module with unique processing authority in a plurality of resource management modules; the target resource management module is further configured to select at least one third server cluster from the plurality of second server clusters according to resource usage conditions of the plurality of second server clusters when the update message indicates that the resource changes; the at least one third server cluster is configured to manage a target instance object according to the update message, where the set of instance objects includes the target instance object, where the target instance object is an instance object determined according to the updated resource, and the target instance objects in different third server clusters have unique identifiers respectively.
Optionally, the resource comprises a custom resource CR generated based on the service creation request.
Optionally, the target resource management module includes: a first monitoring unit, configured to monitor a first resource type of a resource to be processed in the first server cluster; the first obtaining unit is used for obtaining the update message of the resources in the first server cluster under the condition that the first resource type is the same as the current allowed processing target resource type and the unique processing authority is obtained.
Optionally, the target resource management module is configured to manage a target instance object in the at least one third server cluster according to the update message by: obtaining the update information from the first server cluster, wherein the update information indicates that the resource has updated at least one of: newly building the target instance object, modifying the target instance object, and deleting the target instance object; and managing the target instance object in the at least one third server cluster based on the updated information.
Optionally, the target resource management module is configured to manage a target instance object in the at least one third server cluster based on the update information by at least one of: creating a new target instance object in the at least one third server cluster if the update information indicates that the target instance object needs to be newly created; modifying the created target instance object in the at least one third server cluster, in case the update information indicates that the target instance object needs to be modified; and deleting the created target instance object in the at least one third server cluster in case the update information indicates that the target instance object needs to be deleted.
Optionally, the target resource management module is configured to adjust a target instance object in at least one third server cluster according to the update message by: monitoring the current state of the target instance object in the third server cluster under the condition that the target instance object is created, and obtaining a state result; and when the state result shows that the current state is different from the expected state, adjusting the target instance object according to the expected state.
Optionally, the target resource management module is configured to adjust the target instance object according to the expected state when the state result indicates that the current state is different from the expected state by: selecting a fourth server cluster from the plurality of second server clusters when the state result indicates that a first instance object in the target instance object is in an abnormal state, wherein the first instance object is any instance object in the target instance object; creating a second instance object in the fourth server cluster, and deleting the first instance object in the third server cluster, wherein the second instance object has the same identification as the first instance object.
Optionally, the target resource management module is configured to adjust the target instance object according to the expected state when the state result indicates that the current state is different from the expected state by: selecting a fifth server cluster from the plurality of second server clusters when the state result indicates that the third server cluster in which the target instance object is located is in a fault state; and in the fifth server cluster, recreating an instance object in a third server cluster in a fault state, and deleting the instance object in the third server cluster, wherein the instance object in the fifth server cluster and the instance object in the third server cluster in the fault state have the same identification.
According to a third aspect of the embodiments of the present disclosure, there is provided a resource processing apparatus, including: the monitoring module is used for receiving a resource creation request of the first server cluster, wherein the resource creation request carries resource information of target resources to be created; the selection module is used for selecting at least one second server cluster from the plurality of second server clusters according to the resource information and the resource use conditions of the plurality of second server clusters; the management module is used for generating instance creation information corresponding to the at least one second server cluster respectively according to the resource information; the creation module is used for creating an instance by adopting corresponding instance creation information in the at least one second server cluster, wherein the instance created in the at least one second server cluster forms a target instance corresponding to the target resource, and the target instance is created by the same resource management module and respectively has unique identification.
Optionally, the resource comprises a custom resource CR generated based on the service creation request.
Optionally, the monitoring module includes: a second monitoring unit, configured to monitor a first resource type of a resource to be processed in the first server cluster; and the second acquisition unit is used for acquiring the update message of the resources in the first server cluster under the condition that the first resource type is determined to be the same as the current allowed processing target resource type and the unique processing authority is acquired.
Optionally, the apparatus is configured to manage, in the at least one third server cluster, a target instance object according to the update message by: obtaining the update information from the first server cluster, wherein the update information indicates that the resource has updated at least one of: newly building the target instance object, modifying the target instance object, and deleting the target instance object; and managing the target instance object in the at least one third server cluster based on the updated information.
Optionally, the apparatus is configured to manage the target instance object in the at least one third server cluster based on the update information by at least one of: creating a new target instance object in the at least one third server cluster if the update information indicates that the target instance object needs to be newly created; modifying the created target instance object in the at least one third server cluster, in case the update information indicates that the target instance object needs to be modified; and deleting the created target instance object in the at least one third server cluster in case the update information indicates that the target instance object needs to be deleted.
Optionally, the apparatus is configured to adjust the target instance object according to the update message in at least one third server cluster by: monitoring the current state of the target instance object in the third server cluster under the condition that the target instance object is created, and obtaining a state result; and when the state result shows that the current state is different from the expected state, adjusting the target instance object according to the expected state.
Optionally, the device is configured to adjust the target instance object according to the expected state when the state result indicates that the current state is different from the expected state by: selecting a fourth server cluster from the plurality of second server clusters when the state result indicates that a first instance object in the target instance object is in an abnormal state, wherein the first instance object is any instance object in the target instance object; creating a second instance object in the fourth server cluster, and deleting the first instance object in the third server cluster, wherein the second instance object has the same identification as the first instance object.
Optionally, the device is configured to adjust the target instance object according to the expected state when the state result indicates that the current state is different from the expected state by: selecting a fifth server cluster from the plurality of second server clusters when the state result indicates that the third server cluster in which the target instance object is located is in a fault state; and in the fifth server cluster, recreating an instance object in a third server cluster in a fault state, and deleting the instance object in the third server cluster, wherein the instance object in the fifth server cluster and the instance object in the third server cluster in the fault state have the same identification.
According to a fourth aspect of embodiments of the present disclosure, there is provided a resource processing electronic device, comprising: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement a resource processing method as described above.
According to yet another aspect of the embodiments of the present disclosure, there is also provided a computer-readable storage medium having a computer program stored therein, wherein the computer program is configured to perform the above-described resource processing method when run.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects: the method comprises the steps of monitoring an update message of resources in a first server cluster, wherein the first server cluster is used for storing resources, the resources are used for managing a group of instance objects according to an expected state, a target resource management module is a resource management module with unique processing authority in a plurality of resource management modules, when the update message indicates that the resources change, at least one third server cluster is selected from the plurality of second server clusters according to the resource use condition of the plurality of second server clusters, the target instance objects are managed in the plurality of second server clusters according to the update message in the at least one third server cluster by the resource management module with the unique processing authority, the target instance objects are determined according to the updated resources, and the target instance objects in different third server clusters are respectively provided with unique identifiers.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure and do not constitute an undue limitation on the disclosure.
FIG. 1 is a flow chart illustrating a method of resource processing according to an exemplary embodiment;
FIG. 2 is a flow diagram illustrating another resource processing method according to an example embodiment;
FIG. 3 is a flow diagram illustrating yet another resource processing method according to an example embodiment;
FIG. 4 is a schematic diagram of an application environment illustrating a resource processing method according to an example embodiment;
FIG. 5 is a block diagram of a resource processing device, shown in accordance with an exemplary embodiment;
fig. 6 is a block diagram of an electronic device, according to an example embodiment.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
First, partial terms or terminology appearing in describing embodiments of the present application are applicable to the following explanation:
operators: that is, the resource management module described below, is an extension of Kubernetes and may include, but is not limited to, managing applications and their components using custom resources CR (Custom Resource), typically managing stateful services. Responsible for the corresponding actions of creating, updating, deleting and the like of the customized resource, and finally converting the customized resource into Pod (corresponding to a target instance object described below).
CR: custom resources (Custom resources) are extensions to the Kubernetes API, defining a new Resource type in the Kubernetes cluster, typically one operator for each Resource type.
Stateful services: the name of each instance Pod of services like MySQL cluster (with master-slave state), fragment service (each fragment completes different functions, and all fragment combinations can realize complete functions) is unique and can not be replaced at will, and different functions are distinguished by instance names.
The invention is illustrated below with reference to examples:
according to an aspect of the embodiment of the present invention, there is provided a resource processing method, alternatively, in the present embodiment, the above-described resource processing method may be applied to a hardware environment constituted by the server 101 and the terminal device 103 as shown in fig. 1. As shown in fig. 1, a server 101 is connected to a terminal 103 through a network, and may be used to provide services to a terminal device or a client installed on the terminal device, where the client may be a video client, an instant messaging client, a browser client, an educational client, a game client, etc. The database 105 may be provided on or separate from the server for providing data storage services for the server 101, such as a game data storage server, which may include, but is not limited to: a wired network, a wireless network, wherein the wired network comprises: local area networks, metropolitan area networks, and wide area networks, the wireless network comprising: bluetooth, WIFI and other wireless communication networks, the terminal device 103 may be a terminal configured with a client, and may include, but is not limited to, at least one of the following: a mobile phone (such as an Android mobile phone, an iOS mobile phone, etc.), a notebook computer, a tablet computer, a palm computer, an MID (Mobile Internet Devices, mobile internet device), a PAD, a desktop computer, a smart television, etc., where the server may be a single server, a server cluster formed by a plurality of servers, or a cloud server, which may include, but is not limited to, a router or a gateway.
As shown in fig. 1, the above-mentioned resource processing method may be implemented in the user terminal 103 by the following steps:
s1, monitoring an update message of a resource in a first server cluster on a client installed on a terminal device 103, wherein the first server cluster is used for storing the resource, the resource is used for managing a group of instance objects according to an expected state, and a target resource management module is a resource management module with unique processing authority in a plurality of resource management modules;
s2, when the update message indicates that the resource is changed on the client installed on the terminal equipment 103, selecting at least one third server cluster from the plurality of second server clusters according to the resource use condition of the plurality of second server clusters;
s3, managing target instance objects according to the update message in at least one third server cluster on the client installed on the terminal equipment 103, wherein one group of instance objects comprises target instance objects, the target instance objects are instance objects determined according to updated resources, and the target instance objects in different third server clusters respectively have unique identifiers.
Alternatively, in the present embodiment, the above-described resource processing method may also be implemented by a server, for example, in the server 101 shown in fig. 1; or by both the user terminal and the server.
The above is merely an example, and the present embodiment is not particularly limited.
Optionally, as an optional embodiment, as shown in fig. 2, the resource processing method includes:
s202, monitoring an update message of a resource in a first server cluster, wherein the first server cluster is used for storing the resource, the resource is used for managing a group of instance objects according to an expected state, and a target resource management module is a resource management module with unique processing authority in a plurality of resource management modules;
s204, when the update message indicates that the resource is changed, selecting at least one third server cluster from the plurality of second server clusters according to the resource use conditions of the plurality of second server clusters;
s206, managing target instance objects in at least one third server cluster according to the update message, wherein one group of instance objects comprises target instance objects, the target instance objects are instance objects determined according to updated resources, and the target instance objects in different third server clusters respectively have unique identifications.
Alternatively, in this embodiment, the first server cluster may include, but is not limited to, a master cluster in a Kubernetes cluster, and receives an update message generated by the container platform according to a service request sent by a user, so as to manage the target instance object.
Optionally, in this embodiment, any one of the plurality of resource management modules may be configured as a unique target resource management module according to a global lock mechanism, so as to be used for managing the target instance object, and may further include, but is not limited to, determining a resource management module associated with the first server cluster as a unique target resource management module, so as to be used for managing the target instance object.
It should be noted that, the target resource management module has unique processing authority according to the global lock mechanism.
Alternatively, in this embodiment, the resources may include, but are not limited to, extensions to the Kubernetes API, which are defined in the Kubernetes cluster, and are used to manage the target instance object through the target resource management module, where each type of resource generally corresponds to one resource management module.
Taking Custom Resource CR as an example, CR Resource (Custom Resource) is an extension to the Kubernetes API, not necessarily available in the default Kubernetes installation. Custom resources may be present or absent within a cluster in operation by means of dynamic registration, and a cluster administrator may update custom resources independently of the cluster. Once a custom resource is installed, the user can use kubecl to create and access objects therein as they do for a built-in resource such as a pole.
Of course, the resources described above may also include, but are not limited to, resources other than the Kubernetes platform, which are exemplified by Kubernetes only.
Alternatively, in the present embodiment, the update message may include, but is not limited to, a message for indicating a change condition of the resource (e.g., a new instance object, a modified instance object, a deleted instance object, etc.), and the target instance object is managed by the target resource management module according to the update message.
Optionally, in this embodiment, the resource usage status of the plurality of second server clusters may include, but is not limited to, available resource status of all second server clusters in a certain computing platform, for example, using Kubernetes as an example, and the second server clusters may include, but are not limited to, other Kubernetes clusters besides the first server cluster.
Optionally, in this embodiment, the selecting at least one second server cluster from the plurality of second server clusters may include, but is not limited to, determining, as the at least one second server cluster, a second server cluster available in the second server clusters according to a resource usage condition, or determining, as the at least one second server cluster, a second server cluster unavailable in the second server clusters according to a resource usage condition, and determining, as the at least one second server cluster, other second server clusters except the unavailable second server cluster.
Optionally, in this embodiment, the target instance object is created by a target resource management module, and each having a unique identifier may include, but is not limited to, configuring the resource management module for the first server cluster, and managing the target instance object by using the target resource management module associated with the first server cluster, where the target instance object may include, but is not limited to, a pod instance.
Optionally, in this embodiment, the application scenario of the above resource processing may include, but is not limited to, medical, financial, credit, banking, government, game, energy, education, security, building, traffic, internet of things, industry, and other application scenarios.
In particular, using the Kubernetes cluster as an example, in enterprises in the different domains described above, the Kubernetes platform may be deployed using upstream open source or commercial software distribution or through cloud services. Cloud services provide simplified operations and fast time to market, while software distribution provides better multi-cloud support and manageability. The success of containers and Kubernetes requires various core and auxiliary roles, depending on the use case and maturity of the enterprise, providing customizable upstream open sources. It is important to have the necessary skills in platform engineering, operation and security engineering.
FIG. 3 is a flow chart of a method for processing resources according to an exemplary embodiment, as shown in FIG. 3, where the method for processing resources may include, but is not limited to, the following steps:
s1, when a container cloud platform receives a service creation request of a user, generating CR configuration, then sending a creation request to a main Kubernetes cluster (corresponding to the first server cluster) to create CR resources (corresponding to the resources);
s2, the operator (corresponding to the target resource management module) listens to the creation of the CR resource object (corresponding to the listening update message) and calculates available resource conditions of all Kubernetes clusters (corresponding to the second server cluster) to select one or more available Kubernetes clusters (corresponding to the third server cluster);
s3, generating Pod (instance) configuration information according to the configuration information of the CR by the operators, creating a Pod request to a specific Kubernetes cluster, and generating the name of the Pod according to a unified rule to ensure global uniqueness;
s4, the Kubernetes cluster is responsible for creating a Pod instance;
s5, periodically inquiring the Pod state by the operator, and carrying out state synchronization;
s6, when the Pod has an abnormal condition, the operator automatically creates the Pod with the same name to replace the Pod.
According to the method, a first server cluster is used for storing resources, the resources are used for managing a group of instance objects according to an expected state, the target resource management module is a resource management module with unique processing authority among a plurality of resource management modules, when the updating information indicates that the resources change, at least one third server cluster is selected from the plurality of second server clusters according to the resource use condition of the plurality of second server clusters, the target instance objects are managed in the plurality of second server clusters according to the updating information in the at least one third server cluster, the target instance objects are determined according to the updated resources by the resource management module with the unique processing authority according to the updating information, and further, the target instance objects in different third server clusters are respectively provided with unique identifiers.
As an alternative, the resource comprises a custom resource CR generated based on a service creation request.
Alternatively, in this embodiment, the custom resource CR (Custom Resource) described above is an extension to the Kubernetes API. What the customization resource represents is one customization for a particular Kubernetes installation. However, many Kubernetes core functions are now implemented with custom resources, which makes Kubernetes more modular.
Specifically, it may include, but is not limited to, configuring the target resource as a custom resource CR in the following cases:
1) A new resource is created and changed using the Kubernetes client library and CLI.
2) kubectl can directly support your resources; for example, kubectl get my-object object object name.
3) A new automation mechanism is constructed to monitor update events on objects and perform CRUD operations on other objects or monitor the latter to update the former.
4) An automation component is written to handle updates to the object.
5) The conventions for fields such as. Spec,. Status, and. Metadata are used by the Kubernetes API.
6) An object is an abstraction of a set of controlled resources, or a generalized refinement of other resources.
The above is merely an example, and the present embodiment is not limited in any way.
The customized resources can be in or appear or disappear in the running cluster in a dynamic registration mode, and a cluster manager can update the customized resources independently of the cluster, so that the technical effect of improving the efficiency of managing the customized resources is achieved.
As an alternative, listening for an update message of a resource in the first server cluster includes:
monitoring a first resource type of a resource to be processed in the first server cluster;
and acquiring an update message of the resource in the first server cluster under the condition that the first resource type is determined to be the same as the current allowed processing target resource type and the unique processing authority is acquired.
Optionally, in this embodiment, the foregoing monitoring the first resource type of the resource to be processed in the first server cluster may include, but is not limited to, using a Kubernetes client implementation, for example, kube operator is a Kubernetes cluster deployment and multi-cluster management tool, providing a Web UI to support deploying multiple Kubernetes clusters in an offline environment, planning, deploying and operating Kubernetes clusters at a production level on VMware, openStack and physical machines through the Web UI. The method supports an intranet offline environment, a GPU and a built-in application store.
In particular, a first resource type of the resources to be processed, which may include, but is not limited to, a custom resource CR, etc., may be included, but is not limited to, listening to the resources periodically or according to configuration parameters.
For example, fig. 4 is an application environment schematic diagram illustrating a method of resource processing, as shown in fig. 4, according to an exemplary embodiment, where the method of resource processing may include, but is not limited to, the following implementation steps:
s402, the container cloud platform sends a CR creation request to a main Kubernetes cluster;
s404, selecting an operator with unique processing authority as the operator corresponding to the CR;
s406, calculating available resource conditions of a plurality of Kubernetes clusters, and screening out a proper Kubernetes cluster as the second server cluster;
s408, according to CR configuration information, a Pod instance creation request is generated, and a Pod instance is created on the corresponding Kubernetes cluster.
According to the method, the first resource type of the resources to be processed in the first server cluster is monitored, and under the condition that the first resource type is identical to the current allowed processing target resource type and the unique processing authority is acquired, the mode of acquiring the update information of the resources in the first server cluster is adopted, a resource management module is not required to be deployed for each cluster respectively, global management is directly realized through the resource management module with the unique processing authority, the resource processing efficiency is improved, and the technical problem that the resource processing efficiency is lower in the related technology is solved.
As an alternative, managing the target instance object according to the update message in the at least one third server cluster includes:
obtaining the update message from the first server cluster, wherein the update message indicates that the resource has updated at least one of: newly building the target instance object, modifying the target instance object, and deleting the target instance object;
based on the update message, the target instance object in the at least one third server cluster is managed.
Alternatively, in this embodiment, the update message may include, but is not limited to, a new target instance object, a modified target instance object, and a deleted target instance object.
Alternatively, in this embodiment, the update message of the target resource may include, but is not limited to, an update message for maintaining the instance state to reach the expected state specified by the target resource.
For example, taking the target resource as the CR resource, the resource management device as an operator, and the example as Pod, the following exemplary description is made:
1) When the CR resource generates the operations of creation, update and deletion, the update information of the target resource is obtained, and the operations of creation, update and deletion related to the update information are also carried out on the Pod through the operator;
2) When CR resources need to be expanded, obtaining an update message of target resources, and creating a new Pod by an operator to achieve the number of expected examples carried in the update message; when the CR resource needs to shrink, acquiring an update message of the target resource, and deleting Pod through an operator to achieve the number of expected examples carried in the update message;
3) When the Pod instance is Pending or deleted due to insufficient resources, the operator resource calculation is used for creating the same name Pod in the new Kubernetes cluster to replace the original Pod; when a single cluster fails, the Pod instance of the failed cluster is replaced by creating a homonymy Pod in the new Kubernetes cluster through an operator resource calculation.
By this embodiment, the update message is acquired from the first server cluster, where the update message indicates that the resource has updated at least one of the following: new building a target instance object, modifying the target instance object, and deleting the target instance object; based on the update message, the mode of managing the target instance object in at least one third server cluster can flexibly update the instance object according to the update message, such as a new management mode, a modification management mode, a deletion management mode and the like, so that global management is realized through the resource management module with unique processing authority, the efficiency of resource processing is improved, and the technical problem of lower efficiency of resource processing in the related technology is solved.
As an alternative, managing the target instance object in the at least one third server cluster based on the update message includes at least one of:
creating a new target instance object in the at least one third server cluster if the update message indicates that the target instance object needs to be newly created;
modifying the created target instance object in the at least one third server cluster, in case the update message indicates that the target instance object needs to be modified;
and deleting the created target instance object in the at least one third server cluster in case the update message indicates that the target instance object needs to be deleted.
Optionally, in this embodiment, taking a new target instance object as an example, when the number of instance objects that need to be created in the resource increases, an update message for generating the new target instance object is triggered to instruct the target resource management module to select a third server cluster to create the target instance object in the second server cluster.
Optionally, in this embodiment, taking a modification target instance object as an example, in a case where a modification instance object is needed in the resource, an update message for generating the modification target instance object is triggered to instruct the target resource management module to modify the target instance object in the third server cluster.
Optionally, in this embodiment, taking a deletion target instance object as an example, when the number of instance objects that need to be created in the resource decreases, an update message for generating the deletion target instance object is triggered to instruct the target resource management module to delete the target instance object in the third server cluster.
By the embodiment, under the condition that the update message indicates that a new target instance object is needed to be built, a new target instance object is created in at least one third server cluster; modifying the created target instance object in the at least one third server cluster in case the update message indicates that the target instance object needs to be modified; under the condition that the update message indicates that the target instance object needs to be deleted, the method for deleting the created target instance object in at least one third server cluster can flexibly update the instance object according to the update message, such as a new management mode, a modification management mode, a deletion management mode and the like, so that global management is realized through a resource management module with unique processing authority, the efficiency of resource processing is improved, and the technical problem of lower efficiency of resource processing in the related technology is solved.
As an alternative, said adjusting, in at least one third server cluster, the target instance object according to the update message includes:
monitoring the current state of the target instance object in the third server cluster under the condition that the target instance object is created, and obtaining a state result;
and when the state result shows that the current state is different from the expected state, adjusting the target instance object according to the expected state.
Alternatively, in this embodiment, the foregoing state of the listening object may include, but is not limited to, using a Kubernetes client implementation.
Specifically, the state of the target instance object can be queried periodically or according to the expected state, and the state result can be determined through the synchronous state, wherein the expected state can be determined according to the number of the created instance objects, the load condition of the server cluster, the running efficiency of the instance objects and other parameters compared with a preset threshold.
According to the method and the device for processing the resource management, the current state of the target instance object in the third server cluster is monitored under the condition that the target instance object is created, a state result is obtained, when the state result shows that the current state is different from the expected state, the target instance object is adjusted according to the expected state, and the target instance object can be flexibly adjusted to the expected state according to the state of the target instance object in the third server cluster, so that global management is achieved through a resource management module with unique processing authority, the efficiency of resource processing is improved, and the technical problem that the efficiency of resource processing in the related technology is low is solved.
As an alternative, the adjusting the target instance object according to the expected state when the state result indicates that the current state is different from the expected state based on the state result includes:
selecting a fourth server cluster from the plurality of second server clusters when the state result indicates that a first instance object in the target instance object is in an abnormal state, wherein the first instance object is any instance object in the target instance object;
creating a second instance object in the fourth server cluster, and deleting the first instance object in the third server cluster, wherein the second instance object has the same identification as the first instance object.
Alternatively, in this embodiment, the first instance object being in the abnormal state may include, but is not limited to, determining that the first instance object is in the abnormal state when the first instance object is Pending or deleted due to insufficient resources.
Alternatively, in this embodiment, the second server cluster selected from the plurality of second server clusters may actually include, but is not limited to, a server cluster whose resource status indicates that the resource status is available, for example, a new Kubernetes cluster.
Alternatively, in this embodiment, the second instance object having the same identifier as the first instance object may be understood as that, according to the identifier of the first instance object, the second instance object corresponding to the first instance object is created, and the first instance object is deleted, so as to ensure global uniqueness.
According to the method, under the condition that a state result indicates that a first instance object in a target instance object is in an abnormal state, a fourth server cluster is selected from a plurality of second server clusters, wherein the first instance object is any instance object in the target instance object, the second instance object is created in the fourth server cluster, and the first instance object in the third server cluster is deleted, wherein the second instance object and the first instance object have the same identification, global management can be achieved through a resource management module with unique processing authority, so that the uniqueness of the identification of the instance object in the global is guaranteed, the resource processing efficiency is improved, and the technical problem that the resource processing efficiency in the related technology is low is solved.
As an alternative, when the state result indicates that the current state is different from the expected state, adjusting the target instance object according to the expected state includes:
Selecting a fifth server cluster from the plurality of second server clusters when the state result indicates that the third server cluster in which the target instance object is located is in a fault state;
and in the fifth server cluster, recreating an instance object in a third server cluster in a fault state, and deleting the instance object in the third server cluster, wherein the instance object in the fifth server cluster and the instance object in the third server cluster in the fault state have the same identification.
Optionally, in this embodiment, the second server cluster being in the failure state may include, but is not limited to, the second server cluster being turned off, the second server cluster being under an excessive load, or the like, and may be replaced by including, but not limited to, acquiring a new second server cluster, where in the replacing process, the same instance object as that on the second server cluster in the failure state needs to be created on the new second server cluster, so as to ensure normal running of the service.
According to the method, when the state result indicates that the third server cluster in which the target instance object is located is in a fault state, a fifth server cluster is selected from a plurality of second server clusters, the instance object in the third server cluster in the fault state is recreated in the fifth server cluster, and the instance object in the third server cluster is deleted, wherein the instance object in the fifth server cluster and the instance object in the third server cluster in the fault state have the same identification, global management can be achieved through a resource management module with unique processing authority, the server cluster in the fault state is replaced, normal operation of service is guaranteed, resource processing efficiency is improved, and the technical problem that resource processing efficiency is low in related technology is solved.
The disclosure is further explained below in connection with specific examples:
main Kubernetes Cluster: the CR resource object is used for storing the CR resource object and is used for the operator to read and write;
operators: monitoring the change of CR objects of the main Kubernetes cluster, screening out a proper cluster through a resource calculation module, and creating a Pod instance.
Specifically, an operator can deploy multiple copies, achieving high availability; through the global lock mechanism, only one operator is guaranteed to work at any time. Since all Pod of the same CR are created by the same operator, it is possible to guarantee that the instance name is globally unique.
The operators are responsible for part of multi-cluster management functions, and directly send a Pod creation request to the corresponding Kubernetes clusters according to the result of the resource calculation module.
The operator maintains the Pod state to the expected state specified by CR:
1) When the CR resource generates the operations of creation, updating and deletion, the operator also performs related operations of creation, updating and deletion on the Pod;
2) When CR expansion is performed, an operator achieves the number of expected examples by creating a new Pod; when CR is contracted, an operator deletes Pod to reach the number of expected examples;
3) When the Pod instance is Pending or deleted due to insufficient resources, the operator creates a same name Pod in the new Kubernetes cluster through resource calculation to replace the original Pod; when a single cluster fails, the same name Pod is created in the new Kubernetes cluster through the calculation of an operator resource, and the Pod instance of the failed cluster is replaced.
Corresponding services may be created including, but not limited to, the following:
s1, when a container cloud platform receives a service creation request of a user, generating CR configuration, then sending the creation request to a main Kubernetes cluster, and creating CR resources;
s2, the operator monitors the creation of CR resource objects, calculates available resource conditions of all the Kubernetes to a resource calculation module, and selects one or more available Kubernetes clusters;
s3, generating Pod configuration information by an operator according to the configuration information of CR, creating a Pod request to a specific Kubernetes cluster, and generating the name of Pod according to a unified rule to ensure global uniqueness;
s4, the bottom layer Kubernetes cluster is responsible for creating Pod examples;
s5, periodically inquiring the Pod state by the operator, and carrying out state synchronization; when the Pod has abnormal conditions, the Pod with the same name is automatically created for replacement.
By adopting the resource processing method in the embodiment, as most codes of the operators are generated, only specific service logic is needed to be realized, and the container cloud platform side only needs to interact with a single Kubernetes cluster, and the operators can be realized without a multi-cluster management module, and only needs to be deployed in the main Kubernetes, and each Kubernetes cluster is not required to be deployed.
In addition, by adopting the resource processing method, the fault self-healing capability in the service processing process is strong, the change of the CR resource and the Pod resource of the cluster can be perceived in real time due to the monitoring mode adopted by the operator, and the corresponding strategy is adopted according to the change, so that the fault Pod is replaced by the Pod with the same name, the operation is convenient, and the problem of naming index is not needed to be considered.
In an exemplary embodiment, there is also provided a resource processing system including:
a first server cluster for storing resources;
the target resource management module is used for monitoring update messages of resources in the first server cluster, wherein the resources are used for managing a group of instance objects according to an expected state, and the target resource management module is a resource management module with unique processing authority in a plurality of resource management modules;
the target resource management module is further configured to select at least one third server cluster from the plurality of second server clusters according to resource usage conditions of the plurality of second server clusters when the update message indicates that the resource changes;
the at least one third server cluster is configured to manage a target instance object according to the update message, where the set of instance objects includes the target instance object, where the target instance object is an instance object determined according to the updated resource, and the target instance objects in different third server clusters have unique identifiers respectively.
As an alternative, the resource comprises a custom resource CR generated based on a service creation request.
As an alternative, the target resource management module includes:
a first monitoring unit, configured to monitor a first resource type of a resource to be processed in the first server cluster;
the first obtaining unit is used for obtaining the update message of the resources in the first server cluster under the condition that the first resource type is the same as the current allowed processing target resource type and the unique processing authority is obtained.
As an alternative, the system is configured to manage the target instance object in the at least one third server cluster according to the update message by:
obtaining the update message from the first server cluster, wherein the update message indicates that the resource has updated at least one of: newly building the target instance object, modifying the target instance object, and deleting the target instance object;
based on the update message, the target instance object in the at least one third server cluster is managed.
As an alternative, the system is configured to manage the target instance object in the at least one third server cluster based on the update message by at least one of:
Creating a new target instance object in the at least one third server cluster if the update message indicates that the target instance object needs to be newly created;
modifying the created target instance object in the at least one third server cluster, in case the update message indicates that the target instance object needs to be modified;
and deleting the created target instance object in the at least one third server cluster in case the update message indicates that the target instance object needs to be deleted.
As an alternative, the system is configured to manage, in the at least one third server cluster, a target instance object according to the update message, by including:
monitoring the current state of the target instance object in the third server cluster under the condition that the target instance object is created, and obtaining a state result;
and when the state result shows that the current state is different from the expected state, adjusting the target instance object according to the expected state.
As an alternative, the system is configured to adjust the target instance object according to the expected state when the state result indicates that the current state is different from the expected state by:
Selecting a fourth server cluster from the plurality of second server clusters when the state result indicates that a first instance object in the target instance object is in an abnormal state, wherein the first instance object is any instance object in the target instance object;
creating a second instance object in the fourth server cluster, and deleting the first instance object in the third server cluster, wherein the second instance object has the same identification as the first instance object.
As an alternative, the system is configured to adjust the target instance object according to the expected state when the state result indicates that the current state is different from the expected state by:
selecting a fifth server cluster from the plurality of second server clusters when the state result indicates that the third server cluster in which the target instance object is located is in a fault state;
and in the fifth server cluster, recreating an instance object in a third server cluster in a fault state, and deleting the instance object in the third server cluster, wherein the instance object in the fifth server cluster and the instance object in the third server cluster in the fault state have the same identification.
FIG. 5 is a block diagram of a resource processing device, according to an example embodiment. Referring to fig. 5, the apparatus includes a listening module 502, a selection module 504, and a management module 506.
The monitoring module 502 is configured to monitor an update message of a resource in a first server cluster, where the first server cluster is configured to store the resource, the resource is configured to manage a set of instance objects according to an expected state, and the target resource management module is a resource management module with unique processing rights in a plurality of resource management modules;
the selection module 504 is configured to select at least one third server cluster from the plurality of second server clusters according to the resource usage status of the plurality of second server clusters when the update message indicates that the resource has changed;
the management module 506 is configured to manage, in the at least one third server cluster, a target instance object according to the update message, where the set of instance objects includes the target instance object, where the target instance object is an instance object determined according to the updated resource, and the target instance objects in different third server clusters have unique identifiers respectively.
As an alternative, the resource comprises a custom resource CR generated based on a service creation request.
As an alternative, the above device is configured to monitor update messages of resources in the first server cluster by: monitoring a first resource type of a resource to be processed in the first server cluster; and acquiring an update message of the resource in the first server cluster under the condition that the first resource type is determined to be the same as the current allowed processing target resource type and the unique processing authority is acquired.
As an alternative, the above apparatus is configured to manage, in the at least one third server cluster, the target instance object according to the update message by: obtaining the update information from the first server cluster, wherein the update information indicates that the resource has updated at least one of: newly building the target instance object, modifying the target instance object, and deleting the target instance object; and managing the target instance object in the at least one third server cluster based on the updated information.
As an alternative, the above apparatus is configured to manage the target instance object in the at least one third server cluster based on the update information by at least one of: creating a new target instance object in the at least one third server cluster if the update information indicates that the target instance object needs to be newly created; modifying the created target instance object in the at least one third server cluster, in case the update information indicates that the target instance object needs to be modified; and deleting the created target instance object in the at least one third server cluster in case the update information indicates that the target instance object needs to be deleted.
As an alternative, the above apparatus is configured to adjust the target instance object in at least one third server cluster according to the update message by: monitoring the current state of the target instance object in the third server cluster under the condition that the target instance object is created, and obtaining a state result; and when the state result shows that the current state is different from the expected state, adjusting the target instance object according to the expected state.
As an alternative, the above device is configured to adjust the target instance object according to the expected state when the state result indicates that the current state is different from the expected state by: selecting a fourth server cluster from the plurality of second server clusters when the state result indicates that a first instance object in the target instance object is in an abnormal state, wherein the first instance object is any instance object in the target instance object; creating a second instance object in the fourth server cluster, and deleting the first instance object in the third server cluster, wherein the second instance object has the same identification as the first instance object.
As an alternative, the above device is configured to adjust the target instance object according to the expected state when the state result indicates that the current state is different from the expected state by: selecting a fifth server cluster from the plurality of second server clusters when the state result indicates that the third server cluster in which the target instance object is located is in a fault state; and in the fifth server cluster, recreating an instance object in a third server cluster in a fault state, and deleting the instance object in the third server cluster, wherein the instance object in the fifth server cluster and the instance object in the third server cluster in the fault state have the same identification.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
With respect to the apparatus in the above embodiments, any of the steps described above may be performed by including, but not limited to, using the same or different modules.
FIG. 6 is a block diagram of an electronic device for resource processing, according to an example embodiment. As shown in fig. 6, the electronic device includes a processor 620 and a memory 610 for storing the processor-executable instructions described above. The processor is configured to execute instructions to implement the resource processing method described above. The electronic device in this embodiment may further comprise a transmission means 630, a display 640 and a connection bus 650. The transmission means 630 is used for receiving or transmitting data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 630 includes a network adapter (Network Interface Controller, NIC) that may be connected to other network devices and routers via a network cable to communicate with the internet or a local area network. In one example, the transmission device 630 is a Radio Frequency (RF) module, which is used to communicate with the internet wirelessly. The display 640 is used for displaying the original image and the target image; the connection bus 650 is used to connect the respective module components in the electronic device.
In an exemplary embodiment, a storage medium is also provided, such as a memory 610, including instructions executable by the processor 620 of the electronic device to perform the above-described method. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, comprising a computer program/instruction which, when executed by a processor, implements the above-described information transmission method.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (21)

1. A resource processing method, applied to a target resource management module, comprising:
monitoring an update message of a resource in a first server cluster, wherein the first server cluster is used for storing the resource, the resource is used for managing a group of instance objects according to an expected state, the target resource management module is a resource management module with unique processing authority in a plurality of resource management modules, and the target resource management module has a corresponding relation with the first server cluster;
when the update message indicates that the resource is changed, selecting at least one third server cluster from the plurality of second server clusters according to the resource use condition of the plurality of second server clusters;
managing target instance objects in the at least one third server cluster according to the update message, wherein the group of instance objects comprises the target instance objects, the target instance objects are instance objects determined according to the updated resources, and the target instance objects in different third server clusters respectively have unique identifications;
Said managing, in said at least one third server cluster, a target instance object according to said update message, comprising: monitoring the current state of the target instance object in the third server cluster under the condition that the target instance object is created, obtaining a state result, and adjusting the target instance object according to the expected state when the state result indicates that the current state is different from the expected state;
and when the state result indicates that the current state is different from the expected state, adjusting the target instance object according to the expected state, including: and if the state result indicates that a first instance object in the target instance object is in an abnormal state, selecting a fourth server cluster from the plurality of second server clusters, wherein the first instance object is any instance object in the target instance object, creating a second instance object in the fourth server cluster, and deleting the first instance object in the third server cluster, wherein the second instance object and the first instance object have the same identification.
2. The method of claim 1, wherein the resources comprise custom resources CR generated based on service creation requests.
3. The method of claim 1, wherein listening for an update message of a resource in the first server cluster comprises:
monitoring a first resource type of a resource to be processed in the first server cluster;
and acquiring an update message of the resource in the first server cluster under the condition that the first resource type is determined to be the same as the current allowed processing target resource type and the unique processing authority is acquired.
4. The method of claim 1, wherein managing target instance objects in the at least one third server cluster according to the update message comprises:
obtaining the update message from the first server cluster, wherein the update message indicates that the resource has updated at least one of: newly building the target instance object, modifying the target instance object, and deleting the target instance object;
based on the update message, the target instance object in the at least one third server cluster is managed.
5. The method of claim 4, wherein managing the target instance object in the at least one third server cluster based on the update message comprises at least one of:
creating a new target instance object in the at least one third server cluster if the update message indicates that the target instance object needs to be newly created;
modifying the created target instance object in the at least one third server cluster, in case the update message indicates that the target instance object needs to be modified;
and deleting the created target instance object in the at least one third server cluster in case the update message indicates that the target instance object needs to be deleted.
6. The method of claim 1, wherein adjusting the target instance object according to the expected state when the state result indicates that the current state is different from the expected state comprises:
selecting a fifth server cluster from the plurality of second server clusters when the state result indicates that the third server cluster in which the target instance object is located is in a fault state;
And in the fifth server cluster, recreating an instance object in a third server cluster in a fault state, and deleting the instance object in the third server cluster, wherein the instance object in the fifth server cluster and the instance object in the third server cluster in the fault state have the same identification.
7. A resource processing system, comprising:
a first server cluster for storing resources;
the target resource management module is used for monitoring update messages of resources in the first server cluster, wherein the resources are used for managing a group of instance objects according to an expected state, the target resource management module is a resource management module with unique processing authority in a plurality of resource management modules, and the target resource management module has a corresponding relation with the first server cluster;
the target resource management module is further configured to select at least one third server cluster from the plurality of second server clusters according to resource usage conditions of the plurality of second server clusters when the update message indicates that the resource changes;
the at least one third server cluster is configured to manage a target instance object according to the update message, where the set of instance objects includes the target instance object, where the target instance object is an instance object determined according to the updated resource, and the target instance objects in different third server clusters have unique identifiers respectively;
Managing, in the at least one third server cluster, a target instance object according to the update message, including: monitoring the current state of the target instance object in the third server cluster under the condition that the target instance object is created, obtaining a state result, and adjusting the target instance object according to the expected state when the state result indicates that the current state is different from the expected state;
and when the state result indicates that the current state is different from the expected state, adjusting the target instance object according to the expected state, including: and if the state result indicates that a first instance object in the target instance object is in an abnormal state, selecting a fourth server cluster from the plurality of second server clusters, wherein the first instance object is any instance object in the target instance object, creating a second instance object in the fourth server cluster, and deleting the first instance object in the third server cluster, wherein the second instance object and the first instance object have the same identification.
8. The system of claim 7, wherein the resources comprise custom resources CR generated based on service creation requests.
9. The system of claim 7, wherein the target resource management module comprises:
a first monitoring unit, configured to monitor a first resource type of a resource to be processed in the first server cluster;
the first obtaining unit is used for obtaining the update message of the resources in the first server cluster under the condition that the first resource type is the same as the current allowed processing target resource type and the unique processing authority is obtained.
10. The system of claim 7, wherein the system is configured to manage target instance objects in the at least one third server cluster according to the update message by:
obtaining the update message from the first server cluster, wherein the update message indicates that the resource has updated at least one of: newly building the target instance object, modifying the target instance object, and deleting the target instance object;
based on the update message, the target instance object in the at least one third server cluster is managed.
11. The system of claim 10, wherein the system is configured to manage the target instance object in the at least one third server cluster based on the update message by at least one of:
creating a new target instance object in the at least one third server cluster if the update message indicates that the target instance object needs to be newly created;
modifying the created target instance object in the at least one third server cluster, in case the update message indicates that the target instance object needs to be modified;
and deleting the created target instance object in the at least one third server cluster in case the update message indicates that the target instance object needs to be deleted.
12. The system of claim 7, wherein the system is configured to adjust the target instance object according to the expected state when the state result indicates that the current state is different from the expected state by:
selecting a fifth server cluster from the plurality of second server clusters when the state result indicates that the third server cluster in which the target instance object is located is in a fault state;
And in the fifth server cluster, recreating an instance object in a third server cluster in a fault state, and deleting the instance object in the third server cluster, wherein the instance object in the fifth server cluster and the instance object in the third server cluster in the fault state have the same identification.
13. A resource processing apparatus, comprising:
the system comprises a monitoring module, a target resource management module and a first server cluster, wherein the monitoring module is used for monitoring update messages of resources in the first server cluster, the first server cluster is used for storing the resources, the resources are used for managing a group of instance objects according to an expected state, the target resource management module is a resource management module with unique processing authority in a plurality of resource management modules, and the target resource management module has a corresponding relation with the first server cluster;
a selection module, configured to select at least one third server cluster from the plurality of second server clusters according to a resource usage status of the plurality of second server clusters when the update message indicates that the resource is changed;
a management module, configured to manage, in the at least one third server cluster, a target instance object according to the update message, where the set of instance objects includes the target instance object, the target instance object is an instance object determined according to the updated resource, and the target instance objects in different third server clusters have unique identifiers respectively;
The apparatus is configured to manage a target instance object according to the update message in the at least one third server cluster by: monitoring the current state of the target instance object in the third server cluster under the condition that the target instance object is created, obtaining a state result, and adjusting the target instance object according to the expected state when the state result indicates that the current state is different from the expected state;
the device is used for adjusting the target instance object according to the expected state when the state result indicates that the current state is different from the expected state by the following steps: and if the state result indicates that a first instance object in the target instance object is in an abnormal state, selecting a fourth server cluster from the plurality of second server clusters, wherein the first instance object is any instance object in the target instance object, creating a second instance object in the fourth server cluster, and deleting the first instance object in the third server cluster, wherein the second instance object and the first instance object have the same identification.
14. The apparatus of claim 13, wherein the resources comprise custom resources CR generated based on service creation requests.
15. The apparatus of claim 13, wherein the listening module comprises:
a second monitoring unit, configured to monitor a first resource type of a resource to be processed in the first server cluster;
and the second acquisition unit is used for acquiring the update message of the resources in the first server cluster under the condition that the first resource type is determined to be the same as the current allowed processing target resource type and the unique processing authority is acquired.
16. The apparatus according to claim 13, wherein the apparatus is configured to manage a target instance object according to the update message in the at least one third server cluster by:
obtaining the update message from the first server cluster, wherein the update message indicates that the resource has updated at least one of: newly building the target instance object, modifying the target instance object, and deleting the target instance object;
based on the update message, the target instance object in the at least one third server cluster is managed.
17. The apparatus of claim 16, wherein the apparatus is configured to manage the target instance object in the at least one third server cluster based on the update message by at least one of:
creating a new target instance object in the at least one third server cluster if the update message indicates that the target instance object needs to be newly created;
modifying the created target instance object in the at least one third server cluster, in case the update message indicates that the target instance object needs to be modified;
and deleting the created target instance object in the at least one third server cluster in case the update message indicates that the target instance object needs to be deleted.
18. The apparatus of claim 13, wherein the apparatus is configured to adjust the target instance object according to the expected state when the state result indicates that the current state is different from the expected state by:
selecting a fifth server cluster from the plurality of second server clusters when the state result indicates that the third server cluster in which the target instance object is located is in a fault state;
And in the fifth server cluster, recreating an instance object in a third server cluster in a fault state, and deleting the instance object in the third server cluster, wherein the instance object in the fifth server cluster and the instance object in the third server cluster in the fault state have the same identification.
19. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the resource processing method of any of claims 1 to 6.
20. A computer readable storage medium, characterized in that instructions in the computer readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the resource processing method of any one of claims 1 to 6.
21. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the resource processing method of any of claims 1 to 6.
CN202110991387.1A 2021-08-26 2021-08-26 Resource processing method and device, electronic equipment and storage medium Active CN113778623B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110991387.1A CN113778623B (en) 2021-08-26 2021-08-26 Resource processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110991387.1A CN113778623B (en) 2021-08-26 2021-08-26 Resource processing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113778623A CN113778623A (en) 2021-12-10
CN113778623B true CN113778623B (en) 2024-04-16

Family

ID=78839726

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110991387.1A Active CN113778623B (en) 2021-08-26 2021-08-26 Resource processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113778623B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114363175A (en) * 2022-03-01 2022-04-15 北京金山云网络技术有限公司 Cluster monitoring method and device and electronic equipment
CN114884668A (en) * 2022-03-17 2022-08-09 阿里巴巴(中国)有限公司 Resource management method and computer-readable storage medium
CN114936048B (en) * 2022-05-10 2024-03-19 北京达佳互联信息技术有限公司 Configuration management method, device, electronic equipment and storage medium
CN115277652B (en) * 2022-06-29 2024-03-22 北京百度网讯科技有限公司 Streaming media processing method and device based on reasoning service and electronic equipment
CN115396290B (en) * 2022-06-29 2023-11-17 北京车网科技发展有限公司 Automatic fault recovery method, device and service system
CN115623008B (en) * 2022-11-14 2023-04-07 杭州谐云科技有限公司 Index construction method and system of Kubernetes resources

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111277460A (en) * 2020-01-17 2020-06-12 江苏满运软件科技有限公司 ZooKeeper containerization control method and device, storage medium and electronic equipment
CN111405055A (en) * 2020-03-23 2020-07-10 北京达佳互联信息技术有限公司 Multi-cluster management method, system, server and storage medium
CN112104723A (en) * 2020-09-07 2020-12-18 腾讯科技(深圳)有限公司 Multi-cluster data processing system and method
CN112905306A (en) * 2021-03-29 2021-06-04 建信金融科技有限责任公司 Multi-cluster container management method and device, electronic equipment and storage medium
CN113031874A (en) * 2021-03-26 2021-06-25 网易(杭州)网络有限公司 Cache processing method, device, equipment and storage medium based on Kubernetes cluster

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111277460A (en) * 2020-01-17 2020-06-12 江苏满运软件科技有限公司 ZooKeeper containerization control method and device, storage medium and electronic equipment
CN111405055A (en) * 2020-03-23 2020-07-10 北京达佳互联信息技术有限公司 Multi-cluster management method, system, server and storage medium
CN112104723A (en) * 2020-09-07 2020-12-18 腾讯科技(深圳)有限公司 Multi-cluster data processing system and method
CN113031874A (en) * 2021-03-26 2021-06-25 网易(杭州)网络有限公司 Cache processing method, device, equipment and storage medium based on Kubernetes cluster
CN112905306A (en) * 2021-03-29 2021-06-04 建信金融科技有限责任公司 Multi-cluster container management method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113778623A (en) 2021-12-10

Similar Documents

Publication Publication Date Title
CN113778623B (en) Resource processing method and device, electronic equipment and storage medium
US10887404B2 (en) Method and apparatus for virtualized network function chaining management
US10644952B2 (en) VNF failover method and apparatus
CN107534570B (en) Computer system, method and medium for virtualized network function monitoring
US9515952B2 (en) Method of and system for managing computing resources
EP2796996B1 (en) Cloud infrastructure based management system and method for performing maintenance and deployment for application system
US10511506B2 (en) Method and device for managing virtualized network function
CN106301876B (en) Physical machine upgrade method, business migration method and device
CN111277432B (en) Configuration information updating method and device, electronic equipment and storage medium
CN113742031B (en) Node state information acquisition method and device, electronic equipment and readable storage medium
CN110708188A (en) Method and device for creating network slice based on SLA
CN104243515A (en) Method and device for processing configuration information
CN111064626B (en) Configuration updating method, device, server and readable storage medium
CN111970354A (en) Application management method in edge calculation and related device
EP3457668B1 (en) Clustering in unified communication and collaboration services
CN110932914A (en) Deployment method, deployment device, hybrid cloud system architecture and computer storage medium
CN110609656A (en) Storage management method, electronic device and computer program product
CN111078238A (en) Centralized processing method and device for application configuration in container environment
CN111897643A (en) Thread pool configuration system, method, device and storage medium
CN113824801B (en) Intelligent integration terminal unified access management component system
CN115543793A (en) System deployment method and device of target server and operation and maintenance center station
CN111061723A (en) Workflow implementation method and device
CN111338647B (en) Big data cluster management method and device
CN112910796A (en) Traffic management method, apparatus, device, storage medium, and program product
CN110896358A (en) Dynamic updating method and device for resource data in NFV

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant