Probe processing method, system, electronic device, and readable storage medium

By introducing a probe management module outside the container repository and dynamically adjusting the probe strategy, the problem of abnormal container restarts caused by probe strategy adjustments in containerized application platforms was solved, and the stable operation of application containers was achieved.

CN116048618BActive Publication Date: 2026-11-27ALIBABA (CHINA) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211711772.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-29
Publication Date
2026-11-27
Estimated Expiration
2042-12-29

AI Technical Summary

Technical Problem

In platforms that manage containerized applications, improper probe policy configuration can lead to abnormal container restarts. Existing technologies require rebuilding the container repository to adjust the probe policy, which affects the normal operation of the application.

Method used

A probe management module is introduced and configured outside the container repository. It is used to maintain probe policies and arbitrate based on inspection results, dynamically adjust probe policies, and avoid rebuilding the container repository.

Benefits of technology

It reduces the probability of abnormal container restarts, improves the operational stability of application containers, and avoids application interruptions caused by probe strategy adjustments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116048618B_ABST
    Figure CN116048618B_ABST
Patent Text Reader

Abstract

The application discloses a probe processing method, a system, an electronic device and a readable storage medium, the method comprising: sending a probe check message to an application container, the application container being obtained after containerizing an application program, the application program being configured with a probe, the probe being configured to respond after receiving the probe check message; the application container being located in a container warehouse Pod; determining a check result of the probe according to a response of the probe; reporting the check result to a probe management module, the probe management module being configured outside the Pod, the probe management module being configured to maintain a probe strategy and determine an operation performed on the application container according to the probe strategy and the check result. The application solves the problem that the normal operation of the containerized application is affected when the container warehouse is reconstructed due to the modification of the probe strategy in the platform for managing the containerized application, thereby making the operation of the application container more stable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the software field, and more specifically, to probe processing methods, systems, electronic devices, and readable storage media. Background Technology

[0002] Applications (APPs) require the support of an operating system and other runtime environments to run. To enable applications to run in different environments, they can be containerized. A container is essentially a software package that provides a complete runtime environment for the application, which may include the application's code, configuration files, libraries, and dependencies required to run the application.

[0003] In related technologies, some platforms provide the functionality to containerize applications. These platforms can be referred to as platforms for managing containerized applications. Running a large number of containers on these platforms, the inventors discovered that various problems frequently arise due to probe failures (such as causing abnormal container restarts). Probe failures are usually caused by improper probe policy configuration, and modifying the probe policy requires rebuilding the container repository (Pod) where the container resides, which impacts applications that use containers to provide services. Summary of the Invention

[0004] This application provides a probe processing method, system, electronic device, and readable storage medium to at least solve the problem that modifying probe policies in a platform for managing containerized applications requires rebuilding the container repository where the container resides, which affects the normal operation of the containerized application.

[0005] According to one aspect of this application, a probe processing method is provided, comprising: sending a probe inspection message to an application container, wherein the application container is obtained by containerizing an application, the application is configured with a probe, the probe being used to respond after receiving the probe inspection message; the application container is located within a container repository Pod, the Pod including at least one container; determining the probe inspection result based on the probe's response; and reporting the inspection result to a probe management module, wherein the probe management module is configured outside the Pod, the probe management module being used to maintain a probe policy and to determine the operation to be performed on the application container based on the probe policy and the inspection result.

[0006] According to another aspect of this application, a probe processing method is also provided, comprising: a probe management module receiving the inspection result of a probe, wherein the probe is configured in an application, the probe is used to respond after receiving a probe inspection message, and the inspection result is determined based on the response of the probe after sending the probe inspection message to the probe; the application is containerized to obtain an application container, the application container is located in a container repository Pod, and the Pod includes at least one container; the probe management module determines the operation to be performed on the application container according to a pre-configured probe policy and the inspection result, wherein the probe management module is configured outside the Pod.

[0007] According to another aspect of this application, a probe processing system is also provided, comprising: a probe proxy module and a probe management module, wherein the probe proxy module is used to execute the above-described method, and the probe management module is used to execute the above-described method.

[0008] According to another aspect of this application, an electronic device is also provided, including a memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the above-described method steps.

[0009] According to another aspect of this application, a readable storage medium is also provided, on which computer instructions are stored, wherein the computer instructions, when executed by a processor, implement the above-described method steps.

[0010] In this embodiment, a probe inspection message is sent to an application container, wherein the application container is obtained by containerizing an application, and the application is configured with a probe, which is used to respond after receiving the probe inspection message; the application container is located in a container repository Pod, and the Pod includes at least one container; the probe inspection result is determined based on the probe response; the inspection result is reported to a probe management module, wherein the probe management module is configured outside the Pod, and the probe management module is used to maintain probe policies and determine the operations to be performed on the application container based on the probe policies and the inspection result.

[0011] Given that probe configuration information in existing platforms is configured within Pods, adjustments to probe configurations require Pod rebuilding. This step introduces a probe management module outside the Pod. This module maintains probe policies and derives arbitration results based on the policies and inspection outcomes. Therefore, probe configuration management no longer requires Pod-based configuration information. The Pod no longer stores probe configuration information; instead, the probe management module obtains the arbitration results. This ensures that probe policy maintenance is decoupled from Pods, allowing for dynamic adjustments. With dynamic adjustment of probe policies, if an application container experiences an abnormal restart, the policy can be adjusted immediately, reducing the probability of recurring abnormal restarts. This application solves the problem of disrupting the normal operation of containerized applications caused by rebuilding the container repository when modifying probe policies in platforms managing containerized applications, thus making application container operation more stable. Attached Figure Description

[0012] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0013] Figure 1 This is a flowchart illustrating the containerized application process based on relevant technologies;

[0014] Figure 2 This is a flowchart of the probe processing method according to an embodiment of this application. Figure 1 ;

[0015] Figure 3 This is a flowchart of the probe processing method according to an embodiment of this application. Figure 2 ;

[0016] Figure 4 This is a schematic diagram of the probe processing flow after adding a probe proxy according to an embodiment of this application; and,

[0017] Figure 5 This is a schematic diagram illustrating the configuration of different probes on multiple containers according to embodiments of this application. Detailed Implementation

[0018] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0019] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0020] The following embodiments involve containerized applications and software platforms for managing containerized applications. The technical terms involved in the following embodiments will be explained first.

[0021] Containerized applications

[0022] Applications (APPs) require the support of an operating system and other runtime environments to run. To enable applications to run in different environments, they can be containerized. A container is essentially a software package that provides a complete runtime environment for the application, including its code, configuration files, libraries, and dependencies. Containerization is a method of distributing applications or systems that isolates the application or system and its dependencies from the underlying infrastructure. It is a form of operating system-level virtualization that allows users to deploy and run applications in containers without having to start an entire virtual machine for each application.

[0023] Figure 1 This is a flowchart illustrating the containerized application process based on relevant technologies, such as... Figure 1 As shown, the process includes the following steps:

[0024] Step 1: Write the application (APP) code.

[0025] Step ②: Create a container file (Dockerfile). This container file includes a description of the current application, its dependencies, and how to run the application. It should be noted that in the following implementations, the container can be implemented using either Docker or containerd technology. It should also be noted that there are multiple implementation methods for container technology; for example, it can be implemented using Docker or containerd. Although both are translated as "container" in Chinese, these two technologies are different. The following implementations are applicable to various container technologies, and the differences between these technologies do not affect the implementation of the following methods; therefore, they will not be elaborated upon further.

[0026] Step 3: Execute the Docker image build command on the Dockerfile.

[0027] Step 4: Push the Docker image to the Docker host.

[0028] Step 5: Run the Docker image on the container host as a container or as a service.

[0029] Kubernetes

[0030] Kubernetes, abbreviated as K8s, is an abbreviation for "ubernete," where "8" represents the eight characters in the name. K8s is a platform for managing containerized applications across multiple hosts in a cloud environment. It should be noted that while some implementation methods below are illustrated using K8s as an example, they are applicable to other platforms used for managing containerized applications.

[0031] Pod

[0032] A pod is the smallest scheduling unit of a platform (or simply platform) that manages containerized applications. A pod can run one or more containers. Running one container within a pod is the common usage, where a pod can be thought of as a wrapper around a single container. Multiple containers can also run simultaneously within a pod. These containers can be tightly coupled and collaborate, sharing resources. The platform can also assign each pod an Internet Protocol (IP) address, called a Pod IP, which is shared by all containers within a pod. Any two pods can communicate with each other. The most frequent type of container running within a pod is the application container, which is the container that hosts the application.

[0033] node

[0034] The platform runs containers by placing them into Pods that run on nodes. A node can be a virtual machine or a physical machine, depending on the cluster configuration. Each node contains the services required to run a Pod. In Kubernetes, the components on a node include kubelet, container runtime, and kube-proxy. Kubelet manages the Pods and containers within them on that node, maintaining the running state of the Pods on worker nodes; the container runtime is the software module responsible for running containers; and kube-proxy is a network proxy that runs on each node.

[0035] Sidecar container

[0036] A sidecar container is a type of container within a Pod. The term "sidecar" literally translates to "side vehicle," and a sidecar is like adding a third wheel and a seat to a two-wheeled motorcycle, turning it into a three-wheeled vehicle. This expands functionality, such as improving stability or carrying more passengers or cargo. Sidecar containers achieve separation of control and logic by adding a "sidecar" to the application container. For example, sidecar containers can be used to perform control capabilities that don't need to be implemented by the main application service, such as log collection, service registration, service discovery, rate limiting, and authentication. Therefore, sidecar containers typically do not contain processes related to the main application service; they are used to provide specific management capabilities.

[0037] probe

[0038] A probe can be understood as a way to detect whether a program is running normally. In platforms managing containerized applications, whether the application is running normally is a primary concern for users. However, simply checking the container's running status is insufficient to determine if the application is actually running, as a running container does not always guarantee a running application. Therefore, some platforms provide probe functionality, and for platforms that don't offer this feature, users can develop their own. In platforms managing containerized applications, users can use various types of probes, either provided by the platform or developed independently. For example: Readiness Probe: Determines if the container is ready; if not, the container will be marked as not ready. Liveness Probe: Determines if the application within the container is running normally; if not, the platform will restart the container. Startup Probe: Determines if the application within the container has successfully started; the Readiness and Liveness probes will not execute until the Startup Probe successfully determines this.

[0039] Of the three probes mentioned above: Startup probe: operates during container startup. This probe pauses other probes during runtime, and restarts the container if the probe fails a test. Liveness probe: operates during normal container operation. It restarts the container if the probe fails a test. Readiness probe: operates during normal container operation. If the probe fails a test, the Pod will enter a Not Ready state, and the platform will not forward traffic to it.

[0040] Probes can employ various methods for probing. For example, `exec`: This involves executing a specified command within the container and checking the status code returned upon exit. A status code of 0 indicates success; this method is called the executable method (`exec`). Another example is sending a GET request to the container's IP address, port, and URL path. A status code between 200 and 399 indicates success; this method is called the Hypertext Transfer Protocol (HTTP) GET method. Yet another example is checking the Transmission Control Protocol (TCP) against the container's IP address and specified port. If the port is open, this method is called the TCP socket method. Of course, probes can use other methods for probing, which will not be elaborated upon here.

[0041] If multiple containers run within a Pod, each container corresponds to a process, and a probe is configured within that container to detect whether the corresponding process is running correctly. Probes are designed to enhance application availability, providing some fault isolation and self-healing capabilities. However, because some types of probes (Startup and Liveness probes) may cause container restarts if they fail, improper use can easily lead to unexpected results and negatively impact stability. Many abnormal container restarts during Pod operation are caused by problems with probe configuration. The following two examples illustrate this.

[0042] Example 1 illustrates a service dependency scenario. A service's operation depends on other services. For instance, an application might include three services: A, B, and C. Each service runs in a container. Service A depends on service B, and service B depends on service C. Probes are configured in services A and B. If the probe results for services A and B are configured to be affected by the dependent service (i.e., service C), then when service C becomes unavailable, the probe results will cause containers A and B to restart. In this scenario, containers A and B would not normally need to restart; they would only need to wait for service C to recover.

[0043] Example 2: The configuration parameters available for the probe may include, but are not limited to, the following:

[0044] Initial DelaySeconds: The delay before the first liveness probe request is sent, i.e., how long after the container starts will the first probe operation begin. It is displayed as the delay attribute. The default is 0 seconds, which means that the probe will start immediately after the container starts. This parameter value should be greater than the maximum initial duration of the container to avoid the program never starting.

[0045] Timeout in seconds: The timeout duration for the liveness probe, displayed as the timeout attribute. The default value is 1 second, and the minimum value is 1 second. A reasonable value should be set for this parameter to avoid Pod restarts due to response delays caused by heavy application load.

[0046] Period Seconds: The frequency of liveness probes, displayed as the period attribute. The default value is 10 seconds, and the minimum value is 1 second. It should be noted that too high a frequency will bring significant additional overhead to the pod object, while too low a frequency will result in a slow response to errors.

[0047] Success Threshold: The minimum number of consecutive successful probe operations required to pass the test when the probe is in a failed state. It is displayed as the #success attribute and can only take the value 1.

[0048] Failure Threshold: The minimum number of consecutive failures required for a probe operation to be considered a failure when the operation is in a successful state. It is displayed as the #failure attribute, with a default value of 3 and a minimum value of 1.

[0049] If the probe is configured to be too sensitive when configuring the above parameters, it may cause the application to restart during startup or normal operation.

[0050] When the above problem occurs, the probes need to be reconfigured. However, since the probes are configured in containers, and containers run in Pods, the probe configurations in Pods cannot be dynamically modified. Therefore, the only way to modify the probe configurations is to rebuild the Pod. But rebuilding the Pod introduces risks to the application, which should be avoided as much as possible. Therefore, users cannot modify the probe configurations without rebuilding the Pod, which leads to these probe configurations being used indefinitely, resulting in abnormal restarts.

[0051] To address the issue of abnormal application container restarts caused by the inability to dynamically modify probe configurations, a probe processing method is provided in the following embodiments. Figure 2 This is a flowchart of the probe processing method according to an embodiment of this application. Figure 1 ,like Figure 2 As shown below, Figure 2 The steps involved in the method described are explained.

[0052] Step S202: Send a probe inspection message to the application container, wherein the application container is obtained by containerizing the application, the application is configured with a probe, and the probe is used to respond after receiving the probe inspection message; the application container is located in a container pod, and the pod includes at least one container.

[0053] In this step, the platform providing the Pod sends probe check messages to the application container based on the probe configuration information. The platform also configures a software module for maintaining the Pod; in the following embodiments, this module is referred to as the Pod management module (also called the module for managing Pods). For example, in Kubernetes, the management module is kubelet. The optional embodiments described below use kubelet as an example, and these optional embodiments are also applicable to Pod management modules on other platforms. Typically, platforms for managing application containers provide probe functionality. When using probe functionality, the Pod management module can be used to send probe check messages for probe inspection. Therefore, steps S202 to S206 can be implemented using the Pod management module, thus eliminating the need for an additional software module (or software component). However, considering that this approach requires modifications to the management module, which may affect the application scope of the following embodiments, it is also possible to consider adding an additional software module. Figure 2 The steps in. In short, regardless of Figure 2 The specific software module responsible for implementing the steps does not affect the resolution of the technical problem.

[0054] Step S204: Determine the probe inspection result based on the probe's response.

[0055] In this step, the inspection result can be determined using existing methods, depending on the circumstances. For example, if the probe does not respond within a predetermined time, the inspection result is considered a failure of the probe inspection.

[0056] Step S206: The inspection results are reported to the probe management module (hereinafter referred to as probe management). The probe management module is configured outside the Pod (e.g., the probe management module can be a software component). The probe management module maintains probe policies and determines the operations to be performed on the application container based on the probe policies and the inspection results. The probe policies here can include configuration information of probes configurable on the platform, or a combination of probe configuration information, or a probe processing policy defined by the user according to the application's needs. The probe policies can be pre-configured to perform various operations on the container based on different probe results. The probe policies can be configured according to the probe parameters in Example 2 above. For example, in Example 2, which involves the number of failures, the probe policy can be configured to restart the container if the probe results reach the required number of failures. Of course, other policies can also be formulated according to actual needs, which will not be elaborated here.

[0057] Given that probe configuration information in existing platforms is configured within Pods, adjustments to probe configurations require Pod rebuilding. This step introduces a probe management module outside the Pod. This module maintains probe policies and derives arbitration results based on the policies and inspection outcomes. Therefore, probe configuration management no longer requires Pod-based configuration information. The Pod no longer stores probe configuration information; instead, the probe management module obtains the arbitration results. This ensures that probe policy maintenance is decoupled from Pods, allowing for dynamic adjustments. With dynamic adjustment of probe policies, if an application container experiences an abnormal restart, the policy can be adjusted immediately, reducing the probability of recurring abnormal restarts. Therefore, these steps resolve the issue of disrupting the normal operation of containerized applications caused by rebuilding the container repository when modifying probe policies in platforms managing containerized applications, thus making application container operation more stable.

[0058] The above embodiments have already been discussed. Figure 2 The probe processing method shown can be executed by the Pod management module, or it can be executed by a newly added software module. In an optional implementation, a probe proxy module (referred to as probe proxy) can be added to execute it. Figure 2 The method steps shown in the diagram indicate that the probe agent module is a software component configured within the Pod.

[0059] After adding the probe proxy module, the original Pod management module on the platform still sends probe check messages. Since the probe proxy module also sends these messages, this can lead to duplicate messages. To solve this problem, the Pod management module can be modified to stop sending probe check messages. The scope of this modification has already been explained above. Therefore, in another optional implementation, a probe proxy can be used to solve this problem. In this optional implementation, the probe proxy module receives probe check messages from the Pod management module through a predetermined network port. These received messages are used to check probes configured on the application. After receiving the probe check messages on the predetermined network port, the probe proxy module sends a response message to the source of the probe check messages. This optional implementation does not require modification to the module that sends probe check messages in the existing platform; the probe proxy handles the response to the probe check messages.

[0060] For the probe proxy module, the timing of sending probe request messages to the application container can also be determined based on the timing of sending probe check messages by the Pod management module in the platform. In this optional implementation, sending the probe check message to the application container may include the following steps: after the probe proxy receives the probe check message on the predetermined network port, it sends the probe check message to the application container. In another optional implementation, the probe policy maintained in the probe management module may also include the method for the probe proxy module to send probe request messages to the application container. The probe management module can send the method for sending probe request messages to the probe proxy module, and then the probe proxy module can send the probe request message according to the method for sending probe request messages in the probe policy.

[0061] To facilitate better communication between the probe proxy module and the application container, the probe proxy module can be configured within a Pod, for example, directly within the application container. However, this configuration method may have risks; for instance, heavy application container load can affect the probe proxy module's processing. To avoid the application container's load impacting the probe proxy module, in another optional implementation, the probe proxy module resides in a container (e.g., a separate sidecar container). The container housing the probe proxy module is within the same Pod as the application container, and their computing resources are independent. In this optional implementation, the container housing the probe proxy module is different from the application container, thus avoiding the application container's load affecting the probe proxy module.

[0062] The above optional implementation was described from the perspective of the probe proxy module. The following is a description from the perspective of the probe management module.

[0063] Figure 3 This is a flowchart of the probe processing method according to an embodiment of this application. Figure 2 ,like Figure 3 As shown below, Figure 3 The steps involved in the method described are explained.

[0064] In step S302, the probe management module receives the inspection result of the probe, wherein the probe is configured in the application and is used to respond after receiving the probe inspection message. The inspection result is determined based on the response of the probe after sending the probe inspection message to the probe. The application is containerized to obtain an application container, which is located in a container pod. The pod includes at least one container.

[0065] Step S304: The probe management module determines the operation to be performed on the application container based on the pre-configured probe policy and the inspection result, wherein the probe management module is configured outside the Pod.

[0066] In this step, a probe management module is introduced outside the Pod. This module maintains the probe policy and obtains the arbitration result based on the probe policy and the inspection results. This ensures that the maintenance of the probe policy is decoupled from the Pod, allowing for dynamic adjustments to the probe policy. With dynamic adjustment of the probe policy, if an abnormal restart of the application container occurs, the probe policy can be adjusted at any time, reducing the probability of a recurrence of abnormal application container restarts. On the other hand, abnormal restarts of application containers are often caused by the platform's default behavior of restarting the application container after probe failure. However, in some cases, not restarting the application container can also resolve the probe failure issue.

[0067] To address this issue, in an optional implementation, users can configure the actions to be taken after a probe fails. Specifically, the probe management module determines the actions to be performed on the application container based on a pre-configured probe policy and the inspection results. This can include the following steps: After determining that a probe has failed based on the probe policy and the inspection results, the probe management module executes the actions required to address the probe failure. These actions are pre-configured by the user. This optional implementation not only allows configuration of the probe policy but also of the actions to be performed after a probe failure, improving the flexibility of user configuration.

[0068] As another optional implementation, the platform's default settings can also be used for the actions taken after the probe fails. Whether the user manually configures the actions to be taken after the probe fails depends on the application container configured by the user. For example, application container A may use the default settings after the probe fails, while application container B may use the user-configured settings.

[0069] The probe management module can also flexibly maintain probe policies. For example, the probe management module receives a request from a user to maintain the probe policy; the probe management module is used to maintain the probe policy according to the request, wherein the maintenance includes at least one of the following: adding, modifying, or deleting.

[0070] The probe strategy may also include various strategies, such as at least one of the following: stopping sending probe check messages to the application container for a predetermined period of time when the application container experiences continuous probe failures; considering the probe check to be passed regardless of the check result; limiting the number of times the application container and / or Pod is restarted due to probe check failures within a predetermined period of time; and limiting the number of application containers and / or Pods restarted due to probe check failures within a predetermined period of time.

[0071] The above implementation method enables dynamic adjustment of the probe strategy and can be applied to various platforms. The following description uses Kubernetes as an example. In the following implementation, probe control is also broken down into two modules: a probe management module and a probe agent module. These two modules are described separately below.

[0072] Probe management module: A stand-alone component (running independently of the Pod where the application container resides), responsible for arbitrating probe results according to the probe policy configured by the user and triggering probe failure handling.

[0073] Probe Proxy Module: This module can be a sidecar container that accompanies the Pod containing the application container. Consider a module or process that already exists in the platform to check probes within the application container. This module or process can be called the module or process for managing Pods or containers (simply referred to as the management module or process; for example, in Kubernetes, this management module or process is kubelet; we will use kubelet as an example below). After adding the probe proxy module, it can handle the probe checks performed by kubelet. For example, the probe proxy module can provide a fixed HTTP interface for kubelet to check. Besides providing a fixed interface for kubelet to check, the probe proxy module can also check the application container's TCP port or HTTP interface (i.e., check the probes configured in the application container) according to user-configured probe operations, and report the results to the probe management module.

[0074] The probe management module allows the configuration policy for probes to be independent of the Pod. This enables users to directly modify the probe policy without rebuilding the Pod, thus achieving dynamic adjustment of the probe policy.

[0075] Figure 4 This is a schematic diagram of the probe processing flow after adding a probe proxy according to an embodiment of this application, as shown below. Figure 4 As shown, in the appendix Figure 4In the process, step 1 involves the user configuring probes on the application, followed by step 2, which is divided into two steps: 2a and 2b. In step 2a, a module for load balancing (e.g., Deployment) is created, which also manages Pods. The probes are stripped, and an application container for the application is created within the Pod. A sidecar container is created as a probe proxy, injecting the configuration information of the probes on the application into the probe proxy, which then checks the probes. In step 2b, the policies corresponding to the probes are synchronized to the probe management module, which is located outside the Pod containing the application container and communicates with the probe proxy. Step 3 involves the sidecar container providing a fixed HTTP interface for the platform's modules or processes (e.g., Kubelet) used to maintain Pods and / or containers to perform probe checks. Step 4 involves the sidecar container, acting as a probe proxy, sending probe check messages to the application container. After receiving the probe check results, the process proceeds to step 5. Step 5: The probe agent reports the probe inspection results to the probe management module. The probe management module can perform two functions: result arbitration and failure handling. Result arbitration is based on the probe inspection results and a pre-configured strategy to determine the appropriate handling method. If the probe is determined to be invalid based on the inspection results, proceed to step 6. Step 6: Perform probe failure handling. Probe failure handling is performed according to a pre-configured method, which will not be elaborated further here. Step 7: After a module or process (e.g., Kubelet) used by the platform to maintain pods and / or containers fails to check the fixed HTTP interface provided by the sidecar container, Kubelet restarts the application container.

[0076] Users can modify probe policies through the probe management module. Figure 4Steps 1 to 2b shown allow modification of the probe strategy. This enables intervention in the probe results. For example, a failure count can be configured, indicating the minimum number of consecutive failures required for a successful probe check to be considered a failure. This value can be set to a maximum of 3. If the failure count is set to 3, the check is considered a failure after 3 failures, and the probe strategy is to restart the container hosting the probe when the check fails. However, it was found that setting the value to 3 is still relatively small and can still cause unnecessary restarts. Since the maximum value of this parameter is 3 in the platform settings, it's not possible to increase the value. In this case, the probe strategy can be configured to restart the container only after receiving two consecutive failures. This probe strategy indicates that after 3 failures, the check is considered a failure; if two consecutive failures are detected, the probe has already failed 6 times. By configuring the probe strategy in this way, the number of probe failures can be increased, while the number of restarts can also be controlled. Of course, this strategy can also be adjusted. For example, the number of failed checks can be adjusted to 1 or 3. Adjusting the strategy does not require rebuilding the Pod.

[0077] It should be noted that, in Figure 4 The module used to manage PODs is an existing module that originally performed probe checks. In an optional implementation, the probe checking function in this module can be removed. This way, the module will no longer perform probe checks and will not restart the container based on the probe check results. In this way, all probe checks and subsequent restart actions can be performed by the probe management module.

[0078] However, removing the probe checking function in the management POD module is not easy to implement and may cause other problems. Therefore, in the above implementation, the probe checking function in the management POD module is not removed. Instead, an additional probe (i.e., the interface in step 3 above) is provided through the sidecar container, which is specifically for the management POD module to check. In this way, the management POD module no longer checks the probes in the actual application container. The probes in the actual application container are checked and processed by the probe management module.

[0079] In another example, a probe switch can be configured in the probe policy to disable probes. This ensures the probe always passes the check regardless of the probe agent's report; the probe is then enabled only when needed. Besides disabling probes, when an application container experiences consecutive probe failures, the probe can be silenced for a period (the duration of which is configurable) to allow it to start normally.

[0080] The examples above could be probe strategies targeting a single Pod. Figure 5 This is a schematic diagram illustrating the process of configuring different probes on multiple containers according to embodiments of this application, such as... Figure 5 As shown, the software modules required to provide web page services can be packaged into application container 1, and the software modules required to provide database services can be packaged into application container 2. Then, application container 1 and application container 2 are configured on a container platform. In this way, application container 1 can provide web page services, and application container 2 can provide database services. Application containers 1 and 2 can be configured with probes. The probe management module can manage the probes in application containers 1 and 2 using different strategies. Users can also modify the probe strategies of application containers 1 and 2 at any time through the probe management module. These details have been explained in the above embodiments and will not be repeated here.

[0081] Of course, probe strategies can also be applied to multiple Pods. Applying probe strategies to multiple Pods can also improve the stability of the application and platform.

[0082] For example, when the service load provided by the application containers in a Pod is relatively high (i.e., the service is under pressure), a probe failure can cause some Pods to restart. During the restart, the original service requests are distributed to other Pods for a period of time, leading to more Pod restarts, a process resembling an avalanche. This avalanche is more dangerous for applications written in specific programming languages. For example, for applications written in Java, due to Java's slow start characteristic, the performance of a restarted Pod is poor for a period of time, and probes are more likely to fail, prolonging the entire startup process or even preventing it from succeeding. In this situation, even scaling up the Pods will face the same problem, because the new Pods will repeatedly restart over a period of time, making it impossible to distribute the service load in a timely manner, requiring a considerable amount of time to resolve the issue. The reason for this problem is that kubelet makes decisions based on the detection results of a single probe. This single-probe approach cannot provide global control and cannot eliminate the system avalanche problem caused by the restart of a majority of Pods. After introducing the probe management module, probe policies can be configured for multiple Pods. For example, if an application is configured to provide services to the outside world in multiple Pods, the probe policy can limit the number of restarts, the number of restarted Pods, or the number of restarted containers caused by probe check failures within a certain period of time to a certain value. In this way, the number of simultaneous restarts within a certain period of time can be controlled, thereby avoiding application avalanche.

[0083] In the above optional implementation, it is also possible to modify the kubelet to maintain probes and execute probe policies, i.e., the kubelet performs the functions of the probe management module. However, considering that modifying the kubelet would be intrusive to the platform, its applicability would be relatively poor. Therefore, a separate probe management module is used in the above optional implementation.

[0084] In the above optional implementation, the probe proxy is configured in the sidecar container. It can also be configured in the application container, but configuring it in the application container presents a problem: once the probe proxy is embedded in the application container, the resources between the probe proxy and the application container are not isolated. When the application container becomes unresponsive (e.g., the container's CPU utilization reaches its upper limit), the probe proxy will also fail to function properly. Therefore, configuring the probe proxy in a container other than the application container within the Pod is a better way to achieve resource isolation.

[0085] Therefore, the above requires no modification to the kubelet, carries no upgrade burden, and is applicable to any platform and cluster used for managing containerized applications. Furthermore, the sidecar container is resource-isolated from the application container; when the application container becomes unresponsive, the probe agent can still function normally, improving the stability of the probe operation.

[0086] The above optional implementation methods provide a solution for dynamically controlling probes, which is valuable for improving service stability. Furthermore, the independent probe management module makes the probe control strategy highly extensible, allowing for the customization of rich control policies and thus achieving global stability control. In addition, the failure handling module can trigger user-specified steps, thereby realizing an automated workflow after probe failure.

[0087] In this embodiment, an electronic device is provided, including a memory and a processor. The memory stores a computer program, and the processor is configured to run the computer program to perform the methods described in the above embodiments.

[0088] The aforementioned program can run on a processor or be stored in memory (or computer-readable medium). Computer-readable medium includes both permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable medium does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0089] These computer programs may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes can be implemented using different modules, and different steps can be implemented using different modules.

[0090] One embodiment provides such a system. This system, which may be referred to as a probe processing system, includes: the probe proxy module and the probe management module described in the optional embodiments above.

[0091] Optionally, the system may further include a Pod management module, wherein the Pod management module is used to manage the Pod, and the Pod management module is also used to send probe check messages to the probe proxy module via a predetermined network port, and restart the application container if the probe proxy module does not send a response to the probe check message.

[0092] In one embodiment, an apparatus, referred to as a probe processing apparatus, may also be provided, comprising: a sending unit for sending probe inspection messages to an application container, wherein the application container is obtained by containerizing an application, the application is configured with probes, and the probes are used to respond after receiving the probe inspection messages; the application container is located within a container pod, and the pod includes at least one container; a determining unit for determining the inspection result of the probe based on the response of the probe; and a reporting unit for reporting the inspection result to a probe management module, wherein the probe management module is configured outside the pod, and the probe management module is used to maintain probe policies and determine the operations to be performed on the application container based on the probe policies and the inspection results.

[0093] Optionally, the above-described device is executed within a probe proxy module, wherein the probe proxy module is a software component configured within the Pod.

[0094] Optionally, it further includes: a receiving unit, configured to receive a probe inspection message through a predetermined network port, wherein the received probe inspection message is used to inspect probes configured on the application; and a second sending unit, configured to send a response message to the source of the probe inspection message after receiving the probe inspection message at the predetermined network port.

[0095] Optionally, the sending unit is configured to send a probe check message to the application container after receiving the probe check message at the predetermined network port.

[0096] Optionally, the probe proxy module is located in a container, and the container where the probe proxy module is located is in the same Pod as the application container. The computing resources used by the container where the probe proxy module is located and the application container are independent of each other.

[0097] In one embodiment, an apparatus, referred to as a probe processing apparatus, located within a probe management module, is also provided, comprising: a second receiving unit for receiving inspection results of a probe, wherein the probe is configured in an application, the probe is used to respond after receiving a probe inspection message, and the inspection result is determined based on the response of the probe after sending the probe inspection message; the application is containerized to obtain an application container, the application container is located within a container pod, and the pod includes at least one container; and a second determining unit for determining the operation to be performed on the application container based on a pre-configured probe strategy and the inspection result, wherein the probe management module is configured outside the pod.

[0098] Optionally, after the second determining unit determines that the probe has failed based on the probe strategy and the inspection result, the probe management module performs operations for the probe failure, wherein the operations for the probe failure are pre-configured by the user.

[0099] Optionally, it further includes: a third receiving unit, configured to receive a request from a user to maintain the probe strategy; and a maintenance unit, configured to maintain the probe strategy according to the request, wherein the maintenance includes at least one of the following: adding, modifying, or deleting.

[0100] Optionally, the probe strategy includes at least one of the following: stopping sending probe check messages to the application container for a predetermined period of time when the application container experiences continuous probe failures; considering the probe check to be passed regardless of the check result; limiting the number of times the application container and / or Pod is restarted due to probe check failures within a predetermined period of time; and limiting the number of application containers and / or Pods restarted due to probe check failures within a predetermined period of time.

[0101] The system or apparatus is used to implement the function of the method in the above embodiments. Each unit in the system or apparatus corresponds to each step in the method, as has been described in the method and will not be repeated here.

[0102] The above optional implementation methods solve the problem that the container repository where the container resides needs to be rebuilt when modifying the probe strategy in the platform used to manage containerized applications, which affects the normal operation of containerized applications, thereby making the operation of application containers more stable.

[0103] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A probe processing method, comprising: A probe proxy module configured within a Pod sends probe inspection messages to the application container. The application container is obtained by containerizing the application, and the application is configured with probes that respond upon receiving the probe inspection message. The application container is located within a container repository Pod, which includes at least one container. The probe proxy module is a software component configured within the Pod. The container containing the probe proxy module and the application container are located in the same Pod and have independent computing resources. The probe agent module determines the probe's inspection result based on the probe's response. The probe proxy module reports the inspection results to the probe management module, which is configured outside the Pod. The probe management module maintains the probe policy and determines the operation to be performed on the application container based on the probe policy and the inspection results. The probe policy includes at least one of the following: stopping sending probe inspection messages to the application container for a predetermined period of time when the application container experiences continuous probe failures; considering the probe inspection to be passed regardless of the inspection result; limiting the number of times the application container and / or Pod is restarted due to probe inspection failures within a predetermined period of time; and limiting the number of application containers and / or Pods restarted due to probe inspection failures within a predetermined period of time. The method further includes: The probe proxy module receives probe inspection messages through a predetermined network port, wherein the received probe inspection messages are used to inspect the probes configured on the application. After receiving the probe inspection message at the predetermined network port, the probe proxy module sends a response message to the source of the probe inspection message; Sending the probe inspection message to the application container includes: After receiving the probe check message on the predetermined network port, the probe proxy module sends the probe check message to the application container so that the Pod management module does not restart the application container and stops checking the probes in the application container. The Pod management module is used to manage the Pod. The Pod management module is also used to send probe check messages to the probe proxy module via a predetermined network port, and to restart the application container if the probe proxy module does not send a response to the probe check message.

2. The method according to claim 1, wherein, The probe proxy module is located in a container, and the computing resources used by the container where the probe proxy module is located are independent of each other.

3. A probe processing method, comprising: The probe management module receives the inspection results of probes from the probe proxy module configured within the Pod. The probes are configured within the application and respond to the received probe inspection message. The inspection results are determined by the probe proxy module after receiving the probe inspection message through a predetermined network port and sending the message to the probe based on the probe's response. The received probe inspection message is used to inspect the probes configured on the application. After receiving the probe inspection message at the predetermined network port, the probe proxy module sends a response message to the source of the probe inspection message, preventing the Pod management module from restarting the application container and stopping the inspection of probes within the application container. The application is containerized to form an application container, which resides within a containerized Pod. Each Pod includes at least one container. The probe proxy module is a software component configured within the Pod. The container containing the probe proxy module and the application container reside in the same Pod but have independent computing resources. The probe management module determines the operation to be performed on the application container based on the pre-configured probe policy and the inspection result, wherein the probe management module is configured outside the Pod; the probe policy includes at least one of the following: stopping sending probe inspection messages to the application container for a predetermined period of time when the application container experiences continuous probe failures; considering the probe inspection to be passed regardless of the inspection result; limiting the number of times the application container and / or Pod is restarted due to probe inspection failures within a predetermined period of time; and limiting the number of application containers and / or Pods restarted due to probe inspection failures within a predetermined period of time. The Pod management module is used to manage the Pod. The Pod management module is also used to send probe check messages to the probe proxy module via a predetermined network port, and to restart the application container if the probe proxy module does not send a response to the probe check message.

4. The method according to claim 3, wherein, The probe management module determines the operations to be performed on the application container based on the pre-configured probe strategy and the inspection results, including: After the probe management module determines that the probe has failed based on the probe policy and the inspection results, the probe management module performs operations in response to the probe failure, wherein the operations in response to the probe failure are pre-configured by the user.

5. The method according to claim 3, wherein, Also includes: The probe management module receives requests from users to maintain probe policies; The probe management module is used to maintain the probe policy according to the request, wherein the maintenance includes at least one of the following: adding, modifying, or deleting.

6. A probe processing system, comprising: The probe proxy module and the probe management module are provided, wherein the probe proxy module is used to execute the method of claim 1 or 2, and the probe management module is used to execute the method of any one of claims 3 to 5.

7. An electronic device comprising a memory and a processor; wherein, The memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method steps of claim 1 or 2 or any one of claims 3 to 5.

8. A readable storage medium having computer instructions stored thereon, wherein, When executed by a processor, the computer instructions implement the method steps of claim 1 or 2, or any one of claims 3 to 5.

Citation Information

Patent Citations

  • Method and system for applying health examination based on Kubernetes container

    CN110825490A

  • Method and system for monitoring application state, storage medium and equipment

    CN114579252A

  • Application program management method and device, electronic equipment and computer readable storage medium

    CN114625478A