Container management cluster workload change analysis method and device
By capturing and analyzing the workload data of the container management cluster in real time, recording historical versions and implementing risk management solutions, it solves possible failure problems during automatic updates, improves the stability and recovery capabilities of the cluster, and ensures the reliability of the application .
Patent Information
- Application Number
- CN202411160105.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-12-10
AI Technical Summary
In container management clusters, automatic deployment and updates may lead to unpredictable failures and rollback problems, affecting the stability and user experience of applications, and it is difficult for existing technologies to effectively monitor and manage the health status of workloads.
Manage cluster workload data by capturing and filtering containers in real time, recording historical versions, calculating comprehensive change values, and alerting and rolling back according to preset risk control plans to deal with possible failures.
Real-time monitoring and risk control of changes in the workload of container management clusters is realized, which improves the stability and recovery capabilities of the cluster, reduces the failure recovery time, and ensures the reliability of the application.
Smart Images

Figure CN119105868A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for analyzing changes in workload of a container management cluster. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No admission is made that the description herein is prior art by inclusion in this section.
[0003] In the ecosystem of container management clusters, it is crucial to manage and monitor the health status of workloads. The automatic deployment and update functions of container management clusters automate the deployment and update process of applications, which improves the convenience of application deployment but also brings some risks:
[0004] Unforeseen failures: During the automatic update process, workload instances may experience large-scale failures due to various reasons (such as image errors, workload reconstruction caused by tuning controller defects, etc.). This may cause application interruptions or performance degradation, affecting user experience.
[0005] Rollback issues: If a problem occurs during an automated update, you may need to roll back to the previous version. However, the rollback process itself may face challenges, such as consistency of data state, handling of dependencies, and rollback of application code and configuration.
[0006] Therefore, if it is possible to analyze the changes in workload in the container management cluster and provide a risk control plan, the above risks can be addressed. Summary of the invention
[0007] An embodiment of the present invention provides a method for analyzing changes in workload of a container management cluster, which can implement changes in workload of a container management cluster and provide a risk control solution. The method includes:
[0008] Capture data on different types of workloads in container management clusters in real time;
[0009] Filtering noise data in the data of each type of workload, where the noise data is data that causes the workload version to be updated and does not require attention;
[0010] When the data of each type of workload remaining after filtering causes the workload version to be updated, the historical version of each type of workload at this time is recorded;
[0011] At a preset time, obtain the change value and corresponding weight of the historical version of each type of workload under different change types, and calculate the comprehensive change value of each type of workload according to the change value and weight, wherein the change type includes creation, modification and deletion;
[0012] Analyzing a first preset number of workloads that have changed the most in the first preset time period according to comprehensive change values of different types of workloads in the first preset time period;
[0013] The first preset number of workloads is managed according to a first risk management and control scheme, wherein the first risk management and control scheme includes an alarm and a rollback.
[0014] The embodiment of the present invention further provides a container management cluster workload change analysis device, which can implement container management cluster workload change analysis and provide a risk control solution. The device includes:
[0015] Workload data capture module, used to capture data of different types of workloads in the container management cluster in real time;
[0016] A data filtering module, used to filter noise data in the data of each type of workload, wherein the noise data is data that causes the workload version to be updated and does not need to be paid attention to;
[0017] A historical version analysis module, used for recording the historical version of each type of workload when the data of each type of workload remaining after filtering causes the workload version to be updated;
[0018] A workload change value calculation module is used to obtain the change value and corresponding weight of the historical version of each type of workload under different change types at a preset time, and calculate the comprehensive change value of each type of workload according to the change value and weight, wherein the change type includes creation, modification and deletion;
[0019] A workload change analysis module, configured to analyze a first preset number of workloads having the most changes within the first preset time period according to comprehensive change values of different types of workloads within the first preset time period;
[0020] The risk management and control module is used to manage the first preset number of workloads according to a first risk management and control scheme, wherein the first risk management and control scheme includes an alarm and a rollback.
[0021] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for analyzing workload changes in a container management cluster when executing the computer program.
[0022] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned method for analyzing workload changes in a container management cluster is implemented.
[0023] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the method for analyzing changes in workload of a container management cluster is implemented.
[0024] In an embodiment of the present invention, data of different types of workloads in a container management cluster are captured in real time; noise data in the data of each type of workload is filtered out, and the noise data is data that causes workload version updates and does not need to be paid attention to; when the data of each type of workload remaining after filtering causes workload version updates, the historical version of each type of workload at this time is recorded; at a preset time, the change value and corresponding weight of the historical version of each type of workload under different change types are obtained, and based on the change value and weight, the comprehensive change value of each type of workload is calculated, and the change type includes creation, modification and deletion; based on the comprehensive change values of different types of workloads within a first preset time period, a first preset number of workloads with the most changes within the first preset time period are analyzed; according to a first risk management and control plan, the first preset number of workloads are managed and controlled, and the first risk management and control plan includes alarms and rollbacks. In the above process, after collecting data on different types of workloads in the container management cluster, when the workload version is updated due to filtering out the noise data, the historical version of each type of workload at this time can be recorded, and the comprehensive change value of each type of workload can be calculated based on the historical version. The comprehensive change value can timely discover abnormal changes that may cause failures; then, through the first risk management plan, complete rapid fault recovery including alarms and rollbacks, thereby improving the reliability and recovery capabilities of the cluster. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0026] Figure 1 This is a flow chart of a method for analyzing changes in workload of a container management cluster according to an embodiment of the present invention;
[0027] Figure 2 A flowchart of rolling back a historical version of a workload in an embodiment of the present invention;
[0028] Figure 3 A flowchart of a historical version query of a workload in an embodiment of the present invention;
[0029] Figure 4 This is a flowchart of an alarm in an embodiment of the present invention;
[0030] Figure 5 Schematic diagram of a container management cluster workload change analysis device according to an embodiment of the present invention;
[0031] Figure 6 Schematic diagram of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION
[0032] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0033] The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0034] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0035] Figure 1 The flowchart of the method for analyzing changes in workload of a container management cluster according to an embodiment of the present invention includes:
[0036] Step 101, capturing data of different types of workloads of a container management cluster in real time;
[0037] Step 102, filtering noise data in the data of each type of workload, where the noise data is data that causes the workload version to be updated and does not need to be paid attention to;
[0038] Step 103, when the data of each type of workload remaining after filtering causes the workload version to be updated, record the historical version of each type of workload at this time;
[0039] Step 104, at a preset time, obtaining the change value and corresponding weight of the historical version of each type of workload under different change types, and calculating the comprehensive change value of each type of workload according to the change value and weight, wherein the change type includes creation, modification and deletion;
[0040] Step 105, analyzing a first preset number of workloads having the largest changes within the first preset time period according to comprehensive change values of different types of workloads within the first preset time period;
[0041] Step 106: manage the first preset number of workloads according to a first risk management and control plan, where the first risk management and control plan includes alarms and rollbacks.
[0042] In an embodiment of the present invention, after collecting data on different types of workloads in a container management cluster, when the workload version is updated due to filtering out the noise data, the historical version of each type of workload at this time can be recorded, and the comprehensive change value of each type of workload can be calculated based on the historical version. The comprehensive change value can timely discover abnormal changes that may cause failures; then, through the first risk management and control solution, rapid fault recovery including alarms and rollbacks can be completed to improve the reliability and recovery capabilities of the cluster.
[0043] Each step is described in detail below.
[0044] In step 101 , data of different types of workloads of a container management cluster are captured in real time;
[0045] In specific implementations, different container management clusters have different workloads, which can be captured through the framework, services, and functions of the container management cluster.
[0046] In one embodiment, the workload data includes at least one of metadata, status, and events;
[0047] Figure 2 This is a flowchart of rolling back the historical version of a workload in an embodiment of the present invention. Figure 2 , after capturing data in real time on different types of workloads that fill the container management cluster, it also includes:
[0048] Step 201, serializing the workload data and storing it;
[0049] Step 202, when a workload fails, determine the historical version that should be rolled back based on all the data of the workload that has been stored;
[0050] Step 203: after the user confirms the historical version to be rolled back, query the stored data of the workload corresponding to the historical version to be rolled back;
[0051] Step 204: Roll back the workload to the historical version that should be rolled back based on the data.
[0052] In step 102, noise data in the data of each type of workload is filtered, where the noise data is data that causes the workload version to be updated and does not need to be paid attention to;
[0053] In the embodiment of the present invention, the noise data includes status and some manual restart operations, etc. Although these noise data need to be filtered out, these data are needed when rolling back, so these data need to be stored.
[0054] In step 103, when the data of each type of workload remaining after filtering causes the workload version to be updated, the historical version of each type of workload at this time is recorded;
[0055] In one embodiment, after recording the historical version of each type of workload at this time, the method further includes:
[0056] According to a preset storage strategy, multiple historical versions of different types of workloads are stored. The preset storage strategy includes the maximum retention number and retention duration of historical versions of workloads of different importance levels. The importance level of the workload includes a preset first importance level and a second importance level. The first importance level is more important than the second importance level. The importance level of the workload is determined based on the frequency of change of the workload.
[0057] In the embodiment of the present invention, the workload of the first importance level of the container management cluster can be determined based on experience. The preset storage policy is, for example, that the maximum number of historical versions of the workload of the first importance level is 50, and the maximum number of historical versions of the workload of the second importance level is 10, and the retention period can be determined based on actual conditions.
[0058] In addition, the change frequency of all workloads can be counted, and more retained versions can be automatically added for workloads with high-frequency changes. The above storage strategy can avoid storing all historical versions and effectively reduce the memory burden.
[0059] In one embodiment, multiple historical versions of different types of workloads are stored, including:
[0060] If the historical versions of each type of workload do not exceed the maximum retention number, the historical version is stored; otherwise, the oldest historical version is deleted according to the first-in-first-out principle;
[0061] If the historical version of each workload exceeds the retention period, delete the historical version.
[0062] The above embodiment is an automatic cleanup logic, which deletes redundant versions based on the first-in-first-out (FIFO) principle, and can effectively reduce the memory burden.
[0063] Figure 3 This is a flowchart of the historical version query of the workload in the embodiment of the present invention, see Figure 3 In one embodiment, the method further comprises:
[0064] Step 301, add a label to each type of workload and mark the parent workload name;
[0065] Step 302, associating multiple types of workloads according to the label and the parent workload name;
[0066] Step 303: after receiving a workload version query instruction for a container service from a user, query the historical versions of all types of workloads of the container service within a preset time period;
[0067] Step 304: Feedback the retrieved historical version to the user.
[0068] The above embodiments can facilitate unified query and rollback, and facilitate workload management.
[0069] In step 104, at a preset time, the change values and corresponding weights of the historical versions of each type of workload under different change types are obtained, and the comprehensive change value of each type of workload is calculated according to the change values and weights, where the change types include creation, modification, and deletion;
[0070] In one embodiment, calculating the comprehensive change value of each type of workload according to the change value and the weight includes:
[0071] If the workload change type is new creation, the comprehensive change value of the workload is determined as:
[0072] F = N × c1;
[0073] Among them, F is the comprehensive change value; N is the change value corresponding to the new construction, and it takes the value of 1 when there is a new construction, otherwise it takes the value of 0; c1 is the weight corresponding to N;
[0074] If the workload change type is modification, the comprehensive change value of the workload is determined as:
[0075] F=r1×m1+r2×m2+r3×m3+r4×m4+r5×m5+r6×m6+m7n×m7;
[0076] Among them, r1 is the change value corresponding to the mounted volume in the container template of the workload, which takes the value of 1 when there is a change, otherwise it takes the value of 0; r2 is the change value corresponding to the affinity, topology constraint, target scheduling cluster and physical node of the workload, which takes the value of 1 when there is a change, otherwise it takes the value of 0; r3 is the change value corresponding to the startup command and environment variable in the container template of the workload, which takes the value of 1 when there is a change, otherwise it takes the value of 0; r4 is the change value corresponding to the declaration and label class of the workload, which takes the value of 1 when there is a change, otherwise it takes the value of 0; r5 is the change value corresponding to each container resource in the container template of the workload, which takes the value of 1 when there is a change, otherwise it takes the value of 0; r6 is the change value corresponding to the image in the container template of the workload, which takes the value of 1 when there is a change, otherwise it takes the value of 0; m7n is the number of difference rows of the workload other than the above changes; m1, m2, m3, m4, m5, m6, m7 are the weights corresponding to r1, r2, r3, r4, r5, r6, m7n respectively;
[0077] If the workload change type is deletion, the comprehensive change value of the workload is determined as:
[0078] F = S × d1;
[0079] Among them, S is the change value corresponding to the deletion, and it takes the value of 1 when there is a deletion, otherwise it takes the value of 0; d1 is the weight corresponding to S.
[0080] In the embodiment of the present invention, the risk of adding new workloads is relatively low, and the new data can be counted. Assume that the number of newly added workloads is cn and the weight is c1.
[0081] Changes in mounted volumes in container templates have a higher risk, and weight m1 belongs to the first tier;
[0082] Changes in affinity, topology constraints, target scheduling clusters, and physical nodes have medium risk, and the weight m2 belongs to the second level;
[0083] Changes in startup commands and environment variables in container templates have a medium risk, and the weight m3 belongs to the second level.
[0084] Changes in declarations and labels have lower risks, and the weight m4 belongs to the third tier;
[0085] Changes in container resources in the container template have a lower risk, and the weight m5 belongs to the third level;
[0086] Changes in images in container templates have a lower risk, and the weight m6 belongs to the third level.
[0087] For other changes, the risk is calculated based on the difference before and after the change. Assuming the number of difference rows is m7n and the weight is m7, the first gradient > the second gradient > the third gradient. The value of each gradient can be determined according to the actual situation.
[0088] Deleting workloads has a higher risk. You need to pay close attention to the number of deleted workloads and the cascade deletion of related workloads. Assume that the number is dn and the weight is d1.
[0089] For example, when upgrading a database deployed with a workload X, changes to mounted volumes, container resource expansion, default container security privilege escalation, and database parameter template changes may occur.
[0090] (1) Database instance label: mysql-db01
[0091] Workload name: mysql-db01
[0092] Type of workload: X
[0093] Comprehensive change value: 0.4+0.2+5×0.08=1 (mount volume changes, m1=0.4, container resource changes, m5=0.2, other template difference lines are 5, m7=0.08)
[0094] (2) Database instance label: mysql-db01
[0095] Workload name: mysql-db01-cm
[0096] Workload type: Y
[0097] Comprehensive change value: 15×0.02=0.3 (the number of different lines in the configuration file is 15, m7=0.02)
[0098] Based on these two comprehensive change values, we can conclude that the change value of the workload mysql-db01 is 1, the change value of the workload mysql-db01-cm is 0.3, and the change score of the entire database instance db01 is 1+0.3=1.3.
[0099] It should be noted that the above formula and weights are benchmark models. Through the long-term operation of a large number of container services of various types, a wide range of container service data can be collected, such as data of various types of container service groups such as JAVA applications, cloud databases, and cloud middleware. The weights in the formula are automatically adjusted using the gradient descent algorithm for each training.
[0100] Figure 4 This is a flowchart of an alarm in an embodiment of the present invention, see Figure 4 , in one embodiment, further comprising:
[0101] Step 401, when the comprehensive change value of each type of workload exceeds the corresponding threshold, generate an alarm message;
[0102] Step 402, after the warning information is generated, receiving the user's judgment result on whether the warning information is within the normal risk range;
[0103] Step 403: If the judgment result is within the normal risk range, the alarm information is determined to be a false alarm;
[0104] Step 404 , analyzing the data of false positive workloads within a set time period, and updating the weight of each type of workload in different change types.
[0105] The threshold corresponding to the comprehensive change value of each type of workload can be determined according to the actual situation. The alarm information can generate an analysis report. During specific implementation, the alarm can be issued by regularly checking and analyzing the changes in each workload on the cluster through a scheduled task.
[0106] By identifying false positives and updating the weights of each type of workload in different types of changes, the weights in the comprehensive change value calculation formula can be optimized, thereby continuously optimizing the weights and improving the accuracy of the comprehensive change value.
[0107] In step 105, a first preset number of workloads having the most changes within the first preset time period are analyzed according to the comprehensive change values of the different types of workloads within the first preset time period;
[0108] In step 106, the first preset number of workloads are managed according to a first risk management and control scheme, where the first risk management and control scheme includes an alarm and a rollback.
[0109] In one embodiment, the method further comprises:
[0110] Determine the change value of the container management cluster based on the comprehensive change value of different types of workloads;
[0111] Analyzing, according to the change values of the plurality of container management clusters within the second preset time period, a second preset number of container management clusters with the largest changes within the second preset time period;
[0112] The first preset number of container management clusters are managed and controlled according to the second risk management and control plan.
[0113] In one embodiment, the following formula is used to determine the change value of the container management cluster according to the comprehensive change values of different types of workloads:
[0114] cn×c1+mn×(r1×m1+r2×m2+r3×m3+r4×m4+r5×m5+r6×m6+m7n×m7)+dn×d1
[0115] Where cn is the number of newly created workloads, dn is the number of deleted workloads, and mn is the number of modified workloads.
[0116] The embodiment of the present invention further proposes a device for analyzing changes in workload of a container management cluster, the principle of which is similar to the method for analyzing changes in workload of a container management cluster, and will not be described in detail here.
[0117] Figure 5 Schematic diagram of a container management cluster workload change analysis device according to an embodiment of the present invention, comprising:
[0118] A workload data capture module 501 is used to capture data of different types of workloads of a container management cluster in real time;
[0119] A data filtering module 502 is used to filter noise data in the data of each type of workload, where the noise data is data that causes the workload version to be updated and does not need to be paid attention to;
[0120] A historical version analysis module 503, configured to record the historical version of each type of workload when the data of each type of workload remaining after filtering causes the workload version to be updated;
[0121] The workload change value calculation module 504 is used to obtain the change value and corresponding weight of the historical version of each type of workload under different change types at a preset time, and calculate the comprehensive change value of each type of workload according to the change value and weight, wherein the change type includes creation, modification and deletion;
[0122] The workload change analysis module 505 is used to analyze a first preset number of workloads having the most changes within the first preset time period according to comprehensive change values of different types of workloads within the first preset time period;
[0123] The risk management module 506 is used to manage the first preset number of workloads according to a first risk management scheme, where the first risk management scheme includes alarm and rollback.
[0124] In one embodiment, the workload data includes at least one of metadata, status, and events;
[0125] The workload data capture module is also used to:
[0126] After capturing data of different types of workloads that fill the container management cluster in real time, the workload data is serialized and stored;
[0127] When a workload fails, determine the historical version that should be rolled back based on all the data of the workload that has been stored;
[0128] After the user confirms the historical version to be rolled back, query the stored data of the workload corresponding to the historical version to be rolled back;
[0129] Based on the data, the workload is rolled back to the historical version that should be rolled back.
[0130] In one embodiment, the historical version analysis module is further used to:
[0131] After recording the historical versions of each type of workload at this time, multiple historical versions of different types of workloads are stored according to a preset storage strategy. The preset storage strategy includes the maximum retention number and retention duration of historical versions of workloads of different importance levels. The importance levels of the workloads include a preset first importance level and a second importance level. The first importance level is more important than the second importance level. The importance level of the workload is determined based on the frequency of change of the workload.
[0132] In one embodiment, the historical version analysis module is further used to:
[0133] If the historical versions of each type of workload do not exceed the maximum retention number, the historical version is stored; otherwise, the oldest historical version is deleted according to the first-in-first-out principle;
[0134] If the historical version of each workload exceeds the retention period, delete the historical version.
[0135] In one embodiment, the apparatus further includes a workload association module 507, configured to:
[0136] Add labels to each type of workload and mark the parent workload name;
[0137] Associating multiple types of workloads according to the labels and parent workload names;
[0138] After receiving a workload version query instruction from a user for a container service, query the historical versions of all types of workloads of the container service within a preset time period;
[0139] Feedback the queried historical versions to the user.
[0140] In one embodiment, the workload change value calculation module is used to:
[0141] If the workload change type is new creation, the comprehensive change value of the workload is determined as:
[0142] F = N × c1;
[0143] Among them, F is the comprehensive change value; N is the change value corresponding to the new construction, and it takes the value of 1 when there is a new construction, otherwise it takes the value of 0; c1 is the weight corresponding to N;
[0144] If the workload change type is modification, the comprehensive change value of the workload is determined as:
[0145] F=r1×m1+r2×m2+r3×m3+r4×m4+r5×m5+r6×m6+m7n×m7;
[0146] Among them, r1 is the change value corresponding to the mounted volume in the container template of the workload, which takes the value of 1 when there is a change, otherwise it takes the value of 0; r2 is the change value corresponding to the affinity, topology constraint, target scheduling cluster and physical node of the workload, which takes the value of 1 when there is a change, otherwise it takes the value of 0; r3 is the change value corresponding to the startup command and environment variable in the container template of the workload, which takes the value of 1 when there is a change, otherwise it takes the value of 0; r4 is the change value corresponding to the declaration and label class of the workload, which takes the value of 1 when there is a change, otherwise it takes the value of 0; r5 is the change value corresponding to each container resource in the container template of the workload, which takes the value of 1 when there is a change, otherwise it takes the value of 0; r6 is the change value corresponding to the image in the container template of the workload, which takes the value of 1 when there is a change, otherwise it takes the value of 0; m7n is the number of difference rows of the workload other than the above changes; m1, m2, m3, m4, m5, m6, m7 are the weights corresponding to r1, r2, r3, r4, r5, r6, m7n respectively;
[0147] If the workload change type is deletion, the comprehensive change value of the workload is determined as:
[0148] F = S × d1;
[0149] Among them, S is the change value corresponding to the deletion, and it takes the value of 1 when there is a deletion, otherwise it takes the value of 0; d1 is the weight corresponding to S.
[0150] In one embodiment, the device further comprises:
[0151] The cluster change analysis module 508 is used to determine the change value of the container management cluster according to the comprehensive change value of different types of workloads;
[0152] Analyzing, according to the change values of the plurality of container management clusters within the second preset time period, a second preset number of container management clusters with the largest changes within the second preset time period;
[0153] The risk management module is further used to: manage the first preset number of container management clusters according to a second risk management solution.
[0154] In one embodiment, the cluster change analysis module is used to:
[0155] The following formula is used to determine the change value of the container management cluster based on the comprehensive change value of different types of workloads:
[0156] cn×c1+mn×(r1×m1+r2×m2+r3×m3+r4×m4+r5×m5+r6×m6+m7n×m7)+dn×d1
[0157] Where cn is the number of newly created workloads, dn is the number of deleted workloads, and mn is the number of modified workloads.
[0158] In one embodiment, the apparatus further includes an alarm module 509, configured to:
[0159] When the comprehensive change value of each type of workload exceeds the corresponding threshold, an alarm message is generated;
[0160] After generating the warning information, receiving the user's judgment result on whether the warning information is within the normal risk range;
[0161] If the judgment result is within the normal risk range, the alarm information is determined to be a false alarm;
[0162] Analyze the data of false positive workloads within a set period of time, and update the weight of each type of workload in different change types.
[0163] In the above embodiment, when the comprehensive change value of each type of workload exceeds the corresponding threshold, generating alarm information can serve as a configured alarm rule.
[0164] In summary, the method and device proposed in the embodiments of the present invention have the following beneficial effects:
[0165] 1. Real-time monitoring of workload changes:
[0166] (1) By collecting real-time data of each workload in the container management cluster, their changes before and after historical version updates can be observed in real time.
[0167] (2) Use data analysis to calculate the comprehensive change value of each type of workload and promptly detect abnormal changes that may cause failures.
[0168] (3) Prevent large-scale failures in advance and ensure the stable operation of the cluster.
[0169] 2. Intelligent alarm mechanism:
[0170] (1) Configure alarm rules to automatically detect status changes of each workload.
[0171] (2) Once a fault is detected, an alarm can be triggered immediately, and the fault can be responded to and handled quickly.
[0172] (3) Analyze alarms through machine learning technology to improve the accuracy and operability of alarms.
[0173] 3. Rapid fault recovery to improve cluster reliability and recovery capabilities
[0174] (1) By continuously recording the historical data of each workload, the system can be quickly restored to normal status when a failure occurs.
[0175] (2) Use data analysis to identify the root cause of the failure, select the appropriate recovery version, and minimize service interruption time.
[0176] In general, this solution provides a good solution for the intelligent operation and maintenance of container management clusters. Through real-time monitoring, intelligent alarms and rapid recovery, the stability and availability of the cluster can be greatly improved, providing more reliable support for the business.
[0177] An embodiment of the present invention further provides a computer device, Figure 6 This is a schematic diagram of a computer device in an embodiment of the present invention. The computer device 600 includes a memory 610, a processor 620, and a computer program 630 stored in the memory 610 and executable on the processor 620. When the processor 620 executes the computer program 630, the above-mentioned container management cluster workload change analysis method is implemented.
[0178] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned method for analyzing workload changes in a container management cluster is implemented.
[0179] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the above-mentioned method for analyzing workload changes in a container management cluster is implemented.
[0180] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0181] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0182] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0183] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0184] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for analyzing changes in workload of a container management cluster, characterized in that: include: Capture data on different types of workloads in container management clusters in real time; Filtering noise data in the data of each type of workload, where the noise data is data that causes the workload version to be updated and does not require attention; When the data of each type of workload remaining after filtering causes the workload version to be updated, the historical version of each type of workload at this time is recorded; At a preset time, obtain the change value and corresponding weight of the historical version of each type of workload under different change types, and calculate the comprehensive change value of each type of workload according to the change value and weight, wherein the change type includes creation, modification and deletion; Analyzing a first preset number of workloads that have changed the most in the first preset time period according to comprehensive change values of different types of workloads in the first preset time period; The first preset number of workloads is managed according to a first risk management and control scheme, wherein the first risk management and control scheme includes an alarm and a rollback.
2. The method according to claim 1, characterized in that The workload data includes at least one of metadata, status, and events; After capturing data on different types of workloads filling the container management cluster in real time, it also includes: Serialize the workload data for storage; When a workload fails, determine the historical version that should be rolled back based on all the data of the workload that has been stored; After the user confirms the historical version to be rolled back, query the stored data of the workload corresponding to the historical version to be rolled back; Based on the data, the workload is rolled back to the historical version that should be rolled back.
3. The method according to claim 1, characterized in that After recording the historical versions of each type of workload at this time, it also includes: According to a preset storage strategy, multiple historical versions of different types of workloads are stored. The preset storage strategy includes the maximum retention number and retention duration of historical versions of workloads of different importance levels. The importance level of the workload includes a preset first importance level and a second importance level. The first importance level is more important than the second importance level. The importance level of the workload is determined based on the frequency of change of the workload.
4. The method according to claim 3, characterized in that Store multiple historical versions of different types of workloads, including: If the historical versions of each type of workload do not exceed the maximum retention number, the historical version is stored; otherwise, the oldest historical version is deleted according to the first-in-first-out principle; If the historical version of each workload exceeds the retention period, delete the historical version.
5. The method according to claim 1, characterized in that Also includes: Add labels to each type of workload and mark the parent workload name; Associating multiple types of workloads according to the labels and parent workload names; After receiving a workload version query instruction from a user for a container service, query the historical versions of all types of workloads of the container service within a preset time period; Feedback the queried historical versions to the user.
6. The method according to claim 1, characterized in that According to the change value and the weight, a comprehensive change value of each type of workload is calculated, including: If the workload change type is new creation, the comprehensive change value of the workload is determined as: F = N × c1; Among them, F is the comprehensive change value; N is the change value corresponding to the new construction, and it takes the value of 1 when there is a new construction, otherwise it takes the value of 0; c1 is the weight corresponding to N; If the workload change type is modification, the comprehensive change value of the workload is determined as: F=r1×m1+r2×m2+r3×m3+r4×m4+r5×m5+r6×m6+m7n×m7; Among them, r1 is the change value corresponding to the mounted volume in the container template of the workload, which takes the value of 1 when there is a change, otherwise it takes the value of 0; r2 is the change value corresponding to the affinity, topology constraint, target scheduling cluster and physical node of the workload, which takes the value of 1 when there is a change, otherwise it takes the value of 0; r3 is the change value corresponding to the startup command and environment variable in the container template of the workload, which takes the value of 1 when there is a change, otherwise it takes the value of 0; r4 is the change value corresponding to the declaration and label class of the workload, which takes the value of 1 when there is a change, otherwise it takes the value of 0; r5 is the change value corresponding to each container resource in the container template of the workload, which takes the value of 1 when there is a change, otherwise it takes the value of 0; r6 is the change value corresponding to the image in the container template of the workload, which takes the value of 1 when there is a change, otherwise it takes the value of 0; m7n is the number of difference rows of the workload other than the above changes; m1, m2, m3, m4, m5, m6, m7 are the weights corresponding to r1, r2, r3, r4, r5, r6, m7n respectively; If the workload change type is deletion, the comprehensive change value of the workload is determined as: F = S × d1; Among them, S is the change value corresponding to the deletion, and it takes the value of 1 when there is a deletion, otherwise it takes the value of 0; d1 is the weight corresponding to S.
7. The method according to claim 1, characterized in that Also includes: Determine the change value of the container management cluster based on the comprehensive change value of different types of workloads; Analyzing, according to the change values of the plurality of container management clusters within the second preset time period, a second preset number of container management clusters with the largest changes within the second preset time period; The first preset number of container management clusters are managed and controlled according to the second risk management and control plan.
8. The method according to claim 6, characterized in that The following formula is used to determine the change value of the container management cluster based on the comprehensive change value of different types of workloads: cn×c1+mn×(r1×m1+r2×m2+r3×m3+r4×m4+r5×m5+r6×m6+m7n×m7)+dn×d1 Where cn is the number of newly created workloads, dn is the number of deleted workloads, and mn is the number of modified workloads.
9. The method according to claim 1, characterized in that Also includes: When the comprehensive change value of each type of workload exceeds the corresponding threshold, an alarm message is generated; After generating the warning information, receiving the user's judgment result on whether the warning information is within the normal risk range; If the judgment result is within the normal risk range, the alarm information is determined to be a false alarm; Analyze the data of false positive workloads within a set period of time, and update the weight of each type of workload in different change types.
10. A container management cluster workload change analysis device, characterized in that: include: Workload data capture module, used to capture data of different types of workloads in the container management cluster in real time; A data filtering module, used to filter noise data in the data of each type of workload, wherein the noise data is data that causes the workload version to be updated and does not need to be paid attention to; A historical version analysis module, used for recording the historical version of each type of workload when the data of each type of workload remaining after filtering causes the workload version to be updated; A workload change value calculation module is used to obtain the change value and corresponding weight of the historical version of each type of workload under different change types at a preset time, and calculate the comprehensive change value of each type of workload according to the change value and weight, wherein the change type includes creation, modification and deletion; A workload change analysis module, configured to analyze a first preset number of workloads having the most changes within the first preset time period according to comprehensive change values of different types of workloads within the first preset time period; The risk management and control module is used to manage the first preset number of workloads according to a first risk management and control scheme, wherein the first risk management and control scheme includes an alarm and a rollback.
11. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 9 is implemented.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
13. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
