CN112068935A - Method, device and equipment for monitoring deployment of kubernets program - Google Patents

Method, device and equipment for monitoring deployment of kubernets program Download PDF

Info

Publication number
CN112068935A
CN112068935A CN202010971013.9A CN202010971013A CN112068935A CN 112068935 A CN112068935 A CN 112068935A CN 202010971013 A CN202010971013 A CN 202010971013A CN 112068935 A CN112068935 A CN 112068935A
Authority
CN
China
Prior art keywords
deployment
state
event
specific
containers
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.)
Pending
Application number
CN202010971013.9A
Other languages
Chinese (zh)
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 Zhidemai Technology Co ltd
Original Assignee
Beijing Zhidemai 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 Zhidemai Technology Co ltd filed Critical Beijing Zhidemai Technology Co ltd
Priority to CN202010971013.9A priority Critical patent/CN112068935A/en
Publication of CN112068935A publication Critical patent/CN112068935A/en
Pending legal-status Critical Current

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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/301Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is a virtual computing platform, e.g. logically partitioned systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3089Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
    • G06F11/3093Configuration details thereof, e.g. installation, enabling, spatial arrangement of the probes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45591Monitoring or debugging support

Landscapes

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

Abstract

The invention discloses a method, a device and equipment for monitoring kubernets program deployment. The invention has the conception that deployment change is tracked in real time through a resource monitoring mechanism of kubernets, so that timely abnormal alarm and accurate release tracking are realized. During specific implementation, a state machine mechanism can be utilized to perform corresponding deployment state setting on a current request, so that a complete deployment state circulation relationship can be clearly maintained, and meanwhile, event description is performed on a deployment state change process, so that good function expansion capability is provided. In summary, the present invention provides a complete monitoring state transition logic, and generates a corresponding state transition event for each state transition, so that program function expansion can be performed based on the generated state transition event, and a custom alarm and release tracking function can be realized.

Description

Method, device and equipment for monitoring deployment of kubernets program
Technical Field
The invention relates to the technical field of cloud protogenesis, in particular to a method, a device and equipment for monitoring kubernets program deployment.
Background
With the popularization of cloud native technology, a kubernets platform has become a de facto standard for container arrangement and scheduling, but meanwhile, after a program is deployed to the kubernets in a container form, monitoring and alarming of the running state of the program become a new challenge.
For kubernets, each time program is published in a rolling mode, old containers are deleted and new containers are created, and a periodic collection and alarm mechanism of a traditional monitoring scheme can determine container operation faults in an error mode due to container changes caused by the publication in a rolling mode, and then wrong alarm information is sent out, and great inconvenience is brought to operation and maintenance work.
Disclosure of Invention
In view of the foregoing, the present invention aims to provide a method, an apparatus, and a device for monitoring deployment of a kubernets program, and accordingly provides a computer-readable storage medium and a computer program product, so as to clearly maintain a complete deployment state flow relationship in kubernets and accurately alarm corresponding event information.
The technical scheme adopted by the invention is as follows:
in a first aspect, the present invention provides a method for monitoring deployment of kubernets program, including:
monitoring all deployed states and dynamic event messages in the kubernets cluster in real time;
after the event request is monitored, the following judgment operations are executed:
if the event is judged to be deleted, deleting the corresponding deployment record in the memory;
if the new event is determined, adding the current deployment in the memory, and setting a corresponding deployment state and an alarm event according to the container state of the current deployment;
and if the event is judged to be modified, modifying the corresponding deployment state and setting the corresponding alarm event according to the deployment version, the deployment state and the container state.
In at least one possible implementation manner, the adding a current deployment in the memory, and setting a corresponding deployment state and an alarm event according to a container state of the current deployment includes:
after the current deployment is stored in the memory, judging whether all containers of the current deployment are the latest versions and whether the quantity is correct;
if the two conditions are met, recording the current deployment state as running;
otherwise, recording the current deployment state as issuing, and setting the alarm event as issuing start.
In at least one possible implementation manner, the determining that the event is the modification event includes:
and if the name of the current deployment in the event request is consistent with the name of the specific deployment in the memory, determining to be the modification event.
In at least one possible implementation manner, the modifying the corresponding deployment state and setting the corresponding alarm event according to the deployment version, the deployment state, and the container state includes:
firstly, judging whether the version of the current deployment is higher than the version of the specific deployment;
if yes, changing the state of the specific deployment into release, and setting an alarm event as release start;
if not, executing the following steps according to the specific deployment state and the container state thereof:
when the state of the specific deployment is in release, if all containers of the specific deployment meet the two conditions that the containers are the latest version and the quantity is correct, the state of the specific deployment is changed into operation, and an alarm event is set to be successful in release; if the container state does not meet the conditions and exceeds the preset time, changing the state of the specific deployment into release overtime, and setting an alarm event as release overtime;
when the state of the specific deployment is in operation, if all containers of the specific deployment do not meet the two conditions that the containers are the latest version and the quantity is correct, the state of the specific deployment is changed into abnormal operation, and an alarm event is set to be abnormal operation;
when the state of the specific deployment is abnormal operation, if all the containers of the specific deployment meet the two conditions that the containers are the latest version and the quantity is correct, the state of the specific deployment is changed into operation, and an alarm event is set to be operation recovery;
when the state of the specific deployment is release timeout, if all containers of the specific deployment meet the two conditions that the containers are the latest versions and the quantity is correct, the state of the specific deployment is changed into operation, and an alarm event is set to release recovery.
In at least one possible implementation manner, the method further includes:
creating a state machine dictionary in a memory in advance for maintaining all deployments, wherein in the state machine dictionary: the key is the name of the deployment and the value is the state information of the deployment.
In a second aspect, the present invention provides a kubernets program deployment monitoring apparatus, including:
the monitoring module is used for monitoring all deployed states and dynamic event messages in the kubernets cluster in real time;
the state machine module is used for executing the following sub-modules after receiving the event request:
the deleting submodule is used for deleting the corresponding deployment record in the memory when the event request is judged to be the deleting event;
the newly-added module is used for adding the current deployment in the memory when the event request is judged to be a newly-added event, and setting a corresponding deployment state and an alarm event according to the container state of the current deployment;
and the modification submodule is used for modifying the corresponding deployment state and setting the corresponding alarm event according to the deployment version, the deployment state and the container state when the event request is judged to be the modification event.
In at least one possible implementation manner, the newly added module includes:
the container state checking unit is used for judging whether all containers currently deployed are the latest versions and the quantity is correct or not after the current deployment is stored in the memory;
the state modification and alarm generation unit is used for recording the current deployed state as the running state when the output of the container state inspection unit is yes; otherwise, recording the current deployment state as issuing, and setting the alarm event as issuing start.
In at least one possible implementation manner, the modification sub-module includes:
the version detection unit is used for firstly judging whether the version of the current deployment is higher than the version of the specific deployment which is consistent with the name of the version in the memory;
the state modification and alarm generation unit is used for changing the state of the specific deployment into release when the output of the version detection unit is yes, and setting an alarm event as release start;
the state modification and alarm generation unit is also used for executing the following steps in combination with the container state check unit when the output of the version detection unit is negative:
when the state of the specific deployment is in release, if all containers of the specific deployment meet the two conditions that the containers are the latest version and the quantity is correct, the state of the specific deployment is changed into operation, and an alarm event is set to be successful in release; if the container state does not meet the conditions and exceeds the preset time, changing the state of the specific deployment into release overtime, and setting an alarm event as release overtime;
when the state of the specific deployment is in operation, if all containers of the specific deployment do not meet the two conditions that the containers are the latest version and the quantity is correct, the state of the specific deployment is changed into abnormal operation, and an alarm event is set to be abnormal operation;
when the state of the specific deployment is abnormal operation, if all the containers of the specific deployment meet the two conditions that the containers are the latest version and the quantity is correct, the state of the specific deployment is changed into operation, and an alarm event is set to be operation recovery;
when the state of the specific deployment is release timeout, if all containers of the specific deployment meet the two conditions that the containers are the latest versions and the quantity is correct, the state of the specific deployment is changed into operation, and an alarm event is set to release recovery.
In at least one possible implementation manner, the apparatus further includes: a state machine setting module;
the state machine setting module is used for creating a state machine dictionary used for maintaining all deployments in a memory in advance, and in the state machine dictionary: the key is the name of the deployment and the value is the state information of the deployment.
In a third aspect, the present invention provides a kubernets program deployment monitoring device, including:
one or more processors, memory which may employ a non-volatile storage medium, and one or more computer programs stored in the memory, the one or more computer programs comprising instructions which, when executed by the apparatus, cause the apparatus to perform the method as in the first aspect or any possible implementation of the first aspect.
In a fourth aspect, the present invention provides a computer-readable storage medium having stored thereon a computer program which, when run on a computer, causes the computer to perform the method as described in the first aspect or any possible implementation manner of the first aspect.
In a fifth aspect, the present invention also provides a computer program product for performing the method of the first aspect or any possible implementation manner of the first aspect, when the computer program product is executed by a computer.
In a possible design of the fifth aspect, the relevant program related to the product may be stored in whole or in part on a memory packaged with the processor, or may be stored in part or in whole on a storage medium not packaged with the processor.
The invention has the conception that deployment change is tracked in real time through a resource monitoring mechanism of kubernets, so that timely abnormal alarm and accurate release tracking are realized. During specific implementation, a state machine mechanism can be utilized to perform corresponding deployment state setting on a current request, so that a complete deployment state circulation relationship can be clearly maintained, and meanwhile, event description is performed on a deployment state change process, so that good function expansion capability is provided. In summary, the present invention provides a complete monitoring state transition logic, and generates a corresponding state transition event for each state transition, so that program function expansion can be performed based on the generated state transition event, and a custom alarm and release tracking function can be realized.
Drawings
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be further described with reference to the accompanying drawings, in which:
fig. 1 is a flowchart of an embodiment of a kubernets program deployment monitoring method provided in the present invention;
fig. 2 is a block diagram of an embodiment of a kubernets program deployment monitoring apparatus provided in the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative only and should not be construed as limiting the invention.
Before the technical scheme of the present invention is explained, the following description can be made on the monitoring technical scheme of the existing kubernets container, on one hand, the existing monitoring mechanism usually collects and stores the container operation state periodically, and periodically counts the recently collected monitoring data as the basis for alarm judgment. Therefore, when the program is published in a rolling manner, the deleting process of the old container is monitored, collected and stored, so that the alarm misjudgment container fails, and one normal rolling publishing operation is misjudged as a container failure, which brings too much invalid alarm information to operation and maintenance work.
On the other hand, in the design process, it is found that because the kubernets rolling release mechanism conforms to the final consistency, namely the release request is submitted through the API and then returned immediately, and the container deployment process is executed asynchronously, it is difficult for a user to know when the deployment is really completed and whether the rolling release cannot be normally performed due to program bug, so that the whole release process is difficult to accurately trace and monitor, and in case of being serious, the service fault may be caused because the release abnormality is not timely known.
In view of this, the present invention contemplates maintaining state information of each deployment in the cluster in the memory by tracking changes in the state of the deployment in real time, for example, the state of the deployment may be determined based on a state machine, including: during issuing, during operation, overtime issuing, abnormal operation and the like, through the real-time monitoring mechanism, not only can false alarm be avoided, but also the whole issuing state circulation process can be tracked in real time, and richer detail information is provided.
Thus, the present invention provides an embodiment of at least one method for deploying and monitoring kubernets program, and as shown in fig. 1, the method may include the following steps:
and step S1, monitoring all deployed states in the kubernets cluster and the messages of the dynamic events in real time.
In particular, a resource monitoring mechanism is provided for a kubernets cluster, for example, a listener may be registered with a cluster control node (kubernets master) of kubernets, and used to monitor all deployment changes and corresponding event notifications in the cluster. Therefore, after a user submits a rolling release request, the program can immediately know the latest state of deployment and continuously sense the relevant modification of the deployment state in the kubernets scheduling process, so that each state change in the deployment process is known.
In actual operation, after the program is started, a state machine dictionary for maintaining all deployments can be created in the memory, wherein the key is the deployment name, and the value is the deployment state information. And, in order to facilitate the execution of the subsequent steps, the deployed state and the alarm event generated when the state is circulated can be predefined. For example, the deployment state may include, but is not limited to: during release, during operation, overtime release, abnormal operation and the like; while alarm events may include, but are not limited to: starting to issue, successfully issuing, overtime issuing, resuming of issuing, abnormal operation, resuming of operation and the like.
Step S2, after the event request is monitored, executing the following determination operation:
step S3, if the event is determined to be deleted, deleting the corresponding deployment record in the memory;
step S4, if the event is determined to be newly added, adding the current deployment in the memory, and setting a corresponding deployment state and an alarm event according to the state of the container of the current deployment;
and step S5, if the event is determined to be modified, modifying the corresponding deployment state and setting the corresponding alarm event according to the deployment version, the deployment state and the container state.
Specifically, when the program monitors an event notification, it can know from the event that the type of the current operation is "delete/add/modify" and the specific changed deployment name.
When the judgment request is that the deployment is deleted, the processing mode of the preset state machine is relatively simple, and only the corresponding deployment needs to be deleted from the memory (the state machine dictionary).
For adding and modifying events, the state machine can identify the types of the events by judging whether current deployment exists in the memory. If the name of the current deployment in the event request is not recorded in the memory (state machine dictionary), the received request operation can be judged to belong to a newly-built deployment event, so that the current deployment can be stored in the state machine dictionary, and whether all the containers currently deployed are the latest versions and have correct quantity at the same time is judged, if yes, the state of the current deployment can be recorded as ' running ', otherwise, the state is recorded as ' issuing ', and an alarm event is generated to start issuing '.
If the current deployment record already exists in the memory, it can be determined that the current request is a modification event, that is, if the name of the current deployment in the event request is consistent with the name of the specific deployment already existing in the memory (state machine dictionary), the state machine performs calculation according to the modification event. And in particular as to how the modifications are made, reference may further be made to the following:
firstly, judging whether the version number of the current deployment in the event request is higher than the version number of the specific deployment, if so, indicating that a user submits a rolling release operation, at this time, the state of the specific deployment can be directly changed into 'release in process' without considering the current state of the specific deployment (no matter 'operation in process', 'operation abnormity', 'release overtime', etc.), and an alarm event is set to 'release start', and more preferably, the current time can be recorded as 'release start time' at the same time.
If a rolling publication request is not submitted by a user, the following may be performed according to the state of the particular deployment and its container state:
(1) when the state of the particular deployment is "publishing
If all containers of the specific deployment meet the two conditions that the containers are all latest versions and the quantity is correct (namely all the containers are upgraded in a rolling mode), changing the state of the specific deployment to be in operation, and setting an alarm event to be successful in issuing; if the container state does not satisfy the above conditions and exceeds a preset time, for example, the containers of the specific deployment are not completely ready and exceed a preset 120 seconds from the release start time, the state of the specific deployment is changed to release timeout, and the alarm event is set to release timeout.
(2) When the state of the particular deployment is "on-the-fly
If all containers of the specific deployment do not satisfy the two conditions that the containers are the latest versions and the quantity is correct, the state of the specific deployment is changed into 'abnormal operation', and an alarm event is set to 'abnormal operation'.
(3) When the state of the specific deployment is' abnormal operation
If all containers of the specific deployment meet the two conditions that the containers are all latest versions and the quantity is correct, the state of the specific deployment is changed to be 'running', and an alarm event is set to be 'running recovery'.
(4) When the state of the specific deployment is' issue timeout
If all containers of the specific deployment meet the two conditions that the containers are all latest versions and the quantity is correct, the state of the specific deployment is changed to be 'running', and an alarm event is set to be 'release recovery'.
In conclusion, the invention tracks the deployment change in real time through the resource monitoring mechanism of kubernets, thereby realizing the timely abnormal alarm and the accurate release tracking. During specific implementation, a state machine mechanism can be utilized to perform corresponding deployment state setting on a current request, so that a complete deployment state circulation relationship can be clearly maintained, and meanwhile, event description is performed on a deployment state change process, so that good function expansion capability is provided. In summary, the present invention provides a complete monitoring state transition logic, and generates a corresponding state transition event for each state transition, so that program function expansion can be performed based on the generated state transition event, and a custom alarm and release tracking function can be realized.
Corresponding to the above embodiments and preferred solutions, the present invention further provides an embodiment of a kubernets program deployment monitoring apparatus, as shown in fig. 2, which may specifically include the following components:
the monitoring module 1 is used for monitoring all deployed states and dynamic event messages in the kubernets cluster in real time;
the state machine module 2 is configured to, after receiving the event request, execute the following sub-modules:
the deletion submodule 3 is used for deleting the corresponding deployment record in the memory when the event request is judged to be a deletion event;
the newly-added submodule 4 is used for adding the current deployment in the memory when the event request is judged to be a newly-added event, and setting a corresponding deployment state and an alarm event according to the container state of the current deployment;
and the modification submodule 5 is used for modifying the corresponding deployment state and setting the corresponding alarm event according to the deployment version, the deployment state and the container state when the event request is judged to be the modification event.
In at least one possible implementation manner, the newly added module includes:
the container state checking unit is used for judging whether all containers currently deployed are the latest versions and the quantity is correct or not after the current deployment is stored in the memory;
the state modification and alarm generation unit is used for recording the current deployed state as the running state when the output of the container state inspection unit is yes; otherwise, recording the current deployment state as issuing, and setting the alarm event as issuing start.
In at least one possible implementation manner, the modification sub-module includes:
the version detection unit is used for firstly judging whether the version of the current deployment is higher than the version of the specific deployment which is consistent with the name of the version in the memory;
the state modification and alarm generation unit is used for changing the state of the specific deployment into release when the output of the version detection unit is yes, and setting an alarm event as release start;
the state modification and alarm generation unit is also used for executing the following steps in combination with the container state check unit when the output of the version detection unit is negative:
when the state of the specific deployment is in release, if all containers of the specific deployment meet the two conditions that the containers are the latest version and the quantity is correct, the state of the specific deployment is changed into operation, and an alarm event is set to be successful in release; if the container state does not meet the conditions and exceeds the preset time, changing the state of the specific deployment into release overtime, and setting an alarm event as release overtime;
when the state of the specific deployment is in operation, if all containers of the specific deployment do not meet the two conditions that the containers are the latest version and the quantity is correct, the state of the specific deployment is changed into abnormal operation, and an alarm event is set to be abnormal operation;
when the state of the specific deployment is abnormal operation, if all the containers of the specific deployment meet the two conditions that the containers are the latest version and the quantity is correct, the state of the specific deployment is changed into operation, and an alarm event is set to be operation recovery;
when the state of the specific deployment is release timeout, if all containers of the specific deployment meet the two conditions that the containers are the latest versions and the quantity is correct, the state of the specific deployment is changed into operation, and an alarm event is set to release recovery.
In at least one possible implementation manner, the apparatus further includes: a state machine setting module;
the state machine setting module is used for creating a state machine dictionary used for maintaining all deployments in a memory in advance, and in the state machine dictionary: the key is the name of the deployment and the value is the state information of the deployment.
It should be understood that the above partition of each component in the kubernets program deployment monitoring apparatus shown in fig. 2 is merely a logical functional partition, and the actual implementation may be wholly or partially integrated into one physical entity, or may be physically separated. And these components may all be implemented in software invoked by a processing element; or may be implemented entirely in hardware; and part of the components can be realized in the form of calling by the processing element in software, and part of the components can be realized in the form of hardware. For example, a certain module may be a separate processing element, or may be integrated into a certain chip of the electronic device. Other components are implemented similarly. In addition, all or part of the components can be integrated together or can be independently realized. In implementation, each step of the above method or each component above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in the form of software.
For example, the above components may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), one or more microprocessors (DSPs), one or more Field Programmable Gate Arrays (FPGAs), etc. For another example, these components may be integrated together and implemented in the form of a System-On-a-Chip (SOC).
In view of the foregoing examples and their preferred embodiments, it will be appreciated by those skilled in the art that in practice, the invention may be practiced in a variety of embodiments, and that the invention is illustrated schematically in the following vectors:
(1) a kubernets program deployment monitoring device, which may include:
one or more processors, memory, and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions, which when executed by the apparatus, cause the apparatus to perform the steps/functions of the foregoing embodiments or equivalent implementations.
The device may be an electronic device or a circuit device built in the electronic device. The electronic device may be a PC, a server, or the like. The embodiment does not limit the specific form of the kubernets program deployment monitoring device.
(2) A readable storage medium, on which a computer program or the above-mentioned apparatus is stored, which, when executed, causes the computer to perform the steps/functions of the above-mentioned embodiments or equivalent implementations.
In the several embodiments provided by the present invention, any function, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer readable storage medium. Based on this understanding, some aspects of the present invention may be embodied in the form of software products, which are described below, or portions thereof, which substantially contribute to the art.
(3) A computer program product (which may include the above apparatus) when running on a terminal device, causes the terminal device to execute the kubernets program deployment monitoring method of the foregoing embodiment or equivalent embodiments.
From the above description of the embodiments, it is clear to those skilled in the art that all or part of the steps in the above implementation method can be implemented by software plus a necessary general hardware platform. With this understanding, the above-described computer program products may include, but are not limited to, refer to APP; continuing on, the aforementioned device/terminal may be a computer device (e.g., a mobile phone, a PC terminal, a cloud platform, a server cluster, or a network communication device such as a media gateway). Moreover, the hardware structure of the computer device may further specifically include: at least one processor, at least one communication interface, at least one memory, and at least one communication bus; the processor, the communication interface and the memory can all complete mutual communication through the communication bus. The processor may be a central Processing unit CPU, a DSP, a microcontroller, or a digital Signal processor, and may further include a GPU, an embedded Neural Network Processor (NPU), and an Image Signal Processing (ISP), and may further include a specific integrated circuit ASIC, or one or more integrated circuits configured to implement the embodiments of the present invention, and the processor may have a function of operating one or more software programs, and the software programs may be stored in a storage medium such as a memory; and the aforementioned memory/storage media may comprise: non-volatile memories (non-volatile memories) such as non-removable magnetic disks, U-disks, removable hard disks, optical disks, etc., and Read-Only memories (ROM), Random Access Memories (RAM), etc.
In the embodiments of the present invention, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, and means that there may be three relationships, for example, a and/or B, and may mean that a exists alone, a and B exist simultaneously, and B exists alone. Wherein A and B can be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" and similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b, and c may represent: a, b, c, a and b, a and c, b and c or a and b and c, wherein a, b and c can be single or multiple.
Those of skill in the art will appreciate that the various modules, elements, and method steps described in the embodiments disclosed in this specification can be implemented as electronic hardware, combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In addition, the embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments may be referred to each other. In particular, for embodiments of devices, apparatuses, etc., since they are substantially similar to the method embodiments, reference may be made to some of the descriptions of the method embodiments for their relevant points. The above-described embodiments of devices, apparatuses, etc. are merely illustrative, and modules, units, etc. described as separate components may or may not be physically separate, and may be located in one place or distributed in multiple places, for example, on nodes of a system network. Some or all of the modules and units can be selected according to actual needs to achieve the purpose of the above-mentioned embodiment. Can be understood and carried out by those skilled in the art without inventive effort.
The structure, features and effects of the present invention have been described in detail with reference to the embodiments shown in the drawings, but the above embodiments are merely preferred embodiments of the present invention, and it should be understood that technical features related to the above embodiments and preferred modes thereof can be reasonably combined and configured into various equivalent schemes by those skilled in the art without departing from and changing the design idea and technical effects of the present invention; therefore, the invention is not limited to the embodiments shown in the drawings, and all the modifications and equivalent embodiments that can be made according to the idea of the invention are within the scope of the invention as long as they are not beyond the spirit of the description and the drawings.

Claims (10)

1. A method for monitoring deployment of kubernets programs is characterized by comprising the following steps:
monitoring all deployed states and dynamic event messages in the kubernets cluster in real time;
after the event request is monitored, the following judgment operations are executed:
if the event is judged to be deleted, deleting the corresponding deployment record in the memory;
if the new event is determined, adding the current deployment in the memory, and setting a corresponding deployment state and an alarm event according to the container state of the current deployment;
and if the event is judged to be modified, modifying the corresponding deployment state and setting the corresponding alarm event according to the deployment version, the deployment state and the container state.
2. The method of claim 1, wherein the adding a current deployment to the memory and setting a corresponding deployment state and alarm event according to a container state of the current deployment comprises:
after the current deployment is stored in the memory, judging whether all containers of the current deployment are the latest versions and whether the quantity is correct;
if the two conditions are met, recording the current deployment state as running;
otherwise, recording the current deployment state as issuing, and setting the alarm event as issuing start.
3. The method of claim 1, wherein the determining a modification event comprises:
and if the name of the current deployment in the event request is consistent with the name of the specific deployment in the memory, determining to be the modification event.
4. The method of claim 3, wherein modifying the corresponding deployment state and setting the corresponding alarm event according to the deployment version, the deployment state, and the container state comprises:
firstly, judging whether the version of the current deployment is higher than the version of the specific deployment;
if yes, changing the state of the specific deployment into release, and setting an alarm event as release start;
if not, executing the following steps according to the specific deployment state and the container state thereof:
when the state of the specific deployment is in release, if all containers of the specific deployment meet the two conditions that the containers are the latest version and the quantity is correct, the state of the specific deployment is changed into operation, and an alarm event is set to be successful in release; if the container state does not meet the conditions and exceeds the preset time, changing the state of the specific deployment into release overtime, and setting an alarm event as release overtime;
when the state of the specific deployment is in operation, if all containers of the specific deployment do not meet the two conditions that the containers are the latest version and the quantity is correct, the state of the specific deployment is changed into abnormal operation, and an alarm event is set to be abnormal operation;
when the state of the specific deployment is abnormal operation, if all the containers of the specific deployment meet the two conditions that the containers are the latest version and the quantity is correct, the state of the specific deployment is changed into operation, and an alarm event is set to be operation recovery;
when the state of the specific deployment is release timeout, if all containers of the specific deployment meet the two conditions that the containers are the latest versions and the quantity is correct, the state of the specific deployment is changed into operation, and an alarm event is set to release recovery.
5. The method for deployment monitoring of a kubernets program according to any of claims 1-4, further comprising:
creating a state machine dictionary in a memory in advance for maintaining all deployments, wherein in the state machine dictionary: the key is the name of the deployment and the value is the state information of the deployment.
6. A kubernets program deployment monitoring device, comprising:
the monitoring module is used for monitoring all deployed states and dynamic event messages in the kubernets cluster in real time;
the state machine module is used for executing the following sub-modules after receiving the event request:
the deleting submodule is used for deleting the corresponding deployment record in the memory when the event request is judged to be the deleting event;
the newly-added module is used for adding the current deployment in the memory when the event request is judged to be a newly-added event, and setting a corresponding deployment state and an alarm event according to the container state of the current deployment;
and the modification submodule is used for modifying the corresponding deployment state and setting the corresponding alarm event according to the deployment version, the deployment state and the container state when the event request is judged to be the modification event.
7. The kubernets procedure deployment monitoring apparatus of claim 6, wherein the newly added sub-module comprises:
the container state checking unit is used for judging whether all containers currently deployed are the latest versions and the quantity is correct or not after the current deployment is stored in the memory;
the state modification and alarm generation unit is used for recording the current deployed state as the running state when the output of the container state inspection unit is yes; otherwise, recording the current deployment state as issuing, and setting the alarm event as issuing start.
8. The kubernets procedure deployment monitoring apparatus of claim 6, wherein the modification submodule includes:
the version detection unit is used for firstly judging whether the version of the current deployment is higher than the version of the specific deployment which is consistent with the name of the version in the memory;
the state modification and alarm generation unit is used for changing the state of the specific deployment into release when the output of the version detection unit is yes, and setting an alarm event as release start;
the state modification and alarm generation unit is also used for executing the following steps in combination with the container state check unit when the output of the version detection unit is negative:
when the state of the specific deployment is in release, if all containers of the specific deployment meet the two conditions that the containers are the latest version and the quantity is correct, the state of the specific deployment is changed into operation, and an alarm event is set to be successful in release; if the container state does not meet the conditions and exceeds the preset time, changing the state of the specific deployment into release overtime, and setting an alarm event as release overtime;
when the state of the specific deployment is in operation, if all containers of the specific deployment do not meet the two conditions that the containers are the latest version and the quantity is correct, the state of the specific deployment is changed into abnormal operation, and an alarm event is set to be abnormal operation;
when the state of the specific deployment is abnormal operation, if all the containers of the specific deployment meet the two conditions that the containers are the latest version and the quantity is correct, the state of the specific deployment is changed into operation, and an alarm event is set to be operation recovery;
when the state of the specific deployment is release timeout, if all containers of the specific deployment meet the two conditions that the containers are the latest versions and the quantity is correct, the state of the specific deployment is changed into operation, and an alarm event is set to release recovery.
9. A computer-readable storage medium, in which a computer program is stored which, when run on a computer, causes the computer to perform the kubernets program deployment monitoring method of any one of claims 1-5.
10. A kubernets program deployment monitoring device, comprising:
one or more processors, memory, and one or more computer programs stored in the memory, the one or more computer programs comprising instructions which, when executed by the apparatus, cause the apparatus to perform the kubernets program deployment monitoring method of any of claims 1-5.
CN202010971013.9A 2020-09-15 2020-09-15 Method, device and equipment for monitoring deployment of kubernets program Pending CN112068935A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010971013.9A CN112068935A (en) 2020-09-15 2020-09-15 Method, device and equipment for monitoring deployment of kubernets program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010971013.9A CN112068935A (en) 2020-09-15 2020-09-15 Method, device and equipment for monitoring deployment of kubernets program

Publications (1)

Publication Number Publication Date
CN112068935A true CN112068935A (en) 2020-12-11

Family

ID=73695292

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010971013.9A Pending CN112068935A (en) 2020-09-15 2020-09-15 Method, device and equipment for monitoring deployment of kubernets program

Country Status (1)

Country Link
CN (1) CN112068935A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113010385A (en) * 2021-03-18 2021-06-22 山东英信计算机技术有限公司 Task state updating method, device, equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106506605A (en) * 2016-10-14 2017-03-15 华南理工大学 A kind of SaaS application construction methods based on micro services framework
WO2017161984A1 (en) * 2016-03-24 2017-09-28 中兴通讯股份有限公司 Method, device and system for deploying data clusters, and computer storage medium
CN107423112A (en) * 2017-06-28 2017-12-01 郑州云海信息技术有限公司 A kind of Docker container states real-time synchronization method
CN107463410A (en) * 2017-08-11 2017-12-12 四川长虹电器股份有限公司 A kind of method disposed with monitoring online platform application
CN110704166A (en) * 2019-09-30 2020-01-17 北京金山云网络技术有限公司 Service operation method and device and server

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017161984A1 (en) * 2016-03-24 2017-09-28 中兴通讯股份有限公司 Method, device and system for deploying data clusters, and computer storage medium
CN106506605A (en) * 2016-10-14 2017-03-15 华南理工大学 A kind of SaaS application construction methods based on micro services framework
CN107423112A (en) * 2017-06-28 2017-12-01 郑州云海信息技术有限公司 A kind of Docker container states real-time synchronization method
CN107463410A (en) * 2017-08-11 2017-12-12 四川长虹电器股份有限公司 A kind of method disposed with monitoring online platform application
CN110704166A (en) * 2019-09-30 2020-01-17 北京金山云网络技术有限公司 Service operation method and device and server

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王琼;: "微服务与容器化在图文包装集群中的应用", 现代电视技术, no. 01 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113010385A (en) * 2021-03-18 2021-06-22 山东英信计算机技术有限公司 Task state updating method, device, equipment and medium
CN113010385B (en) * 2021-03-18 2022-10-28 山东英信计算机技术有限公司 Task state updating method, device, equipment and medium
US11915035B1 (en) 2021-03-18 2024-02-27 Shandong Yingxin Computer Technologies Co., Ltd. Task state updating method and apparatus, device, and medium

Similar Documents

Publication Publication Date Title
CN110798375B (en) Monitoring method, system and terminal equipment for enhancing high availability of container cluster
CN108847982B (en) Distributed storage cluster and node fault switching method and device thereof
CN106789306B (en) Method and system for detecting, collecting and recovering software fault of communication equipment
US9355005B2 (en) Detection apparatus and detection method
CN111881014B (en) System test method, device, storage medium and electronic equipment
CN108287769B (en) Information processing method and device
CN108845912A (en) Service interface calls the alarm method of failure and calculates equipment
CN114064217B (en) OpenStack-based node virtual machine migration method and device
CN109586989B (en) State checking method, device and cluster system
CN110618853B (en) Detection method, device and equipment for zombie container
CN112068935A (en) Method, device and equipment for monitoring deployment of kubernets program
CN113055203B (en) Method and device for recovering exception of SDN control plane
CN111880992B (en) Monitoring and maintaining method for controller state in storage device
CN113282501A (en) Block chain testing method and device and electronic equipment
CN110781039B (en) Sentinel process election method and device
CN115766402B (en) Method and device for filtering server fault root cause, storage medium and electronic device
CN113778763B (en) Intelligent switching method and system for three-way interface service faults
CN114528350A (en) Cluster split brain processing method, device and equipment and readable storage medium
CN114579252A (en) Method, system, storage medium and equipment for monitoring application state
CN115150253B (en) Fault root cause determining method and device and electronic equipment
CN115473793B (en) Automatic recovery method, device, terminal and medium for cluster EI host environment
AU2014200806B1 (en) Adaptive fault diagnosis
CN117349127B (en) GPU card-falling detection method and device
CN116545835A (en) Fault alarm processing method and device, electronic equipment and storage medium
CN107302462B (en) Method and device for carrying out alarm service on distributed cluster system

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