CN112988266A - Resource management method and device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN112988266A
CN112988266A CN202110184724.6A CN202110184724A CN112988266A CN 112988266 A CN112988266 A CN 112988266A CN 202110184724 A CN202110184724 A CN 202110184724A CN 112988266 A CN112988266 A CN 112988266A
Authority
CN
China
Prior art keywords
resource
target resource
target
declaration
configuration
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.)
Granted
Application number
CN202110184724.6A
Other languages
Chinese (zh)
Other versions
CN112988266B (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 QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and 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 QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202110184724.6A priority Critical patent/CN112988266B/en
Publication of CN112988266A publication Critical patent/CN112988266A/en
Application granted granted Critical
Publication of CN112988266B publication Critical patent/CN112988266B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3006Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention provides a resource management method, a resource management device, electronic equipment and a storage medium, which are applied to the technical field of information. When a declaration event of a target resource is detected, the resource declaration is created for the target resource according to each resource having an association relation with the target resource, so that deployment personnel do not need to manually create the resource declaration one by one, and the problem of high human resource consumption in the prior art is solved.

Description

Resource management method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of information technologies, and in particular, to a resource management method and apparatus, an electronic device, and a storage medium.
Background
More and more companies deploy services in kubernets based container management systems. Since the idio can manage a plurality of micro services deployed on Kubernets, the idio is deployed while the kubernets are deployed.
The inventor finds that when kubernets deploy and release one application in a gray scale mode, a plurality of resources (resource, VirtualService, DestinationRule, Gateway in the resource, Deployment, Service, etc.) need to be declared. Currently, declaring multiple resources also requires a worker to manually create and declare the resources one by one.
Disclosure of Invention
An embodiment of the present invention provides a resource management method, a resource management apparatus, an electronic device, and a storage medium, so as to solve the problem in the prior art that human resources are consumed too much when a resource is declared.
In a first aspect of the present invention, there is provided a resource management method applied to a container management system, where the method includes:
determining target resources, wherein the target resources have an incidence relation with resources built in a container management system and resources of micro-services to be deployed;
and when a declaration event of the target resource is detected, creating a resource declaration for the target resource according to each resource which has an association relation with the target resource.
Optionally, the method further includes:
monitoring the target resource based on the declaration configuration of the target resource; the declaration configuration of the target resource comprises configuration parameters required by the normal operation of the microservice;
and if the monitored resource which is inconsistent with the declaration configuration of the target resource exists, modifying the monitored resource according to the declaration configuration of the target resource.
Optionally, if it is monitored that there is a resource inconsistent with the declaration configuration of the target resource, modifying the monitored resource according to the declaration configuration of the target resource, including:
when each resource which is declared and has an association relation with the target resource is called, if the resource which is inconsistent with the declaration configuration of the target resource is monitored, the monitored resource is corrected according to the declaration configuration of the target resource.
Optionally, if it is monitored that there is a resource inconsistent with the declaration configuration of the target resource, modifying the monitored resource according to the declaration configuration of the target resource, including:
when detecting that each resource of the declaration, which has an association relation with the target resource, is modified, if the resource inconsistent with the declaration configuration of the target resource is monitored, modifying the monitored resource according to the declaration configuration of the target resource.
Optionally, if it is monitored that there is a resource inconsistent with the declaration configuration of the target resource, modifying the monitored resource according to the declaration configuration of the target resource, including:
when the controller detects that each declared resource having an association relation with the target resource is deleted, the deleted resource is declared according to the declaration configuration of the target resource.
Optionally, before determining the target resource, the method further includes:
in a container management system, creating a project;
in the created project, the created target resource and a controller corresponding to the target resource;
and when the project is started, loading each resource which has an association relation with the target resource into the running environment.
Optionally, after determining the target resource and the controller corresponding to the target resource, the method further includes:
and setting the target resource as a parent-level resource according to the association relationship, and setting the resources built in the container management system and the resources of the micro-service to be deployed as child-level resources of the target resource.
In a second aspect of the present invention, there is also provided a resource management system applied to a container management system, including:
the system comprises a resource determining module, a resource determining module and a deploying module, wherein the resource determining module is used for determining target resources in a preset container management system, and the target resources have an incidence relation with resources built in the container management system and resources of micro services to be deployed;
and the declaration creating module is used for creating a resource declaration for the target resource according to each resource which has an association relation with the target resource when the declaration event of the target resource is detected.
Optionally, the apparatus further comprises:
the resource monitoring module is used for monitoring the target resource based on the declaration configuration of the target resource; the declaration configuration of the target resource comprises configuration parameters required by the normal operation of the microservice;
and the declaration modification module is used for modifying the monitored resource according to the declaration configuration of the target resource if the resource inconsistent with the declaration configuration of the target resource is monitored.
Optionally, the statement modification module includes:
and the sub-level resource declaration modification sub-module is used for modifying the monitored resources according to the declaration configuration of the target resources if the resources inconsistent with the declaration configuration of the target resources are monitored when the declared resources having the association relation with the target resources are called.
Optionally, the statement modification module includes:
and the inconsistent modification submodule is used for modifying the monitored resources according to the declaration configuration of the target resources if the resources inconsistent with the declaration configuration of the target resources are monitored when detecting that the declared resources which have the association relation with the target resources are modified.
Optionally, the statement modification module includes:
and the resource deleting submodule is used for declaring the deleted resources according to the declaration configuration of the target resources when the controller detects that the declared resources which have the association relation with the target resources are deleted.
Optionally, the apparatus further comprises:
the project creating module is used for creating projects in the container management system;
the resource introducing module is used for creating a target resource and a controller corresponding to the target resource in the created project;
and the resource loading module is used for loading each resource which has an association relation with the target resource into the running environment when the project is started.
Optionally, the apparatus further comprises:
and the parent-child level setting module is used for setting the target resource as a parent level resource according to the association relation and setting the resource built in the container management system and the resource of the micro service to be deployed as a child level resource of the target resource.
In another aspect of the present invention, an electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing any resource management method when executing the computer program stored in the memory.
In yet another aspect of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, and the computer program is executed by a processor to implement any of the above resource management methods.
In yet another aspect of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the above-described resource management methods.
According to the resource management method, the resource management device, the electronic equipment and the storage medium, the target resource is determined, and when the declaration event of the target resource is detected, the resource declaration is created for the target resource according to the resources with the incidence relation with the target resource. When a declaration event of a target resource is detected, the resource declaration is created for the target resource according to each resource having an association relation with the target resource, so that deployment personnel do not need to manually create the resource declaration one by one, and the problem of high human resource consumption in the prior art is solved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a schematic flowchart of a resource management method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of modifying resource attributes according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a target resource and a corresponding controller for generating a microservice according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a resource management system according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a resource management apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
Kubernets, K8s for short, is an open source for managing containerized applications on multiple hosts in a cloud platform, and provides a mechanism for application deployment, planning, updating, and maintenance.
The Istio provides an open-source platform for the existing service network, and can isolate the modules of connection, safety, control and observation from the application program or service.
In order to solve the problem that in the prior art, when one application is deployed in Kubernets, deployment personnel need to manually declare a plurality of resources in the Istio, so that the consumption of human resources is high, the invention provides a resource management method, which is applied to a container management system and comprises the following steps:
determining target resources, wherein the target resources have an incidence relation with resources built in a container management system and resources of micro-services to be deployed;
and when a declaration event of the target resource is detected, creating a resource declaration for the target resource according to each resource which has an association relation with the target resource.
Therefore, by the resource management method, when a declaration event of the target resource is detected, the resource declaration can be created for the target resource according to the resources having the association relation with the target resource, so that deployment personnel do not need to manually create the resource declaration one by one, and the problem of high human resource consumption in resource declaration in the prior art is solved.
Referring to fig. 1, fig. 1 is a schematic flow chart of a resource management method provided by an embodiment of the present invention, and the method is applied to a container management system, and includes:
step S11, the target resource is determined.
The target resource and the resources built in the container management system and the resources of the micro-service to be deployed have an association relationship, so that all the resources required by the deployment of the specified micro-service can be determined by determining the target resource.
In order to facilitate the resource deployment work of the micro service to be deployed at one time, the target resource and the specified resource built in the container management system and the resource of the specified micro service to be deployed have a parent-child association relationship. In an actual use process, when the resource management method provided by the embodiment of the invention is applied to kubernets and the specified micro Service to be deployed is Istio, a parent-child association relationship exists between the target resource and a resource Deployment and a resource Service which are built in the kubernets, and a parent-child association relationship exists between the target resource and a resource Virtualservice, a resource Destinationrule and a resource Gateway of the Istio micro Service. Further, when it is detected that a specified micro-service is deployed, deployment of the parent resource and all child resources associated with the parent resource can be achieved by deploying the target resource, i.e., the parent resource.
Optionally, in the embodiment of the present invention, the setting of the parent-child association relationship may be completed before the step of declaring the target resource. The embodiment of the present invention proposes to execute the operation after determining the target resource, and specifically, the operation is implemented by the following steps:
and setting the target resource as a parent resource according to the association relationship, and setting both the resource built in the container management system and the resource of the micro service to be deployed as child resources of the target resource.
Further, the target resource may also be a resource that is needed when the specified microservice is deployed. Specifically, since some micro services need some resources built in the container management system in addition to their own resources, the resources required for deploying a specific micro service at least include the resources of the specific micro service, and may also include the specific resources built in the container management system. For ease of understanding, an implementation is enumerated here, for example, when deploying the micro Service Istio in Kubernets, the micro Service Istio needs at least the built-in resource Deployment, Service of Kubernets in addition to the required own resources VirtualService, DestinationRule, Gateway.
The resource management method of the embodiment of the invention is applied to the container management system, so that the resource management method can be executed by a device corresponding to the container management system, and specifically can be a computer or a server and the like.
Step S12, when the declaration event of the target resource is detected, a resource declaration is created for the target resource according to each resource having an association relation with the target resource.
Before step S12, the method further includes: determining a Controller corresponding to the target resource; the operation of creating the resource declaration at this time is specifically to create, by the controller, the resource declaration for the target resource according to each resource having an association relationship with the target resource.
In the actual use process, kubernets manage the Deployment of corresponding resources by declaring configuration files, for example, when a Deployment resource is declared, an application service named nginx-Deployment nt is deployed in a kubernets cluster, the service image is nginx:1.14.2, and 3 copies are run in the cluster at the same time.
Therefore, by the resource management method, when a declaration event of the target resource is detected, the controller can create the resource declaration for the target resource according to the resources having the association relation with the target resource, so that deployment personnel do not need to manually create the resource declaration one by one, and the problem of high human resource consumption in the prior art is solved.
Optionally, referring to fig. 2, the method further includes:
step S21, monitoring the target resource based on the declaration configuration of the target resource.
Step S22, if it is monitored that there is a resource inconsistent with the declaration configuration of the target resource, modifying the monitored resource according to the declaration configuration of the target resource.
And monitoring the consistency of the resource declaration of the resource and the declaration configuration data of the resource, wherein the aim is to ensure that the micro-service supported by the resource works normally. Wherein the resource declaration of the monitoring resource is the running data of the resource. Therefore, if the third party is detected to modify the resource declaration of the resource, a corresponding reminding notice can be sent out, if the modification is not detected, but the resource inconsistent with the declaration configuration is monitored, the monitored resource can be modified directly according to the declaration configuration, all the resources can be operated according to the declaration configuration corresponding to the resource, and the normal operation of the microservice is supported.
In the embodiment of the present invention, the target resource may be monitored according to a fixed period, for example, whether a resource inconsistent with the declared configuration of the target resource exists is determined every hour; or monitoring according to a preset time point, for example, detecting whether a resource inconsistent with the declaration configuration of the target resource exists on the day of holiday; after receiving a request for calling the resource, or detecting whether the resource inconsistent with the declaration configuration of the target resource exists or not while the resource is called; it can also be detected that the declaration configuration corresponding to the resource is modified or upgraded, and it is detected whether the current resource declaration of the resource is consistent with the modified/updated declaration configuration.
In the embodiment of the present invention, the monitored resource is modified, such that the resource declaration of the resource is adjusted to the declaration configuration of the resource, and the resource is declared again.
For example, when the Controller monitors that the resource declaration of the target resource is called, the declaration configuration of the resource is pulled from the cluster, and the declaration configuration is matched with each resource having an association relationship with the target resource, so as to determine whether the declaration configuration of the target resource is consistent with the resource declaration of the target resource. And if not, modifying the resource declaration of the target resource to be consistent according to the declaration configuration of the target resource.
For another example, when the resource declaration of the target resource is deleted, the Controller receives an event trigger that the resource declaration of the target resource is deleted, and re-declares the deleted resource to ensure that the service state of the resource, such as the declaration configuration, is consistent.
Therefore, according to the resource management method provided by the embodiment of the invention, when the declared target resource is inconsistent with the declaration configuration of each resource having an association relation with the target resource, the resource declaration of the target resource is corrected according to the declaration configuration of the target resource, so that the problem of application operation failure caused by inconsistency of the operation state and the declaration configuration of the target resource is prevented, and the stability in the application operation process is improved.
In addition, referring to fig. 3, an embodiment of the present invention further provides a method for generating a target resource of a microservice and a controller corresponding to the target resource, where the method includes:
and S31, creating a new project.
S32, in the created project, a target resource and a controller corresponding to the target resource are newly created.
When the embodiment of the present invention is applied to kubernets, an Operator (project) may be created using an open source toolkit, and a new API (Application Programming Interface) and a new kid (resource type) are added to the created Operator as a target resource, and then a Controller (Controller) for generating a response corresponding to the target resource is generated in the Operator project.
At this time, the new project can be packaged in a mirror image manner, so as to facilitate subsequent deployment in the container management system.
After generating a target resource of a micro service and a controller corresponding to the target resource, an embodiment of the present invention further provides a method for loading a resource, where the method includes:
s33, submitting a declaration file to the container management system, wherein the resource declaration file is automatically configured after the new target resource and the corresponding controller are created, and specifically exists in the framework of the new project. In addition, secondary configuration can be realized by modifying and adjusting the resource declaration file. The resource attribute can be adjusted by modifying a types.go document, and the execution operation corresponding to the monitoring event can be adjusted by modifying a controller.go document.
And S34, loading the resources built in the container management system and the resources of the micro service to be deployed into the running environment through the controller. Because only the resources built in the container management system are in the declaration file, when the resources are loaded, the resources built in the container management system and the resources of the micro-services to be deployed need to be loaded, so that the container management system can identify the resource types of the target resources, the resources required by the micro-services can be accurately deployed, the deployment conditions of the resources of the micro-services can be monitored in time, and corresponding operations can be executed.
In the method for executing resource loading, when the new project is started, specifically, a register function in a function group schemeBuilderVs may be called to load resources of the micro service to be deployed and resources built in the container management system.
When the embodiment of the invention is applied to the cluster Kubernets, an Operator project, a target resource and a controller are created by utilizing an open source toolkit, and a declaration configuration file of yaml suffix is generated at the moment. After the command is submitted to the Kubernets cluster, the cluster can identify the target resource. When the cluster detects a declaration event for the target resource, an event is triggered, so that a Reconfile component in the Controller is called. The Reconfile component firstly analyzes the declaration configuration file, namely firstly determining the target resource, then determining the resource which has an association relation with the target resource based on the target resource, and further determining the attribute of the association resource. Secondly, the Reconcile component determines, for each associated resource, whether the associated resource has been declared and whether the resource declaration of the associated resource is consistent with the configuration parameters of the declaration configuration, and executes, for each instance, the corresponding execution step in the controller. Specifically, for each associated resource, whether the resource is declared is determined according to the attribute of the resource. If not, declaring according to the configuration parameters in the declaration configuration file; if the configuration parameters are declared, whether the declared mirror image packaging file address and the number of copies operated in the cluster are the same as the configuration parameters in the declaration configuration file is judged. If not, adjusting the configuration parameters in the configuration file to be consistent according to the statement; and if the two resources are the same, judging the declaration condition of other associated resources. And finally, the resource declaration of the associated resource corresponding to the target resource is ensured to be consistent with the configuration parameters in the declaration configuration file, so that the normal operation of the micro service corresponding to the target resource is ensured.
Referring to fig. 4, an embodiment of the present invention provides a resource management system, where the system includes: a server for providing an API server 41, a Controller 42, a Client 43, and a Register 44; wherein,
and the server 41 provides a communication interface between the cluster Kubernets and the client, and provides an interactive interface with the controller and the registration module.
And a controller 42 providing for deploying the resource, monitoring an operational status of the resource, and providing services to the client. Wherein, the controller specifically includes: an information component (Informer)421, a recall component (Callback)422, a Queue component (Queue)423, and a mating component (Reconcile) 424. The specific application of the assembly is as follows: the information component is used for monitoring relevant resource events of the self-defined resources from an interface of the platform server; the recall component is used for placing the related resource events of the user-defined resources into a queue in a classified mode; the queue component is used for generating a queue and receiving the related resource event of the user-defined resource sent by the recall component; and the cooperation component is used for consuming the events in the queue component, specifically, detecting whether the running state of the custom resource is consistent with the configuration parameters in the declaration configuration file yaml or not by calling a coordination method register (request) in the controller.
The client 43 provides the server with the requirements and receives the services provided by the controller.
And the registration module 44 provides asynchronous self-defined resources for the server, and declares the self-defined resources to realize the resource declaration required by the microservice.
The present invention also provides a resource management system, referring to fig. 5, including: a resource determining module 501 and a declaration creating module 502;
in a second aspect of the present invention, there is also provided a resource management system applied to a container management system, including:
a resource determining module 501, configured to determine a target resource in a preset container management system, where the target resource has an association relationship with a resource built in the container management system and a resource of a micro service to be deployed;
a declaration creating module 502, configured to, when a declaration event of a target resource is detected, create a resource declaration for the target resource according to each resource having an association relationship with the target resource.
Optionally, the apparatus further comprises:
the resource monitoring module is used for monitoring the target resource based on the declaration configuration of the target resource; the declaration configuration of the target resource comprises configuration parameters required by the normal operation of the microservice;
and the declaration modification module is used for modifying the monitored resource according to the declaration configuration of the target resource if the resource inconsistent with the declaration configuration of the target resource is monitored.
Optionally, the statement modification module includes:
and the sub-level resource declaration modification sub-module is used for modifying the monitored resources according to the declaration configuration of the target resources if the resources inconsistent with the declaration configuration of the target resources are monitored when the declared resources having the association relation with the target resources are called.
Optionally, the statement modification module includes:
and the inconsistent modification submodule is used for modifying the monitored resources according to the declaration configuration of the target resources if the resources inconsistent with the declaration configuration of the target resources are monitored when detecting that the declared resources which have the association relation with the target resources are modified.
Optionally, the statement modification module includes:
and the resource deleting submodule is used for declaring the deleted resources according to the declaration configuration of the target resources when the controller detects that the declared resources which have the association relation with the target resources are deleted.
Optionally, the apparatus further comprises:
the project creating module is used for creating projects in the container management system;
the resource introducing module is used for creating a target resource and a controller corresponding to the target resource in the created project;
and the resource loading module is used for loading each resource which has an association relation with the target resource into the running environment when the project is started.
Optionally, the apparatus further comprises:
and the parent-child level setting module is used for setting the target resource as a parent level resource according to the association relation and setting the resource built in the container management system and the resource of the micro service to be deployed as a child level resource of the target resource.
Therefore, the resource management device provided by the embodiment of the invention can realize that the resource declaration is created for the target resource according to the resources which have the association relation with the target resource when the declaration event of the target resource is detected, so that the resource declaration does not need to be manually created one by deployment personnel, and the problem of high human resource consumption in the resource declaration in the prior art is solved.
An embodiment of the present invention further provides an electronic device, as shown in fig. 6, including a processor 601, a communication interface 602, a memory 603, and a communication bus 604, where the processor, the communication interface, and the memory complete mutual communication through the communication bus,
a memory for storing a computer program;
the processor is used for realizing the following steps when executing the program stored in the memory:
determining target resources, wherein the target resources have an incidence relation with resources built in a container management system and resources of micro-services to be deployed;
and when a declaration event of the target resource is detected, creating a resource declaration for the target resource according to each resource which has an association relation with the target resource.
Optionally, when the processor executes the program stored in the memory, any of the resource management methods described above may be implemented.
The communication bus mentioned in the electronic device may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a RAM (Random Access Memory) or an NVM (Non-Volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
In still another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program is executed by a processor to implement any of the above resource management methods.
In yet another embodiment, the present invention further provides a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the above resource management methods.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (ssd)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, the electronic device, the storage medium, and the computer program product embodiment, since they are substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to part of the description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A resource management method is applied to a container management system, and the method comprises the following steps:
determining a target resource, wherein the target resource has an association relation with a resource built in the container management system and a resource of the micro service to be deployed;
and when a declaration event of the target resource is detected, creating a resource declaration for the target resource according to each resource which has an association relation with the target resource.
2. The method of claim 1, further comprising:
monitoring the target resource based on the declaration configuration of the target resource; wherein, the declaration configuration of the target resource comprises configuration parameters required for normally operating the microservice;
and if the monitored resource which is inconsistent with the declaration configuration of the target resource exists, modifying the monitored resource according to the declaration configuration of the target resource.
3. The method of claim 2, wherein if it is monitored that there is a resource inconsistent with the declared configuration of the target resource, then modifying the monitored resource according to the declared configuration of the target resource comprises:
when each declared resource which has an association relation with the target resource is called, if the fact that the resource which is inconsistent with the declaration configuration of the target resource exists is monitored, the monitored resource is corrected according to the declaration configuration of the target resource.
4. The method of claim 2, wherein if it is monitored that there is a resource inconsistent with the declared configuration of the target resource, then modifying the monitored resource according to the declared configuration of the target resource comprises:
when detecting that each resource which is declared and has an association relation with the target resource is modified, if the fact that the resource which is inconsistent with the declaration configuration of the target resource exists is monitored, modifying the monitored resource according to the declaration configuration of the target resource.
5. The method of claim 2, wherein if it is monitored that there is a resource inconsistent with the declared configuration of the target resource, then modifying the monitored resource according to the declared configuration of the target resource comprises:
when the controller detects that each declared resource which has an association relation with the target resource is deleted, declaring the deleted resource according to the declaration configuration of the target resource.
6. The method of claim 1, wherein prior to the determining the target resource, the method further comprises:
creating, in the container management system, a project;
in the created project, creating a target resource and a controller corresponding to the target resource;
and when the project is started, loading each resource which has an association relation with the target resource into a running environment.
7. The method of claim 6, wherein after the determining the target resource and the controller corresponding to the target resource, the method further comprises:
and setting the target resource as a parent resource according to the association relationship, and setting the resources built in the container management system and the resources of the micro-service to be deployed as child resources of the target resource.
8. A resource management device applied to a container management system includes:
the system comprises a resource determining module, a resource determining module and a deploying module, wherein the resource determining module is used for determining target resources in a preset container management system, and the target resources have an incidence relation with resources built in the container management system and resources of micro services to be deployed;
and the declaration creating module is used for creating a resource declaration for the target resource through the controller according to each resource which has an incidence relation with the target resource when the declaration event of the target resource is detected.
9. An electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1-7 when executing the computer program stored in the memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 7.
CN202110184724.6A 2021-02-10 2021-02-10 Resource management method and device, electronic equipment and storage medium Active CN112988266B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110184724.6A CN112988266B (en) 2021-02-10 2021-02-10 Resource management method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110184724.6A CN112988266B (en) 2021-02-10 2021-02-10 Resource management method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112988266A true CN112988266A (en) 2021-06-18
CN112988266B CN112988266B (en) 2024-04-19

Family

ID=76393057

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110184724.6A Active CN112988266B (en) 2021-02-10 2021-02-10 Resource management method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112988266B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115437610A (en) * 2022-09-14 2022-12-06 中国电信股份有限公司 Method and device for realizing observability, readable storage medium and electronic equipment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6006028A (en) * 1993-05-18 1999-12-21 International Business Machines Corporation Test program generator
US20070234359A1 (en) * 2006-03-30 2007-10-04 Microsoft Corporation Isolation of application execution
CN102567175A (en) * 2010-12-08 2012-07-11 中国科学院声学研究所 Application safety monitoring method and system based on resource declaration
US20120222115A1 (en) * 2011-02-24 2012-08-30 International Business Machines Corporation Using a declaration of security requirements to determine whether to permit application operations
US20120246316A1 (en) * 2011-03-22 2012-09-27 Ramu Jagadish P Automatic Registration of Enterprise Resources in a Dynamic Module System Services Registry
CN105279005A (en) * 2015-11-30 2016-01-27 北京奇艺世纪科技有限公司 Application software updating method and device
CN105493033A (en) * 2013-06-02 2016-04-13 微软技术许可有限责任公司 Declarative configuration elements
CN109800030A (en) * 2019-01-14 2019-05-24 腾讯科技(深圳)有限公司 A kind of application program operation method, device and terminal
CN110888736A (en) * 2019-11-15 2020-03-17 北京浪潮数据技术有限公司 Application management method and system based on container cloud platform and related components
CN112083968A (en) * 2020-08-27 2020-12-15 腾讯科技(深圳)有限公司 Plug-in loading method and device in host

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6006028A (en) * 1993-05-18 1999-12-21 International Business Machines Corporation Test program generator
US20070234359A1 (en) * 2006-03-30 2007-10-04 Microsoft Corporation Isolation of application execution
CN102567175A (en) * 2010-12-08 2012-07-11 中国科学院声学研究所 Application safety monitoring method and system based on resource declaration
US20120222115A1 (en) * 2011-02-24 2012-08-30 International Business Machines Corporation Using a declaration of security requirements to determine whether to permit application operations
US20120246316A1 (en) * 2011-03-22 2012-09-27 Ramu Jagadish P Automatic Registration of Enterprise Resources in a Dynamic Module System Services Registry
CN105493033A (en) * 2013-06-02 2016-04-13 微软技术许可有限责任公司 Declarative configuration elements
CN105279005A (en) * 2015-11-30 2016-01-27 北京奇艺世纪科技有限公司 Application software updating method and device
CN109800030A (en) * 2019-01-14 2019-05-24 腾讯科技(深圳)有限公司 A kind of application program operation method, device and terminal
CN110888736A (en) * 2019-11-15 2020-03-17 北京浪潮数据技术有限公司 Application management method and system based on container cloud platform and related components
CN112083968A (en) * 2020-08-27 2020-12-15 腾讯科技(深圳)有限公司 Plug-in loading method and device in host

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115437610A (en) * 2022-09-14 2022-12-06 中国电信股份有限公司 Method and device for realizing observability, readable storage medium and electronic equipment

Also Published As

Publication number Publication date
CN112988266B (en) 2024-04-19

Similar Documents

Publication Publication Date Title
US8972963B2 (en) End-to-end patch automation and integration
US20150067167A1 (en) Hot pluggable extensions for access management system
US11061669B2 (en) Software development tool integration and monitoring
CN108416449B (en) Operation and maintenance method and device
CN111679888A (en) Deployment method and device of agent container
CN113434180B (en) Data processing method and device for application, server and storage medium
WO2019034095A1 (en) Software processing method and apparatus, electronic device and computer-readable storage medium
CN107577527B (en) Task generation and scheduling method and device
US20040064458A1 (en) Deletion objector for determining whether or not to delete an object from an application
CN112162761A (en) Method, system and equipment for automatically deploying project to public cloud containerization platform
CN112380170A (en) Correlation method and device for file updating operation and computer equipment
CN114168179A (en) Micro-service management method, device, computer equipment and storage medium
CN112988266B (en) Resource management method and device, electronic equipment and storage medium
CN115016820A (en) Application program updating method, device, equipment and storage medium
JP2009169724A (en) Maintenance support device
CN110674153B (en) Data consistency detection method and device and electronic equipment
US8380729B2 (en) Systems and methods for first data capture through generic message monitoring
CN113590178B (en) API instance management method and device, storage medium and electronic equipment
CN115840642A (en) Edge resource processing method, device, system, equipment and medium
KR102221593B1 (en) System for maintaining the installation envoronment of computer terminals
CN113867778A (en) Method and device for generating mirror image file, electronic equipment and storage medium
CN113296829A (en) Method, device, equipment and computer readable medium for processing service
CN113326052A (en) Method and device for upgrading service component, computer equipment and storage medium
CN112540771A (en) Automated operation and maintenance method, system, equipment and computer readable storage medium
CN115134270B (en) Code monitoring method, monitoring system, electronic equipment and storage medium

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