Baseline inspection method and system for cloud native infrastructure
By performing baseline monitoring in the cloud native infrastructure in units of inspection domains, the problem of manual inspection dependency and change historical status unrecorded is solved, the baseline configuration is decoupled from the cluster, reducing monitoring calculations, and improving operation and maintenance Efficiency improves the stability of infrastructure.
Patent Information
- Application Number
- CN202411293570.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2025-01-07
AI Technical Summary
In the prior art, the baseline inspection of cloud native infrastructure relies on manual inspections one by one, which consumes a lot of manpower and energy, and the historical status of infrastructure changes has not been recorded, resulting in difficulty in troubleshooting, especially in the number of baselines and historical changes. When managing and using baseline information becomes more difficult.
Using a baseline inspection method for cloud native infrastructure, by obtaining the configuration information of the baseline, creating inspection domains, and checking the deployment and operation of the baseline according to the inspection domain and detection methods, generating inspection data and reports to realize baseline configuration and Decoupling of the cluster reduces monitoring and improves efficiency.
By monitoring in units of inspection domains, the baseline configuration and cluster deployment operation are decoupled. The inspection domain can be reused, reduce monitoring and computing, improve operation and maintenance efficiency, facilitate expansion, reduce manual operations, improve data accuracy and timeliness improves the operation efficiency and stability of infrastructure.
Smart Images

Figure CN119276743A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic digital data processing, and in particular to a baseline inspection method and system for cloud native infrastructure. Background Art
[0002] Cloud-native infrastructure is a new type of infrastructure that aims to fully utilize the advantages of cloud computing, improve resource utilization efficiency, enhance system elasticity, and optimize development and operation processes. Cloud-native infrastructure supports the development and deployment of modern applications through automation, scalability, and flexibility, and has become an important development direction in the current information technology field. Traditional infrastructure management methods usually rely on manual configuration and static resource allocation, which is difficult to cope with dynamically changing workloads and rapidly iterative development processes.
[0003] The cloud-native infrastructure baseline refers to the operational configuration standard of the infrastructure at a specific point in time. It is an important tool and basis for evaluating, monitoring, and managing infrastructure changes. The baseline can help identify and resolve potential problems and ensure the stability and consistency of the infrastructure.
[0004] Currently, the management of baselines mainly relies on manually checking the basic design baselines item by item, which is a method that consumes a lot of manpower and wastes energy. In actual operations, when errors occur in the infrastructure, the on-site personnel responsible for troubleshooting often lack understanding of the infrastructure or do not know the specific design of the baseline, which requires them to communicate with the infrastructure developers, a process that further increases the waste of manpower and energy.
[0005] Due to the reliance on manual inspection of baseline operations, the historical status of infrastructure changes is often not recorded, and this missing status information is the key to troubleshooting. As the number of infrastructures continues to increase, the number of baselines and historical changes increase dramatically, making it more difficult to manage and quickly use this baseline information. Summary of the invention
[0006] In view of the above-mentioned technical problems existing in the prior art, the present invention provides a baseline inspection method and system for cloud native infrastructure, which reduces the amount of data for baseline inspection and improves the efficiency of baseline inspection.
[0007] The present invention discloses a baseline inspection method for a cloud native infrastructure, comprising the following steps: obtaining a baseline of a cloud native infrastructure, wherein configuration information of the baseline includes at least one configuration item; obtaining an inspection domain adapted to the baseline according to the configuration information of the baseline, wherein the inspection domain includes at least one baseline configuration item; obtaining a detection method for the inspection domain; and inspecting the deployment and operation of the baseline according to the inspection domain and the detection method to obtain inspection data.
[0008] Preferably, the method for checking domain management includes:
[0009] Monitor events for user-submitted baselines;
[0010] Matching the baseline to an existing inspection domain to obtain a first inspection domain;
[0011] Determine whether there is any unmatched configuration item in the baseline;
[0012] If not, obtaining the first inspection data through the matched first inspection domain;
[0013] If so, the unmatched inspection items are divided to create a second inspection domain;
[0014] According to the second examination domain, second examination data is obtained.
[0015] Preferably, an inspection report is created based on the first inspection data and the second inspection data;
[0016] Determining whether the first inspection domain is used;
[0017] If not used, delete the first check domain.
[0018] Preferably, the method for obtaining inspection data comprises:
[0019] Monitoring nodes according to the baseline configuration items of the inspection domain to obtain node change information;
[0020] According to the baseline configuration items of the inspection domain, the cluster is monitored to obtain cluster change information;
[0021] Inspection data is obtained according to the node change information and the cluster change information.
[0022] Preferably, the inspection data includes physical machine information and cluster information;
[0023] Monitor file changes on physical machines based on the if not if tool and generate physical machine information;
[0024] Based on the recoc ile function in the Controller, cluster information is obtained.
[0025] Preferably, the method for generating an inspection report includes:
[0026] receiving a report request from a user, wherein the report request includes configuration information of the baseline;
[0027] Obtain difference information based on the configuration information of the baseline and its corresponding inspection data;
[0028] Generate a comparison report based on the difference information;
[0029] The comparison report is pushed to the user.
[0030] Preferably, the method for generating a comparison report includes:
[0031] Get the original report;
[0032] Filtering the inspection data to obtain report data related to the inspection domain;
[0033] generating a first report based on the report data and the original report;
[0034] Traversing the inspection items of the report data;
[0035] Generate a summary using a preset inspection algorithm and inspection items, wherein the summary includes difference information;
[0036] The summary is inserted into the first report to obtain a comparative report.
[0037] The present invention also provides a system for implementing the above-mentioned baseline inspection method, including an inspection domain management module and a monitoring module.
[0038] The inspection domain management module is used to obtain an inspection domain adapted to the baseline according to the baseline configuration information of the cloud native infrastructure, and obtain a detection method for the inspection domain;
[0039] The monitoring module is used to check the deployment and operation of the baseline according to the inspection domain and the detection method to obtain inspection data.
[0040] Preferably, the system further comprises a reporting module, and the reporting module is used to create an inspection report based on the inspection data.
[0041] Preferably, the monitoring module includes a node detection submodule, a cluster monitoring submodule and a management submodule. The node detection submodule is used to monitor the node according to the detection method and obtain node change information; the cluster monitoring submodule is used to monitor the cluster according to the detection method and obtain cluster change information; the management submodule is used to generate inspection data according to the node change information and the cluster change information, and save the inspection data in a database.
[0042] Compared with the prior art, the beneficial effects of the present invention are: monitoring of cloud native infrastructure is performed in units of inspection domains, and baseline configuration is decoupled from the deployment and operation of the baseline in the cluster; inspection domains can be reused; when the baseline configuration matches the inspection domain, the inspection domain can be reused, reducing the amount of monitoring calculations, improving monitoring efficiency, and facilitating operation and maintenance and expansion. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 is a flow chart of a baseline checking method for cloud native infrastructure of the present invention;
[0044] Figure 2 It is a flow chart of the method of checking domain management;
[0045] Figure 3 It is a system logic block diagram of the present invention. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] The present invention is further described in detail below in conjunction with the accompanying drawings:
[0048] A first aspect of the present invention provides a baseline inspection method for a cloud native infrastructure, such as Figure 1 As shown, the following steps are included:
[0049] Step 101: Obtain a baseline of a cloud native infrastructure, where configuration information of the baseline includes at least one configuration item.
[0050] Step 102: According to the configuration information of the baseline, obtain an inspection domain that is compatible with the baseline, wherein the inspection domain includes at least one baseline configuration item.
[0051] Step 103: Obtain the detection method of the inspection domain.
[0052] Step 104: According to the inspection domain and the detection method, the deployment and operation of the baseline are inspected to obtain inspection data.
[0053] Step 105: Generate an inspection report based on the inspection data.
[0054] By monitoring cloud native infrastructure in units of inspection domains, baseline configuration is decoupled from the deployment and operation of the baseline in the cluster; inspection domains can be reused; when the baseline configuration matches the inspection domain, the inspection domain can be reused, reducing the amount of monitoring calculations, improving monitoring efficiency, and facilitating operation and maintenance and expansion. Through the monitoring results, the difference between the basic design operation status and the baseline status can be quickly obtained, which is conducive to timely adjustment and optimization.
[0055] For example, the specific baseline configuration is: monitor image a, kernel parameter b, file content c. Then the split / existing inspection domains are: first inspection domain: monitor image a; second inspection domain: kernel parameter b; third inspection domain: monitor image a, file content c; fourth inspection domain: monitor image a, kernel parameter bn. Then, the baseline configuration can be designed as: the third inspection domain and the second inspection domain, that is, the inspection domain is multiplexed. If the monitoring mode or monitor of the second inspection domain and the third inspection domain has been set, it will be necessary to match the baseline configuration with the existing inspection domain, so that the inspection of the baseline configuration can be quickly realized.
[0056] In the inspection domain management, you can divide and create inspection domains according to the baseline, or delete the saved inspection domains according to the frequency of use of the inspection domains, for example, delete the inspection domains that are not used. However, in long-term operation, the inspection domains of the baseline can be matched in the saved inspection domains. When the inspection domains cannot be completely matched, such as Figure 2 , methods to check domain management include:
[0057] Step 201: Monitor events of user-submitted baselines.
[0058] Step 202: Match the baseline with an existing inspection domain to obtain a first inspection domain.
[0059] Step 203: Determine whether the baseline completely matches the first check domain, that is, determine whether there are any unmatched configuration items in the baseline.
[0060] If not, execute step 204: obtain first inspection data through the matched first inspection domain.
[0061] The first check domain is a used check domain. When the system is operating normally, the first check domain has been used or executed. At this time, the corresponding change information, ie, the first check data, can be directly queried in the database.
[0062] If yes, execute step 205: divide the unmatched inspection items to obtain a second inspection domain.
[0063] Step 206: Obtain second inspection data according to the second inspection domain.
[0064] The second inspection domain is a newly created inspection domain. At this time, a corresponding inspection method can be established according to the second inspection domain, and corresponding second inspection data can be collected in the node and cluster according to the inspection method. That is, for the first inspection domain that already exists or is in use, the corresponding monitoring process has been corresponded, so the creation of the first inspection domain is skipped, and only a new second inspection domain is created, and a monitoring process is created, and the second inspection data is collected through the monitoring process.
[0065] Step 207: Based on the user's request, create an inspection report according to the first inspection data and / or the second inspection data.
[0066] During normal operation, when the baseline matches an existing inspection domain, that is, the first inspection domain, the inspection data related to the inspection domain has been inspected and saved in advance, so it can be directly read from the database at this time; for matching part of the first inspection domain and creating a second inspection domain, it is necessary to merge the newly collected second inspection data with the first inspection data as the final inspection data. The inspection report reflects the inspection data of each item and the difference between the inspection data and the baseline. The pre-saved inspection data can be extracted from the data and an inspection report can be generated.
[0067] Step 208: Determine whether the first check domain or the second check domain is used.
[0068] If it is not used, execute step 209: delete the first check domain or the second check domain.
[0069] If used, the first check domain is retained.
[0070] In step 104, the inspection data includes node change information and cluster change information, the node change information includes physical machine information, and the cluster change information includes cluster information. The method for obtaining the inspection data includes:
[0071] Step 401: Monitor the nodes according to the baseline configuration items of the inspection domain to obtain node change information. File changes of the physical machine can be monitored based on the ifi tool, and physical machine information can be generated; when the file content changes, the file content and its change information can be read.
[0072] Step 402: According to the baseline configuration items of the inspection domain, the cluster is monitored to obtain cluster change information. Based on the reconcile function in the controller, the cluster change information is obtained, that is, the CRD of the corresponding resource is monitored.
[0073] Step 403: Obtain inspection data according to the node change information and cluster change information.
[0074] In step 105, the method for generating an inspection report includes:
[0075] Step 501: Receive a report request from a user, where the report request includes configuration information of a baseline.
[0076] Step 502: Obtain difference information according to the configuration information of the baseline and its corresponding inspection data.
[0077] Step 503: Generate a comparison report based on the difference information.
[0078] Step 504: Push the comparison report to the user.
[0079] In a more specific embodiment, the method for generating a comparison report includes:
[0080] Step 511: Obtain an original report, wherein the original report may adopt a report template.
[0081] Step 512: Filter the report data related to the inspection domain from the inspection data.
[0082] Step 513: Generate a first report based on the report data and the original report.
[0083] Step 514: Traverse the inspection items of the report data.
[0084] Step 515: Generate a summary using a preset inspection algorithm and inspection items, wherein the summary includes difference information.
[0085] Step 516: Insert the summary into the first report to obtain a comparison report.
[0086] A second aspect of the present invention provides a system for implementing the above-mentioned baseline inspection method, such as Figure 3 As shown, it includes an inspection domain management module 1 and a monitoring module 2.
[0087] The inspection domain management module 1 is used to obtain an inspection domain adapted to the baseline according to the baseline configuration information of the cloud native infrastructure, and obtain a detection method of the inspection domain;
[0088] The monitoring module 2 is used to check the deployment and operation of the baseline according to the inspection domain and the detection method to obtain inspection data.
[0089] The system further comprises a reporting module 3, and the reporting module 3 is used to create an inspection report according to the inspection data.
[0090] The monitoring module 2 includes a node detection submodule 21, a cluster monitoring submodule 22 and a management submodule 23. The node detection submodule 21 is used to monitor the node according to the detection method and obtain node change information; the cluster monitoring submodule 22 is used to monitor the cluster according to the detection method and obtain cluster change information; the management submodule 23 is used to generate inspection data according to the node change information and the cluster change information, and save the inspection data into a database.
[0091] In a specific embodiment, the node detection submodule 21 is deployed as NodeDaemon, which is responsible for monitoring node changes and sending change information to the management submodule 23; after NodeDaemon is started, it receives change instructions for monitoring content, and the monitoring content is defined by the detection method of the inspection domain. NodeDaemon is deployed using DaemonSet to ensure that an instance runs on each node. Other modules can be deployed using Dep l oyment, and the number of instances can be expanded and reduced as needed.
[0092] The management submodule is deployed as a GetterFactory, which is used to receive node and cluster change information and store it locally. It is also used to receive and store check domain information, as well as to create and delete cluster management submodules.
[0093] The cluster monitoring submodule 22 is deployed as a Getter to monitor changes in the Kubernetes cluster.
[0094] The inspection domain management module 1 is deployed as Butcher, which is used to divide the inspection domain according to the baseline information, and to create and delete the inspection domain to ensure that the inspection domain is consistent with the baseline.
[0095] The storage module is deployed as DomainInfo, and a time series database is set up to record and check domain change information.
[0096] The storage module can also set up a baseline storage database Base line, which is used to store etcd baseline information.
[0097] Report module 3 is deployed as Checker to generate reports. It can compare the difference between the baseline and the running status; and obtain the required information from the database to generate a detailed comparison report.
[0098] The system of the present invention may also be provided with a report triggering module 5 for parsing user commands, triggering the report module 3 according to the user commands, and returning the comparison report to the user.
[0099] Example 1
[0100] After receiving the request submitted by the user to add or delete baseline information, the baseline information is stored in the etcd database. Butcher monitors baseline change events, divides new inspection domains or deletes useless inspection domains. The monitoring module creates or deletes the corresponding node detection submodule 21 and cluster monitoring submodule 22 according to the changes in the inspection domain. The node detection submodule 21 and the cluster monitoring submodule 22 are used to monitor node changes and cluster changes respectively.
[0101] After the user requests a report through the report trigger module 5, the user request is parsed and a report is generated through the report module. The report module obtains the baseline and domain information within the specified time period from the database, compares the baseline and the check domain information, and generates a detailed comparison report. The comparison report is returned to the user through the report trigger module.
[0102] Example 2
[0103] Hy Company has deployed the e component in a cluster environment. The e component requires several baselines. Now Hy Company needs to monitor the cluster environment and host machine of the component to ensure the normal operation of the component.
[0104] Step 601: Create monitoring. Write the YAML description file of the component base line required by the system. Deploy the base line to the cluster and wait for the webhook to detect the legitimacy of the base line. Parse and transform the base line, obtain the inspection domain and its monitoring target, and then continue to monitor the target. When the target status is updated, save the new target status to the database.
[0105] Step 602: Get report. The user uses the interface or the matching report trigger module to initiate a request to get the report. The system reads the target status in the database and generates a comparison report. The comparison report is pushed to the user and displayed on the front end.
[0106] The present invention can automatically monitor the operating status of infrastructure. When an anomaly is detected, the system can save the current status and parse the baseline to generate a report when necessary, thereby solving the defects in the prior art. It can collect operating status data in real time, automatically analyze and generate detailed reports, thereby reducing the workload of manual operations, improving the accuracy and timeliness of data, and ultimately improving the operating efficiency and stability of infrastructure.
[0107] The inspection domain (referred to as domain for short) of the present invention is a unit of component operation and circulation. It is split into various domains immediately after receiving the user's baseline, and then different monitors are generated on the corresponding resource carriers for different domains to obtain information. The domain can decouple the baseline document and the system. When there is new content that needs to be monitored, you only need to add this domain and the corresponding inspection / monitoring method of this domain to the data structure to monitor this domain, which is beneficial for later maintenance and expansion. The domain can avoid redundant monitoring behavior. If the baseline is monitored directly, repeated monitoring will occur if there is the same monitoring content. If the domain solution is adopted, the same monitoring content will only be monitored once, which is beneficial to improve the reusability of monitoring data and improve detection performance.
[0108] The present invention has the following advantages: high degree of automation, reducing manual operations and errors, improving the accuracy and timeliness of monitoring data, reducing the complexity of development and maintenance, and improving the operating efficiency and stability of infrastructure.
[0109] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A baseline inspection method for cloud native infrastructure, characterized in that: The following steps are involved: Obtaining a baseline of a cloud native infrastructure, wherein configuration information of the baseline includes at least one configuration item; According to the configuration information of the baseline, obtaining an inspection domain adapted to the baseline, the inspection domain including at least one baseline configuration item; Obtaining a detection method for the inspection domain; According to the inspection domain and the inspection method, the deployment and operation of the baseline are inspected to obtain inspection data.
2. The baseline inspection method according to claim 1, characterized in that: Also includes methods to check domain management: Monitor events for user-submitted baselines; Matching the baseline to an existing inspection domain to obtain a first inspection domain; Determine whether there is any unmatched configuration item in the baseline; If not, obtaining the first inspection data through the matched first inspection domain; If so, the unmatched inspection items are divided to create a second inspection domain; According to the second examination domain, second examination data is obtained.
3. The baseline inspection method according to claim 2, characterized in that: Creating an inspection report based on the first inspection data and / or the second inspection data; Determining whether the first inspection domain is used; If not used, delete the first check domain.
4. The baseline inspection method according to claim 2, characterized in that: Methods for obtaining inspection data include: Monitoring nodes according to the baseline configuration items of the inspection domain to obtain node change information; According to the baseline configuration items of the inspection domain, the cluster is monitored to obtain cluster change information; Inspection data is obtained according to the node change information and the cluster change information.
5. The baseline inspection method according to claim 4, characterized in that: The inspection data includes physical machine information and cluster information; Monitor file changes on physical machines based on the inotify tool and generate physical machine information; Based on the reconcile function in the Controller, cluster information is obtained.
6. The baseline inspection method according to claim 1, characterized in that: Methods for generating inspection reports include: receiving a report request from a user, wherein the report request includes configuration information of the baseline; Obtain difference information based on the configuration information of the baseline and its corresponding inspection data; Generate a comparison report based on the difference information; The comparison report is pushed to the user.
7. The baseline checking method according to claim 6, characterized in that: Methods for generating comparison reports include: Get the original report; Filtering the inspection data to obtain report data related to the inspection domain; generating a first report based on the report data and the original report; Traversing the inspection items of the report data, and generating a summary through a preset inspection algorithm and inspection items, wherein the summary includes difference information; The summary is inserted into the first report to obtain a comparative report.
8. A system, characterized in that: For implementing the baseline inspection method according to any one of claims 1 to 7, the system comprises an inspection domain management module and a monitoring module, The inspection domain management module is used to obtain an inspection domain adapted to the baseline according to the baseline configuration information of the cloud native infrastructure, and obtain a detection method for the inspection domain; The monitoring module is used to check the deployment and operation of the baseline according to the inspection domain and the detection method to obtain inspection data.
9. The system according to claim 8, characterized in that It also includes a reporting module, which is used to create an inspection report based on the inspection data.
10. The system according to claim 9, characterized in that The monitoring module includes a node detection submodule, a cluster monitoring submodule, and a management submodule. The node detection submodule is used to monitor the node according to the detection method and obtain node change information; The cluster monitoring submodule is used to monitor the cluster according to the detection method to obtain cluster change information; The management submodule is used to generate inspection data according to the node change information and the cluster change information, and save the inspection data into a database.