Containerized application program management method and cluster operation system using same
By including schedule time and deadline information in the Deployment resource, the existing technology cannot meet the need for stateless applications to start running at a specific time and automatically stop after a specified time, and achieve accurate time control of stateless applications.
Patent Information
- Application Number
- CN202410277175.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-09-01
- Filing Date
- 2024-03-12
- Publication Date
- 2025-03-04
AI Technical Summary
Existing Deployment designs are not able to meet the needs of stateless applications that need to start running at a specific time and automatically stop after running for a certain period of time.
By including scheduledTime information and deadlineSeconds information in the Deployment resource, the Deployment controller can accurately control the run time of a stateless application, creating or deleting ReplicaSet and pod resources to achieve this.
Accurate time control of stateless applications is realized, and can start running at a specific time and stop automatically after a specified time, meeting requirements that cannot be achieved in the prior art.
Smart Images

Figure CN119557043A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an application management method and a cluster computing system using the same, and in particular to a containerized application management method and a cluster computing system using the same. Background Art
[0002] In order to facilitate the automatic deployment, expansion and management of applications, an open source system of "containerized applications" has been developed. In this system, a series of building blocks are defined, the purpose of which is to provide a mechanism that can jointly provide deployment, maintenance and expansion of applications.
[0003] Such a system provides several built-in workload resources. The Deployment resource is used to manage stateless applications in the cluster, while the Job is used to define tasks that run until they are completed and stopped. The CronJob can further define a Job that is executed repeatedly according to time rules.
[0004] In the real world, we encounter stateless applications that require time rules. We need to start running the required application at a specific time, or we may need to automatically stop the application after running for a certain period of time. Since this is a stateless application, we cannot use Job or CronJob to achieve our goal. The current Deployment design cannot meet our needs. Summary of the invention
[0005] The present invention relates to a containerized application management method and a cluster computing system using the same, which utilizes scheduling time information and deadline information so that a deployment controller can accurately control the running time of a stateless application.
[0006] According to one aspect of the present invention, a containerized application management method is proposed. The containerized application management method includes the following steps: obtaining a deployment resource, the Deployment resource includes a scheduled time (scheduledTime) information and a deadline (deadlineSeconds) information; when a deployment (Deployment) controller listens to the Deployment resource, a replica set (ReplicaSet) resource is created; when a replica set (ReplicaSet) controller listens to the ReplicaSet resource, a cluster (pod) resource is created; and when a scheduler (scheduler) listens to the pod resource, the pod resource is allocated to a node (node) for execution. If the Deployment controller detects that the Deployment resource includes scheduledTime information, a ReplicaSet resource is created based on the scheduledTime information to execute the corresponding pod resource; if the Deployment controller detects that the Deployment resource includes deadlineSeconds information, the ReplicaSet resource and the corresponding pod resource are deleted based on the deadlineSeconds information.
[0007] According to another aspect of the present invention, a cluster computing system is proposed. The cluster computing system includes a deployment controller, a replica set controller, a scheduler, and several nodes. The Deployment controller is used to monitor a deployment resource. The Deployment resource includes a scheduled time information and a deadline information. If the Deployment controller monitors the Deployment resource, a replica set resource is created. The ReplicaSet controller is used to monitor the ReplicaSet resource. When the ReplicaSet controller monitors the ReplicaSet resource, a cluster resource is created. The scheduler is used to monitor the pod resource. If the scheduler monitors the pod resource, the pod resource is allocated to one of these nodes for execution. If the Deployment controller detects that the Deployment resource includes scheduledTime information, it creates a ReplicaSet resource based on the scheduledTime information to execute the corresponding pod resource; if the Deployment controller detects that the Deployment resource includes deadlineSeconds information, it deletes the ReplicaSet resource and the corresponding pod resource based on the deadlineSeconds information.
[0008] In order to better understand the above and other aspects of the present invention, embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1 This is an example diagram of the operation of the application program AP1 according to an embodiment.
[0010] Figure 2 This is a diagram showing an example of the operation of the application program AP2 according to an embodiment.
[0011] Figure 3 This is a diagram showing an example of the operation of the application program AP24 according to an embodiment.
[0012] Figure 4 is a schematic diagram of a cluster computing system according to an embodiment.
[0013] Figure 5 It is a flowchart of a containerized application management method according to an embodiment.
[0014] Figure 6FIG. 4 is a detailed flow chart of step S120 of an embodiment.
[0015] Reference numerals:
[0016] 100: Cluster computing system
[0017] 110: API Server
[0018] 120: Scheduler
[0019] 130: Controller Management Unit
[0020] 131:Deployment Controller
[0021] 132:ReplicaSet controller
[0022] 133:Job Controller
[0023] 140: etcd database
[0024] 150i:Node
[0025] AP: Stateless Application
[0026] AP1,AP2: Application
[0027] CT: Cumulative time
[0028] DM:Deployment resources
[0029] DS:deadlineSeconds information
[0030] PD:pod resources
[0031] RS:ReplicaSet resource
[0032] S110, S120, S121, S122, S123, S124, S125, S126, S130, S140: Steps
[0033] ST: scheduledTime information
[0034] T1, T2, T3, T4: time points
[0035] TM: System time DETAILED DESCRIPTION
[0036] Please refer to Figure 1, which is an example diagram of the operation of an application program AP1 in an embodiment. Application program AP1 is, for example, a state application such as volume increase or packet transmission. After such an application program is executed, all actions are terminated. For example, when the volume is to be increased by three levels continuously at time point T1, the application program AP1 can be repeatedly executed three times using a Job to achieve this.
[0037] Please refer to Figure 2 , which is an example diagram of the operation of application AP2 in one embodiment. Application AP2 is, for example, a stateless application such as an online course, a web page, or an advertisement. After being executed, this type of application remains in that state and does not automatically return to the original state. For example, if you want application AP2 to be executed between time point T2 and time point T3, since Job has no concept of time rules, it is impossible to use Job to achieve this state. In this embodiment, the scheduled time information ST and the deadline (deadlineSeconds) information DS can be used to allow application AP2 to be executed between time point T2 and time point T3.
[0038] Please refer to Figure 3 , which is an example diagram of the operation of the application program AP24 in another embodiment. By using the scheduledTime information ST and the deadlineSeconds information DS, it is also possible to allow the application program AP2 to be executed between the time point T2 and the time point T4.
[0039] Please refer to Figure 4 , which is a schematic diagram of a cluster computing system 100 of an embodiment. The cluster computing system 100 includes an API server 110, a scheduler 120, a controller management unit 130, an etcd database (also known as a distributed key-value database) 140, and a plurality of nodes 150i. The controller management unit 130 includes a deployment controller 131, a replica set controller 132, and a job controller 133. The cluster computing system 100 is, for example, composed of a plurality of computers. The API server 110, the scheduler 120, the controller management unit 130, the etcd database 140, and the node 150i are, for example, storage devices, circuits, chips, or circuit boards for storing program codes. The API server 110 , the scheduler 120 , the controller management unit 130 , the etcd database 140 , and the node 150 i are distributed among multiple computers of the cluster computing system 100 .
[0040] The Deployment controller 131 is used to monitor a deployment resource DM. If the Deployment controller 131 monitors the Deployment resource DM, it creates a replica set resource RS.
[0041] The ReplicaSet controller 132 is used to monitor the ReplicaSet resource RS. When the ReplicaSet controller 132 monitors the ReplicaSet resource RS, it creates a cluster (pod) resource PD.
[0042] The job controller 133 is used to monitor job resources.
[0043] The scheduler 120 is used to monitor the pod resources PD.
[0044] The pod resource PD is allocated to be executed on one of the nodes 150i.
[0045] In this embodiment, the Deployment resource DM includes scheduledTime information ST and deadlineSeconds information DS. Through the scheduledTime information ST and deadlineSeconds information DS, the Deployment controller 131 can control the stateless application AP more accurately. For example, the Deployment controller 131 can start running the required stateless application AP at a specific time, or automatically stop the stateless application AP after running for a certain period of time. The following also provides a flowchart to explain the operation of each component in detail.
[0046] Please refer to Figure 5 , which is a flow chart of a containerized application management method of an embodiment. In step S110, a Deployment resource DM is obtained. The Deployment resource DM includes scheduledTime information ST and deadlineSeconds information DS. The scheduledTime information ST is, for example, the date and time of the start of execution, or a certain time condition for the start of execution. The time condition is, for example, a certain length of time has passed from a predefined time, or a certain periodic time has arrived.
[0047] Next, in step S120, when the Deployment controller 131 monitors the Deployment resource DM, it creates the ReplicaSet resource RS. In this step, if the Deployment controller 131 detects that the Deployment resource DM includes the scheduledTime information ST, it creates the ReplicaSet resource RS according to the scheduledTime information ST.
[0048] In step S120 , the deployment controller 131 continues to compare a system time TM with the scheduledTime information ST until the system time TM reaches the setting value of the scheduledTime information ST.
[0049] In this embodiment, before the current ReplicaSet resource RS is deleted, a new ReplicaSet resource RS will not be created until the ReplicaSet resource RS is deleted.
[0050] Next, in step S130, when the ReplicaSet controller 132 monitors the ReplicaSet resource RS, it creates a pod resource PD. The Pod resource PD, for example, starts a stateless application AP. The stateless application AP, for example, is an online course, a web page, or an advertisement.
[0051] Then, in step S140, when the scheduler 120 monitors the pod resource PD, it allocates the pod resource PD to a node 150i for execution. For example, the scheduler 120 allocates the pod resource PD to a node 150i with a lower load, a node 150i with a higher processing capacity, or a node 150i with a less congested connection channel.
[0052] In this embodiment, during the execution of the above step S140, the Deployment controller 131 will continue to compare a cumulative time CT with the deadlineSeconds information DS. When the cumulative time CT reaches the set value of the deadlineSeconds information DS, the Deployment controller 131 will delete the executing ReplicaSet resource RS and the corresponding pod resource PD.
[0053] Please refer to Figure 6, which is a detailed flow chart of step S120 of an embodiment. In step S121, the Deployment controller 131 continuously detects whether the Deployment resource DM includes the scheduledTime information ST and the deadlineSeconds information DS. If the Deployment resource DM includes the scheduledTime information ST and the deadlineSeconds information DS, then the process proceeds to step S122.
[0054] In step S122, the deployment controller 131 determines whether the system time TM reaches the set value of the scheduledTime information ST. If the system time TM reaches the set value of the scheduledTime information ST, the process proceeds to step S123.
[0055] In step S123, the Deployment controller 131 creates a ReplicaSet resource RS and instructs the ReplicaSet controller 132 to execute the action of step S130. That is, at this time, step S130 and step S140 are executed successively.
[0056] While step S130 and step S140 are being executed, step S124 is also executed.
[0057] In step S124 , the Deployment controller 131 starts accumulating the cumulative time CT.
[0058] Next, in step S125, the deployment controller 131 determines whether the accumulated time CT reaches the set value of the deadlineSeconds information DS. If the accumulated time CT reaches the set value of the deadlineSeconds information DS, the process proceeds to step S126.
[0059] In step S126 , the Deployment controller 131 deletes the ReplicaSet resource RS and the corresponding pod resource PD.
[0060] According to the above embodiment, the Deployment controller 131 can accurately control the stateless application AP through the scheduledTime information ST and the deadlineSeconds information DS. For example, the Deployment controller 131 can start running the required stateless application AP at a specific time, or automatically stop the stateless application AP after running for a certain period of time.
[0061] In summary, although the present invention has been disclosed in the above embodiments, it is not intended to limit the present invention. A person skilled in the art of the present invention may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be determined by the above claims.
Claims
1. A containerized application management method, comprising: Obtain a deployment resource, the deployment resource including a scheduled time information and a deadline information; When a deployment controller listens to the Deployment resource, it creates a ReplicaSet resource; When a replica set (ReplicaSet) controller listens to the ReplicaSet resource, it creates a cluster (pod) resource; as well as When a scheduler monitors the pod resource, it allocates the pod resource to a node for execution; If the Deployment controller detects that the Deployment resource includes the scheduledTime information, the ReplicaSet resource is created according to the scheduledTime information to execute the corresponding pod resource; if the Deployment controller detects that the Deployment resource includes the deadlineSeconds information, the ReplicaSet resource and the corresponding pod resource are deleted according to the deadlineSeconds information.
2. The containerized application management method according to claim 1, characterized in that: The Deployment controller continuously compares a system time with the scheduledTime information until the system time reaches a set value of the scheduledTime information.
3. The containerized application management method according to claim 2, characterized in that: When the system time reaches the set value of the scheduledTime information, the ReplicaSet resource is created to execute the pod resource.
4. The containerized application management method according to claim 1, wherein: The Deployment controller continuously compares a cumulative time with the deadlineSeconds information until the cumulative time reaches a set value of the deadlineSeconds information.
5. The containerized application management method according to claim 4, characterized in that: When the accumulated time reaches the set value of the deadlineSeconds information, the ReplicaSet resource and the corresponding pod resource are deleted.
6. The containerized application management method according to claim 1, wherein: The pod resource is used to execute a stateless application.
7. A cluster computing system, comprising: A deployment controller is used to monitor a deployment resource, the deployment resource includes a scheduled time information and a deadline information. If the deployment controller monitors the deployment resource, a replica set resource is created. A replica set (ReplicaSet) controller, which is used to monitor the ReplicaSet resource. When the ReplicaSet controller monitors the ReplicaSet resource, it creates a cluster (pod) resource; A scheduler to monitor the pod resources; and multiple nodes, if the scheduler monitors the pod resource, the pod resource is allocated to one of the nodes for execution; If the Deployment controller detects that the Deployment resource includes the scheduledTime information, the ReplicaSet resource is created according to the scheduledTime information to execute the corresponding pod resource; if the Deployment controller detects that the Deployment resource includes the deadlineSeconds information, the ReplicaSet resource and the corresponding pod resource are deleted according to the deadlineSeconds information.
8. The cluster computing system as claimed in claim 7, wherein: The Deployment controller continuously compares a system time with the scheduledTime information until the system time reaches a set value of the scheduledTime information.
9. The cluster computing system as claimed in claim 8, characterized in that: When the system time reaches the set value of the scheduledTime information, the Deployment controller creates the ReplicaSet resource to execute the corresponding pod resource.
10. The cluster computing system according to claim 7, wherein: The Deployment controller continuously compares a cumulative time with the deadlineSeconds information until the cumulative time reaches a set value of the deadlineSeconds information.
11. The cluster computing system according to claim 10, wherein: When the accumulated time reaches the set value of the deadlineSeconds information, the Deployment controller deletes the ReplicaSet resource and the corresponding pod resource.