CN112988266B - 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
CN112988266B
CN112988266B CN202110184724.6A CN202110184724A CN112988266B CN 112988266 B CN112988266 B CN 112988266B CN 202110184724 A CN202110184724 A CN 202110184724A CN 112988266 B CN112988266 B CN 112988266B
Authority
CN
China
Prior art keywords
resource
declaration
target resource
target
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.)
Active
Application number
CN202110184724.6A
Other languages
Chinese (zh)
Other versions
CN112988266A (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

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

Abstract

The resource management method, the device, the electronic equipment and the storage medium provided by the embodiment of the invention are applied to the technical field of information, and when a declaration event of a target resource is detected, a resource declaration is created for the target resource according to each resource which has an association relation with the target resource by determining the target resource. When the declaration event of the target resource is detected, the resource declaration can be created for the target resource according to each resource which has an association relation with the target resource, so that deployment personnel do not need to manually create the resource declarations one by one, and the problem of high manpower 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, a device, an electronic apparatus, and a storage medium.
Background
More and more companies deploy services in kubernetes-based container management systems. Since istio can implement management of numerous micro-services deployed on Kubernetes, istio is deployed simultaneously with Kubernetes.
The inventors have found that when kubernetes deploys and greyscale publishes an application, multiple resources need to be declared (resources Deployment, service of kubernetes, virtualService, destinationRule, gateway in Istio). Currently, the declaration of multiple resources requires a worker to manually create and declare the resources one by one.
Disclosure of Invention
The embodiment of the invention aims to provide a resource management method, a device, electronic equipment and a storage medium, which are used for solving the problem of large human resource consumption during resource declaration in the prior art.
In a first aspect of the present invention, there is provided a resource management method, applied to a container management system, the method including:
determining target resources, wherein the target resources have an association relationship with resources built in a container management system and resources of micro services to be deployed;
When a declaration event of a target resource is detected, a resource declaration is created for the target resource according to each resource having an association relationship with the target resource.
Optionally, the method further comprises:
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 normal operation of the micro-service;
and if the monitored resource inconsistent with the declaration configuration of the target resource exists, correcting 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, correcting the monitored resource according to the declaration configuration of the target resource, including:
When each resource which 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, correcting the monitored resource according to the declaration configuration of the target resource, including:
When detecting that each resource of the declaration and the target resource are modified, if the resource inconsistent with the declaration configuration of the target resource is monitored, correcting 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, correcting the monitored resource according to the declaration configuration of the target resource, including:
When the controller detects that each resource which is declared to have an association relationship with the target resource is deleted, declaring the deleted resource according to the declaration configuration of the target resource.
Optionally, before determining the target resource, the method further includes:
creating an item in a container management system;
In the created items, the created target resources and controllers corresponding to the target resources;
and when the project is started, loading each resource with 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 resource according to the association relation, 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.
In a second aspect of the present invention, there is also provided a resource management system, applied to a container management system, including:
the resource determining module is used for determining target resources in a preset container management system, wherein the target resources have an association relationship with resources built in the container management system and resources of the micro-service to be deployed;
And the statement creation module is used for creating a resource statement for the target resource according to each resource which has an association relation with the target resource when the statement event of the target resource is detected.
Optionally, the apparatus further includes:
The resource monitoring module is used for monitoring the target resource based on declaration configuration of the target resource; the declaration configuration of the target resource comprises configuration parameters required by normal operation of the micro-service;
and the statement modification module is used for modifying the monitored resource according to the statement configuration of the target resource if the resource inconsistent with the statement configuration of the target resource is monitored.
Optionally, the claim 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 with the association relation with the target resources are called.
Optionally, the claim modification module includes:
And the inconsistent 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 each resource of which the declaration and the target resources have an association relationship is detected to be modified.
Optionally, the claim modification module includes:
and the resource deleting sub-module is used for declaring the deleted resource according to the declaration configuration of the target resource when the controller detects that each declared resource with the association relation with the target resource is deleted.
Optionally, the apparatus further includes:
The project creation module is used for creating projects in the container management system;
The resource introduction module is used for creating target resources and controllers corresponding to the target resources in the created items;
And the resource loading module is used for loading each resource with an association relation with the target resource into the running environment when the project is started.
Optionally, the apparatus further includes:
the father-son level setting module is used for setting the target resource as a father 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 child level resources of the target resource.
In yet another aspect of the implementation of the present invention, an electronic device includes a processor, a communication interface, a memory, and a communication bus, where 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 implementation of the present invention, there is also provided a computer readable storage medium, in which a computer program is stored, the computer program implementing any one of the above resource management methods when executed by a processor.
In yet another aspect of the 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 device, the electronic equipment and the storage medium, through determining the target resource, when the declaration event of the target resource is detected, the resource declaration is created for the target resource according to each resource with an association relation with the target resource. When the declaration event of the target resource is detected, the resource declaration can be created for the target resource according to each resource which has an association relation with the target resource, so that deployment personnel do not need to manually create the resource declarations one by one, and the problem of high manpower 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 flow chart of a resource management method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart 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 micro-service according to an embodiment of the present invention;
FIG. 4 is a schematic 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 device 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 accompanying drawings in the embodiments of the present invention.
Kubernetes, 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.
Istio, which is a platform for providing an open source for the existing service network, can isolate the connection, security, control and observation modules from the application programs or services.
In order to solve the problem that in the prior art, when an application is deployed in Kubernetes, deployment personnel are required to manually declare a plurality of resources in Istio, so that the consumption of human resources is large, 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 association relationship with resources built in a container management system and resources of micro services to be deployed;
When a declaration event of a target resource is detected, a resource declaration is created for the target resource according to each resource having an association relationship with the target resource.
Therefore, by the resource management method, when the declaration event of the target resource is detected, the resource declaration can be created for the target resource according to the resources with the association relation with the target resource, so that deployment personnel do not need to manually create the resource declarations one by one, and the problem of high manpower resource consumption in the prior art is solved.
Referring to fig. 1, fig. 1 is a schematic flow chart of a resource management method according to an embodiment of the present invention, which is applied to a container management system, and includes:
step S11, determining target resources.
The target resource has an association relationship with the resources built in the container management system and the resources of the micro service to be deployed, so that all the resources required for deploying the specified micro service can be determined by determining the target resource.
In order to facilitate the completion of the resource deployment work of the micro-service to be deployed at one time, a father-son association relationship exists between the target resource and the specified resource built in the container management system and the resource of the specified micro-service to be deployed. In the actual use process, when the resource management method provided by the embodiment of the invention is applied to the Kubernetes and the designated micro Service to be deployed is Istio, the association relationship between the target resource and the resources Deployment and the resource Service built in the Kubernetes exists, and the association relationship between the target resource and the resources VirtualService, destinationRule and the resource Gateway of the Istio micro Service exists. Further, when the deployment-designated micro service is detected, the parent resource, which is the target resource, is deployed, so that the parent resource and all child resources associated with the parent resource can be deployed.
Optionally, the embodiment of the invention completes the setting of the association relationship between the father and son before the step of declaring the target resource. The embodiment of the invention provides that after the target resource is determined, the operation is executed, and the method is realized by the following steps:
according to the association relation, setting the target resource as a parent resource, 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.
In addition, the target resource may also be a resource required when deploying the specified micro-service. Specifically, since the partial micro service needs to have a part of resources built in the container management system in addition to its own resources, the resources required for deploying the specified micro service include at least the resources of the specified micro service, and may include the specified resources built in the container management system. For ease of understanding, an implementation is enumerated herein, such as when deploying micro service Istio in kubernetes, micro service Istio requires at least kubernetes built-in resource Deployment, service in addition to its 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 can be concretely a computer, a server or 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 relationship with the target resource.
Wherein, before step S12, further comprises: 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, when the Kubernetes is used for managing the deployment of corresponding resources through a declaration configuration file, such as a declaration Deployment resource, an application service named as nginx-deployme nt is deployed in a Kubernetes cluster, the service image is ginx:1.14.2, and 3 copies are simultaneously run in the cluster.
Therefore, by the resource management method, when the declaration event of the target resource is detected, the controller can create the resource declaration for the target resource according to the resources with 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.
And step S22, if the monitored resource inconsistent with the declaration configuration of the target resource exists, correcting the monitored resource according to the declaration configuration of the target resource.
The consistency of the resource declaration of a resource with the declaration configuration data of the resource is monitored for the purpose of ensuring that the micro-services supported by the resource are functioning properly. Wherein the resource declaration of the monitoring resource is the running data of the resource. Therefore, if the modification of the resource declaration of the resource by the third party is detected, a corresponding reminding notification can be sent out, if the modification is not detected, but the existence of the resource inconsistent with the declaration configuration is monitored, the monitored resource can be directly corrected according to the declaration configuration, and all the resources are operated according to the declaration configuration corresponding to the resource, so that the normal operation of the micro service is supported.
The monitoring of the target resource in the embodiment of the invention can be performed according to a fixed period, for example, whether the resource inconsistent with the declaration configuration of the target resource exists is judged in each hour; monitoring can also be performed according to a preset time point, for example, whether resources inconsistent with the declaration configuration of the target resources exist under the detection of holiday days; or after receiving the request that the resource is called, or while the resource is called, detecting whether the resource inconsistent with the declaration configuration of the target resource exists; it may also be detected that the declaration configuration corresponding to the resource is modified or upgraded, and whether the current resource declaration of the resource is consistent with the modified/updated declaration configuration is detected.
In the embodiment of the invention, the monitored resource is revised, which can be the resource declaration of the resource is adjusted to be the declaration configuration of the resource, and the resource can be 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 judge whether the declaration configuration of the target resource is consistent with the resource declaration of the target resource. And if the resource declarations are inconsistent, modifying the resource declarations 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 may receive an event trigger that the resource declaration of the target resource is deleted, and re-declare the deleted resource to ensure that the service state of the resource is consistent as the declaration configuration.
Therefore, by the resource management method of the embodiment of the invention, when the declaration configuration of the declaration target resource and the declaration configuration of each resource with the association relation with the target resource are inconsistent, 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 inconsistent operation state and declaration configuration of the target resource is prevented, and the stability of the application in the operation process is improved.
In addition, referring to fig. 3, the embodiment of the present invention further provides a method for generating a target resource of a micro service and a controller corresponding to the target resource, where the method includes:
S31, newly creating an item.
S32, in the created project, new target resources and controllers corresponding to the target resources are created.
When the embodiment of the invention is applied to kubernetes, an operator (item) can be created by using an open source toolkit, a new API (Application Programming Interface, application program interface) and a new kined (resource type) are added in the created operator as target resources, and then a response controller is generated corresponding to the target resources in the operator item.
At this time, the newly created item may be packaged in a mirror image manner, so as to be disposed in the container management system later.
After generating the target resource of the micro service and the controller corresponding to the target resource, the embodiment of the invention also provides a method for loading the resource, which comprises the following steps:
S33, submitting the statement file to the container management system, wherein the resource statement file is automatically configured after the new target resource and the corresponding controller are built, 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 the types. Go document, and the execution operation corresponding to the monitoring event can be adjusted by modifying the controller. Go document.
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 of the micro service to be deployed are loaded in addition to the resources built in the container management system, so that the container management system can identify the resource types of the target resources, accurately deploy the resources required by the micro service, timely monitor the deployment condition of the resources of the micro service and execute corresponding operations.
The method for executing the loading resource generally starts the new project, specifically, may call a register function in the function group schemeBuilderVs, and load the resource of the micro service to be deployed and the resource built in the container management system.
When the embodiment of the invention is applied to the cluster Kubernetes, the open source toolkit is utilized to create the Operator project, the target resource and the controller, and a yaml suffix declaration configuration file is generated at the moment. After a command is submitted to the Kubernetes cluster, the cluster can identify the target resource. When the cluster detects a claim event for the target resource, an event is triggered, causing Reconcile components in the Controller to be invoked. The Reconcile component first parses the declaration configuration file, i.e., determines the target resource first, and then determines the resource that has an association relationship with the target resource based on the target resource, thereby determining the attribute of the associated resource. Next, 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 performs the corresponding execution steps in the controller document for each case. Specifically, for each associated resource, whether the resource is declared or not is judged according to the attribute of the resource. If not, declaring according to the configuration parameters in the declaring configuration file; if so, judging whether the image packaging file address of the declaration and the number of the copies running in the cluster are the same as the configuration parameters in the declaration configuration file. If the configuration parameters are different, adjusting the configuration parameters according to the statement configuration file to be consistent; and if the statement conditions are the same, judging the statement conditions of other related resources. 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, including: a server for providing an API server 41, a Controller 42, a Client 43, a registration module 44; wherein,
The server 41 provides a communication interface of the clusters Kubernetes with the clients and an interaction interface with the controller and the registration module.
The controller 42 provides deployment resources, monitors the operating state of the resources, and provides services to clients. Wherein, the controller specifically includes: an information component (Informer) 421, a recall component (Callback) 422, a Queue component (Queue) 423, and a fit component (Reconcile) 424. The specific application of the components is as follows: the information component is used for monitoring related resource events of the customized resource from an interface of the platform server; the recall component is used for classifying related resource events of the user-defined resources into a queue; the queue component is used for generating a queue and receiving related resource events of the user-defined resources sent by the recall component; the coordination component is configured to consume an event in the queue component, specifically, by calling a coordination method Reconcile (request) in a controller. Go document, detect whether the running state of the custom resource is consistent with the configuration parameters in the declaration configuration file yaml, and if the running state is inconsistent without reaching the expectation, the event will not be consumed until the state reaches the expectation or overtime.
The client 43 provides the demands to the server and receives the services provided by the controller.
Registration module 44 provides asynchronous custom resources to the server, and declaring the custom resources can implement the resource declarations required for the micro-services.
The invention further provides a resource management system, see fig. 5, comprising: a resource determination module 501, a statement creation 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;
the declaration creation module 502 is configured to create, when a declaration event of a target resource is detected, a resource declaration for the target resource according to each resource having an association relationship with the target resource.
Optionally, the apparatus further includes:
The resource monitoring module is used for monitoring the target resource based on declaration configuration of the target resource; the declaration configuration of the target resource comprises configuration parameters required by normal operation of the micro-service;
and the statement modification module is used for modifying the monitored resource according to the statement configuration of the target resource if the resource inconsistent with the statement configuration of the target resource is monitored.
Optionally, the claim 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 with the association relation with the target resources are called.
Optionally, the claim modification module includes:
And the inconsistent 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 each resource of which the declaration and the target resources have an association relationship is detected to be modified.
Optionally, the claim modification module includes:
and the resource deleting sub-module is used for declaring the deleted resource according to the declaration configuration of the target resource when the controller detects that each declared resource with the association relation with the target resource is deleted.
Optionally, the apparatus further includes:
The project creation module is used for creating projects in the container management system;
The resource introduction module is used for creating target resources and controllers corresponding to the target resources in the created items;
And the resource loading module is used for loading each resource with an association relation with the target resource into the running environment when the project is started.
Optionally, the apparatus further includes:
the father-son level setting module is used for setting the target resource as a father 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 child level resources of the target resource.
Therefore, by the resource management device provided by the embodiment of the invention, when the declaration event of the target resource is detected, the resource declaration can be created for the target resource according to each resource with the association relation with the target resource, so that deployment personnel do not need to manually create the resource declarations one by one, and the problem of high manpower resource consumption in the prior art is solved.
The embodiment of the invention also provides an electronic device, as shown in fig. 6, comprising a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor, the communication interface and the memory are in communication with each other through the communication bus,
A memory for storing a computer program;
And 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 association relationship with resources built in a container management system and resources of micro services to be deployed;
When a declaration event of a target resource is detected, a resource declaration is created for the target resource according to each resource having an association relationship with the target resource.
Optionally, when the processor executes the program stored in the memory, any of the above resource management methods may be implemented.
The communication bus mentioned for the above-mentioned electronic devices may be a PCI (PERIPHERAL COMPONENT INTERCONNECT, peripheral component interconnect standard) bus or an EISA (Extended Industry Standard Architecture ) bus or the like. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The memory may include RAM (Random Access Memory ) or 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 aforementioned processor.
The processor may be a general-purpose processor, including a CPU (Central Processing Unit ), NP (Network Processor, network processor), etc.; but may also be a DSP (DIGITAL SIGNAL Processor), ASIC (Application SPECIFIC INTEGRATED Circuit), FPGA (Field-Programmable gate array) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components.
In yet another embodiment of the present invention, a computer readable storage medium is provided, in which a computer program is stored, which when executed by a processor implements any of the above-mentioned resource management methods.
In yet another embodiment of the present invention, a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the resource management methods described above is also provided.
In the above embodiments, it may be implemented in whole or in part 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, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more 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 SolidStateDisk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are 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. Moreover, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for apparatus, electronic devices, storage media, computer program product embodiments, the description is relatively simple, as it is substantially similar to method embodiments, with reference to the description of method embodiments in part.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (10)

1. A method of resource management, for use in a container management system, the method comprising:
Determining a target resource, wherein 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;
when a declaration event of the target resource is detected, creating a resource declaration for the target resource according to each resource with an association relation with the target resource;
The method for creating the resource declaration comprises the following steps:
judging whether any resource is declared according to the attribute of the resource;
if not, declaring according to the configuration parameters in the declaring configuration file;
If yes, judging whether the declared mirror image package file address and the number of the copies running in the cluster are the same as the configuration parameters in the declaration configuration file; and if the configuration parameters are different, adjusting according to the configuration parameters in the declaration configuration file.
2. The method according to claim 1, wherein the method further comprises:
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 normal operation of the micro service;
And if the monitored resource inconsistent with the declaration configuration of the target resource exists, correcting 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 declarative configuration of the target resource, modifying the monitored resource according to the declarative configuration of the target resource comprises:
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, correcting the monitored resource 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 declarative configuration of the target resource, modifying the monitored resource according to the declarative configuration of the target resource comprises:
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.
5. The method of claim 2, wherein if it is monitored that there is a resource inconsistent with the declarative configuration of the target resource, modifying the monitored resource according to the declarative configuration of the target resource comprises:
when the controller detects that each resource which is declared to have 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 said determining the target resource, the method further comprises:
Creating an item in the container management system;
In the created project, the created target resource and the controller corresponding to the target resource;
and when the project is started, loading each resource with an association relation with the target resource into the running environment.
7. The method of claim 6, wherein after the created target resource and the controller to which the target resource corresponds, the method further comprises:
and setting the target resource as a parent resource according to the association relation, 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, characterized by being applied to a container management system, comprising:
the resource determining module is used for determining target resources in a preset container management system, wherein the target resources have an association relationship with resources built in the container management system and resources of micro services to be deployed;
The declaration creation module is used for creating a resource declaration for the target resource according to each resource with an association relation with the target resource through the controller when a declaration event of the target resource is detected;
The method for creating the resource declaration comprises the following steps:
judging whether any resource is declared according to the attribute of the resource;
if not, declaring according to the configuration parameters in the declaring configuration file;
If yes, judging whether the declared mirror image package file address and the number of the copies running in the cluster are the same as the configuration parameters in the declaration configuration file; and if the configuration parameters are different, adjusting according to the configuration parameters in the declaration configuration file.
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 are in communication with each other through the communication bus;
A memory for storing a computer program;
a processor for carrying out the method steps of any one of claims 1-7 when said computer program stored on a memory is executed.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the method steps of any of claims 1-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 CN112988266A (en) 2021-06-18
CN112988266B true 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)

Citations (7)

* 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
CN102567175A (en) * 2010-12-08 2012-07-11 中国科学院声学研究所 Application safety monitoring method and system based on resource declaration
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

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9038071B2 (en) * 2006-03-30 2015-05-19 Microsoft Technology Licensing, Llc Operating system context isolation of application execution
US8650640B2 (en) * 2011-02-24 2014-02-11 International Business Machines Corporation Using a declaration of security requirements to determine whether to permit application operations
US8706881B2 (en) * 2011-03-22 2014-04-22 Oracle International Corporation Automatic registration of enterprise resources in a dynamic module system services registry

Patent Citations (7)

* 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
CN102567175A (en) * 2010-12-08 2012-07-11 中国科学院声学研究所 Application safety monitoring method and system based on resource declaration
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

Also Published As

Publication number Publication date
CN112988266A (en) 2021-06-18

Similar Documents

Publication Publication Date Title
US9253265B2 (en) Hot pluggable extensions for access management system
US8819202B1 (en) Service configuration and deployment engine for provisioning automation
CN110196731B (en) Operation and maintenance system, method and storage medium
US20190303127A1 (en) Enabling tenant administrators to initiate request driven peak-hour builds to override off-peak patching schedules
JP5542796B2 (en) Method and apparatus for managing mobile device software
US11061669B2 (en) Software development tool integration and monitoring
CN109450693B (en) Hybrid cloud monitoring system and monitoring method using same
WO2019034095A1 (en) Software processing method and apparatus, electronic device and computer-readable storage medium
US11544052B2 (en) Tenant declarative deployments with release staggering
CN111679888A (en) Deployment method and device of agent container
US20160218926A1 (en) Network Resource Management Devices Methods And Systems
CN107577527B (en) Task generation and scheduling method and device
CN114527996A (en) Multi-service deployment method and device, electronic equipment and storage medium
CN112583630B (en) Device management method, device, system, device and storage medium
CN113434180B (en) Data processing method and device for application, server and storage medium
CN115016820A (en) Application program updating method, device, equipment and storage medium
CN112988266B (en) Resource management method and device, electronic equipment and storage medium
CN114185734A (en) Cluster monitoring method and device and electronic equipment
CN111240998B (en) Test case processing method and device
US11327740B2 (en) Method and device for managing aircraft equipment software configurations
US8677323B2 (en) Recording medium storing monitoring program, monitoring method, and monitoring system
CN116521460A (en) Screen unlocking method and device for test equipment, electronic equipment and storage medium
CN110674153A (en) Data consistency detection method and device and electronic equipment
CN115840642A (en) Edge resource processing method, device, system, equipment and medium
CN113885957A (en) Configuration file processing method, terminal device, server 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