Method and device for checking container cluster resource objects, and storage medium
Submitting inspection requests through a Web form and performing filtering and health checks on container cluster resource objects solves the problems of inconvenient operations and incomplete inspection items in the existing technology, and enables comprehensive inspection and efficient repair of container cluster resource objects.
Patent Information
- Application Number
- CN202010884266.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-28
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2040-08-28
AI Technical Summary
The existing container cluster resource object inspection method is inconvenient to operate and has incomplete inspection items, making it impossible to achieve a simple and effective comprehensive inspection.
Submit inspection requests through a web form, filter and health-check container cluster resource objects based on recorded inspection items, and display inspection results in charts or tables. Custom inspection frequency and cycle are supported, allowing reception and processing within the interface. Fix request.
It implements a comprehensive inspection of container cluster resource objects, making the operation simple and convenient, making the inspection results intuitive and readable, and improving the efficiency of repairing health check problems.
Smart Images

Figure CN112162816B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of container clusters, and in particular to a method and device for checking resource objects of a container cluster, and a computer-readable storage medium. Background Art
[0002] The existing technology mostly uses command lines to perform health checks on resource objects of container clusters. This check method requires the pre-installation of software packages and the selection of health check items through command line parameters. All checks require command lines, which is not convenient to operate. In addition, the check items are not fully covered.
[0003] Therefore, the existing resource object inspection method of the container cluster has the problem of not being able to simply and effectively perform a comprehensive inspection of the resource objects. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a method and device for checking container cluster resource objects, and a computer-readable storage medium, so as to solve the problem that the existing methods cannot implement comprehensive checking of container cluster resource objects in a simple and effective manner.
[0005] In order to solve the above technical problems, this specification is implemented as follows:
[0006] In a first aspect, a method for inspecting resource objects of a container cluster is provided, comprising: receiving a request for inspecting resource objects of a container cluster, the request being submitted in the form of a Web form; obtaining the resource objects of the container cluster based on the request; filtering the resource objects of the container cluster according to inspection items recorded in the Web form to determine resource objects to be inspected; and inspecting the resource objects to be inspected.
[0007] Optionally, the inspection items recorded in the Web form include at least one of an inspection item, a namespace, an inspection level, and a resource annotation.
[0008] Optionally, filtering the resource object includes at least one of the following:
[0009] When the inspection items recorded in the Web form include inspection items, filtering out the resource objects to be inspected corresponding to the inspection items from the resource objects according to the inspection items recorded in the form; or
[0010] When the check item of the Web form record includes a namespace, filtering out the resource objects to be checked corresponding to the namespaces that do not need to be checked in the resource objects according to the namespace; or
[0011] When the inspection items recorded in the Web form include inspection levels, filtering out resource objects to be inspected corresponding to the inspection level from the resource objects according to the inspection level; or
[0012] When the check items recorded in the Web form include resource annotations, the resource objects to be checked corresponding to the resource annotations are filtered out from the resource objects according to the resource annotations.
[0013] Optionally, the method further includes: storing the inspection results corresponding to the resource objects to be inspected in a predetermined database in chronological order.
[0014] Optionally, when the inspection items recorded in the Web form include inspection items, the method further includes: grouping and counting the inspection results corresponding to the resource objects to be inspected according to the types of the inspection items, and formatting them into a json data format for displaying the inspection results.
[0015] Optionally, the method further includes: rendering the inspection results corresponding to the resource object to be inspected to obtain a corresponding chart or table; and displaying the chart or table.
[0016] Optionally, the method further includes: receiving a repair request for a predetermined inspection item in the inspection result on an interface displaying the chart or table; and repairing the predetermined inspection item according to the repair request.
[0017] Optionally, checking the resource object to be checked includes:
[0018] The inspection item, inspection frequency and inspection period customized in the Web form are obtained; and the resource object to be inspected corresponding to the inspection item is inspected according to the inspection frequency and / or the inspection period.
[0019] In a second aspect, a device for inspecting resource objects of a container cluster is provided, comprising a processor and a processor electrically connected to the memory, wherein the memory stores a computer program executable by the processor, and when the computer program is executed by the processor, the steps of the method described in the first aspect are implemented.
[0020] According to a third aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.
[0021] The method for checking the resource objects of the container cluster of the embodiment of the present application submits a request for checking the resource objects of the container cluster in the form of a Web form, and based on the inspection items recorded in the Web form corresponding to the request, filters the resource objects of the container cluster to determine the resource objects to be checked and performs corresponding health checks. The Web form can be generated by the user selecting the corresponding inspection items through the front-end Web browser. The form can cover the inspection of almost all resources of the container cluster, so the inspection items are complete. In addition, the operation in the form of a Web form is simpler and more convenient than the existing method that requires the use of command line execution.
[0022] In addition, the embodiment of the present application can also group and / or classify the data corresponding to the inspection results by presenting the inspection report corresponding to the inspection results to the front-end user in the form of charts and tables, so as to be more intuitive and readable.
[0023] This application can also store the data corresponding to the inspection results in a database periodically in chronological order to facilitate subsequent retrieval. In addition, most of the problems found can be directly repaired by receiving repair requests on the interface that displays the inspection results, without manually operating the container cluster again and finding the corresponding resource objects with problems through command line tools and then modifying them. In this way, the efficiency of repairing the health inspection problems of resource objects in the container cluster is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0025] Figure 1 It is a flowchart of a method for checking a container cluster resource object according to an embodiment of the present application.
[0026] Figure 2 This is a comparison chart of custom inspection contents of Kubernetes resource objects according to an embodiment of the present application.
[0027] Figure 3 It is a schematic diagram of an application scenario of a method for checking a container cluster resource object according to an embodiment of the present application.
[0028] Figure 4 It is a structural diagram of a container cluster resource object inspection device of the present application. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application. The numbering of the drawings in this application is only used to distinguish the various steps in the scheme, and is not used to limit the execution order of the various steps. The specific execution order is subject to the description in the specification.
[0030] In order to solve the problems existing in the prior art, the present application embodiment provides a method for checking container cluster resource objects, such as Figure 1 As shown, the following steps are included:
[0031] Step 102, receiving a request for checking a resource object of a container cluster, wherein the request is submitted in a web form;
[0032] Step 104: Obtain resource objects of the container cluster based on the request;
[0033] Step 106: filtering the resource objects of the container cluster according to the inspection items recorded in the Web form to determine the resource objects to be inspected;
[0034] Step 108: Check the resource object to be checked.
[0035] Based on the solution provided in the above embodiment, optionally, in the above step 102, the web form is predefined by the user, including at least one of the inspection items, inspection frequency and inspection period. For example, the user defines it in the form of submitting a form through a web browser.
[0036] In one embodiment, the check items defined in the Web form record may include at least one of a check item, a namespace, a check level, and a resource annotation.
[0037] The following is an example of a Kubernetes container cluster. Specifically, the check levels that need to be customized include three levels, such as suggestion, warning, and error; the namespaces that need to be checked are customized, and all namespaces in the container cluster can be checked.
[0038] The inspection item is an inspection description of the resource to be inspected. The custom inspection items include the following contents. Some of the following contents correspond to the inspection items, and some correspond to the problems and inspection levels corresponding to the inspection items. The contents can be displayed on the display screen of the front-end user, for example:
[0039] 1.1.1 Basic inspection
[0040] 1.1.1.1 Bare Pod: Avoid using bare Pod in Kubernetes cluster (Warning)
[0041] 1.1.1.2 Container images: Avoid using incompletely qualified image names and avoid using the latest tag for images (warning)
[0042] 1.1.1.3 Survival Probe: It is recommended to create a survival probe for the Pod (recommended)
[0043] 1.1.1.4 Readiness probe: It is recommended to create a readiness probe for the Pod (recommended)
[0044] 1.1.1.5 Default namespace: Avoid creating various resources in the default namespace (warning)
[0045] 1.1.1.6 Namespace resource limits: It is recommended to add resource limits (LimitRange) to the namespace (recommended)
[0046] 1.1.1.7 Namespace resource quota: It is recommended to add resource quota (ResourceQuota) to the namespace (recommended)
[0047] 1.1.1.8Pod resource quota: It is recommended to configure the Pod's resource request and Pod's resource limit, and check whether the Pod's resource request is too large (recommended)
[0048] 1.1.1.9 Custom node labels: Avoid custom node labels (Warning)
[0049] 1.1.1.10 Master node: Pod scheduling should be prohibited on the Master node (error)
[0050] 1.1.1.11 Monitoring Service (Metric Server): It is recommended to install the Metric Server service in the Kubernetes cluster (recommended)
[0051] 1.1.1.12Pod node selection label: Avoid Pod node selection label as node name (recommendation)
[0052] 1.1.1.13 Endpoint: Avoid unready IP addresses in endpoints (errors)
[0053] 1.1.1.14 Access control hook (Webhook):
[0054] 1.1.1.14.1 Avoid configuring a validating webhook for a service whose namespace does not exist; (error)
[0055] 1.1.1.14.2 Avoid configuring the Validating Webhook for a service that does not exist; (error)
[0056] 1.1.1.14.3 Avoid configuring a mutating webhook for a service whose namespace does not exist; (error)
[0057] 1.1.1.14.4 Avoid configuring Mutating Webhook for a service that does not exist; (error)
[0058] 1.1.1.14.5 Avoid configuring the Validating Webhook for a namespace that is the Kubernetes system namespace; (error)
[0059] 1.1.1.14.6 Avoid configuring the mutating webhook to target the Kubernetes system namespace (error)
[0060] 1.1.1.15 Volume mount: Avoid mounting node directories directly (error)
[0061] 1.1.2 Useless checks
[0062] 1.1.2.1 Service Account: Unused Service Account (Warning)
[0063] 1.1.2.2 Configuration Dictionary (ConfigMap): Useless ConfigMap (Warning)
[0064] 1.1.2.3 Secret Dictionary: Useless Secret (Warning)
[0065] 1.1.2.4 PersistentVolume: Useless PersistentVolume (Warning)
[0066] 1.1.2.5 PersistentVolumeClaim: Useless PersistentVolumeClaim (Warning)
[0067] 1.1.2.6 HorizontalPodAutoscaler: Unused HorizontalPodAutoscaler (Warning)
[0068] 1.1.2.7 ClusterRole: Unused ClusterRole (Warning)
[0069] 1.1.2.8 Role: Useless Role (Warning)
[0070] 1.1.2.9 Service: Useless Service (Warning)
[0071] 1.1.2.10 ReplicaSet: Useless ReplicaSet (Warning)
[0072] 1.1.2.11PodDisruptionBudget: Useless PodDisruptionBudget (Warning)
[0073] 1.1.2.12PodPreset: Unused PodPreset (Warning)
[0074] 1.1.2.13 ClusterRoleBinding: Unused ClusterRoleBinding (Warning)
[0075] 1.1.2.14 RoleBinding: Useless RoleBinding (Warning)
[0076] 1.1.3 Status Check
[0077] 1.1.3.1 Node status:
[0078] 1.1.3.1.1 The node is in an unknown state (warning)
[0079] 1.1.3.1.2 Node is not in ready state (warning)
[0080] 1.1.3.1.3 Node out of memory (warning)
[0081] 1.1.3.1.4 Insufficient node disk space (warning)
[0082] 1.1.3.1.5 Insufficient node process identifier (PID) (warning)
[0083] 1.1.3.1.6 Node network unreachable (warning)
[0084] 1.1.3.1.7 Image file size in the node (warning)
[0085] 1.1.3.1.8 Node Lease Time (Warning)
[0086] 1.1.3.2 Namespace status: Namespace is not in ready state (warning)
[0087] 1.1.3.3Pod status:
[0088] 1.1.3.3.1Pod status is not Running or Succeeded (Warning)
[0089] 1.1.3.3.2 Pods with False in Pod Status Conditions (Warning)
[0090] 1.1.3.3.3 The number of container restarts in Pod is greater than 10 (warning)
[0091] 1.1.3.3.4Container status in Pod is not running normally (warning)
[0092] 1.1.3.4 Component status: controller-manager, scheduler, etcd storage status (warning)
[0093] 1.1.4 Security Check
[0094] 1.1.4.1 Disallow privileged containers (warning)
[0095] 1.1.4.2 Privilege escalation is not allowed (warning)
[0096] 1.1.4.3 Do not use host network or process space (warning)
[0097] 1.1.4.4 Remove unused and unnecessary Linux features (warning)
[0098] 1.1.4.5 Is PodSecurityPolicy configured (warning)?
[0099] 1.1.4.6 Avoid using Certificate Signing Request (Warning)
[0100] The above user-defined inspection items, inspection levels, namespaces and other data can be saved in the database.
[0101] For the custom content of the above Kubernetes resource object check, please refer to Figure 2 Inspection comparison chart.
[0102] The custom inspection frequency includes single inspection and periodic inspection. Single inspection means that the inspection is performed only once. Specifically, different inspection items can be defined according to the specific situation of this inspection.
[0103] Periodic inspection means that the inspection is performed according to a predetermined time period. For periodic inspection, the inspection period needs to be defined, for example, the user defines it by submitting a form through a web browser, for example: the inspection is performed at 23:00 every night.
[0104] During periodic inspection, the inspection items with periodic inspection in the database will be read, and periodic inspection will be performed according to the inspection cycle set by the user.
[0105] In addition, you can also define the inspection results of the resource objects of the container cluster, or the recipient of the inspection report. For example, by submitting a form, you can define the recipient of the inspection report and send the inspection report by email.
[0106] The above user-defined inspection frequency, inspection cycle and inspection report recipient data can be saved in the database.
[0107] After submitting the resource object check request of the container cluster in the web form in step 102, the resource object of the container cluster is obtained based on the request as described in step 104. The resource object here can be all resource objects under the container cluster, or can be the resource object corresponding to the check item.
[0108] Optionally, in step 106, the resource objects of the obtained container cluster are filtered according to the inspection items recorded in the web form to determine the resource objects to be inspected, including at least one of the following:
[0109] When the inspection items recorded in the Web form include inspection items, filtering out the resource objects to be inspected corresponding to the inspection items from the resource objects according to the inspection items recorded in the form; or
[0110] When the check item of the Web form record includes a namespace, filtering out the resource objects to be checked corresponding to the namespace from the resource objects according to the namespace; or
[0111] When the inspection items recorded in the Web form include inspection levels, filtering out resource objects to be inspected corresponding to the inspection level from the resource objects according to the inspection level; or
[0112] When the check items recorded in the Web form include resource annotations, the resource objects to be checked corresponding to the resource annotations are filtered out from the resource objects according to the resource annotations.
[0113] Specifically, for filtering resource objects: obtain the inspection items submitted by the user, and filter the Kubernetes cluster resource objects according to the predefined inspection rules (the inspection rules defined in 1.1.1, 1.1.2, 1.1.3, and 1.1.4 mentioned above) to filter out the inspection items that meet the requirements;
[0114] For filtering namespaces: based on the namespace information submitted by the user, filter out the namespace information in the Kubernetes cluster resource pair that the user does not need to check; that is, filter out the namespace information that needs to be checked.
[0115] For filtering inspection levels: based on the inspection levels submitted by the user, filter out the inspection levels that the user does not need; that is, filter out the inspection levels that need to be inspected.
[0116] For filtering resource annotations: You can customize annotations in Kubernetes resource objects. If there are annotations that do not check this resource, they are directly filtered out; that is, filter out the resource annotations that need to be checked.
[0117] After the filtering step is performed, the resource objects to be checked that are determined after the filtering process can be checked in step 108 .
[0118] Checking the resource object to be checked includes: obtaining the check items, check frequency and check period customized in the Web form; and checking the resource object to be checked corresponding to the check items according to the check frequency and / or the check period.
[0119] For a check frequency of 1, i.e. a single check, the check cycle can be ignored. For a check frequency greater than 1, the check is performed according to the corresponding custom check cycle.
[0120] Optionally, the inspection results corresponding to the resource objects to be inspected may be stored in a predetermined database in chronological order.
[0121] Optionally, when the inspection items recorded in the Web form include inspection items, the inspection results corresponding to the resource objects to be inspected can be grouped and counted according to the types of inspection items, and formatted into json data format for displaying the inspection results. That is, the inspection information is summarized, grouped and counted, and formatted into json data format, and provided to the front-end user for display.
[0122] Specifically, the inspection results in the json data format can be rendered to obtain corresponding charts or tables, and the charts or tables can be displayed.
[0123] The data of the inspection report is stored in the database in chronological order. Users can view the inspection report according to time. The data will be rendered using the Echart chart library and finally presented on the web browser in the form of charts and tables, and grouped and leveled according to different inspection items. For example, the chart shows the proportion of each inspection item, and the table shows the detailed information of each inspection item, such as the name of the inspection item, the corresponding problems of the inspection item, and the inspection level.
[0124] If the sending of the inspection report is defined, the inspection report is further sent to the defined inspection report recipient.
[0125] In one embodiment, the method further includes: receiving a repair request for a predetermined inspection item in the inspection result on an interface displaying the chart or table; and repairing the predetermined inspection item according to the repair request.
[0126] For the inspection results displayed on the front-end page, if they are presented on the web browser in the form of charts and tables, a repair button and corresponding repair suggestions can be set at the appropriate position of the corresponding row of each inspection item in the table. The repair effect can be achieved by clicking the repair button.
[0127] The issues fixed include issues that can be fixed directly, such as the following:
[0128] (1): Provide a Delete Pod button to delete the corresponding Pod.
[0129] (2): Provide a survival probe configuration form to add a survival probe to the deployment, stateful set, or daemon set corresponding to the Pod that lacks a survival probe.
[0130] (3): Provide a readiness probe configuration form and add a readiness probe to the Deployment, StatefulSet, or DaemonSet corresponding to the Pod that lacks a survival probe.
[0131] (4): Provide a delete button to scan and delete all resources under the default namespace.
[0132] (5): Provide a resource limit configuration form to add resource limits for the detected namespace.
[0133] (6): Provide a resource quota configuration form to add resource quotas for the detected namespace.
[0134] (7): Provide a resource request and resource limit configuration form to add resource requests and resource limits for the Deployment, StatefulSet, or DaemonSet corresponding to the detected Pod.
[0135] (8): Provide a delete node label button to delete custom node labels.
[0136] (9): Provide a scheduling prohibition button and add a scheduling prohibition label to the Master node.
[0137] (10): Provide a delete button to delete problematic Validating Webhook and Mutating Webhook resources.
[0138] (11): All useless checks provide a delete button to delete the corresponding resources.
[0139] (12) For the naming control whose namespace is in the Terminating state, a delete button is provided and the terminator of the namespace is set to empty.
[0140] refer to Figure 3 , Figure 3 This is a schematic diagram of an application scenario of a method for checking a container cluster resource object according to an embodiment of the present application. Figure 3 , the application scenario of the method for checking the container cluster resource object of the embodiment of the present application is described in detail.
[0141] The user customizes the inspection level, namespaces to be inspected and / or inspection items by submitting a form through a web browser 001. The inspection items, inspection levels, namespaces and other data customized by the user are saved in a database 005, such as a Mysql database, through the inspection processing module 002. Similarly, the inspection cycle and inspection report recipient data defined by the user can also be saved in the database 005 through the inspection processing module 002.
[0142] After the user defines the inspection items and inspection report recipients through the Web browser 001, he clicks the Check button. The Web browser 001 will send the request to the inspection processing module 002. The inspection processing module 002 calls the Kubernetes API (Application Programming Interface) 003 to obtain the Kubernetes cluster resource object 006. The obtained resource information will be stored in the structure object customized by the inspection processing module 002 for inspection filtering processing.
[0143] If the sending of the inspection report is defined, the inspection report is sent through the inspection processing module 002. The periodic inspection module 004 reads the inspection items with periodic inspections in the database 005, and performs periodic inspections according to the inspection cycle set by the user. The data of the final inspection report obtained by the inspection can be stored in the database 005 in chronological order.
[0144] For the various deletion buttons or configuration forms described above, the Kubernetes API 003 can be directly called through the repair processing module 007 to perform corresponding deletion operations, addition operations and / or resource restrictions, resource quota operations, etc.
[0145] The existing inspection method of selecting the health inspection items of resource objects in the container cluster through command line parameters will result in incomplete inspection items, such as not covering the inspection of all resources in the Kubernetes container cluster. In addition, the command line is required for execution, and all inspections require the command line method, which is not convenient to operate.
[0146] In addition, the existing inspection method for selecting health inspection items for resource objects of a container cluster through command line parameters has at least one of the following problems: the inspection results are unreadable, and the output summary is performed in a terminal manner, which is not intuitive and has poor readability; the inspection results cannot be saved, and the results output in terminal mode cannot be directly saved and cannot be stored uniformly; the problems found cannot be directly handled, and only suggestions or repair methods are given for the problems, and repair operations cannot be performed directly; periodic inspections cannot be performed, and inspection reports cannot be sent.
[0147] The method for checking resource objects of a container cluster in an embodiment of the present application submits a request for checking the resource objects of the container cluster in the form of a Web form, and filters the resource objects of the container cluster based on the inspection items recorded in the Web form corresponding to the request to determine the resource objects to be checked and perform corresponding health checks.
[0148] Web forms can be generated by users through front-end web browsers by selecting corresponding inspection items. The forms can cover inspections of almost all resources in the container cluster, so the inspection items are complete. In addition, operations in the form of web forms are simpler and more convenient than the existing method of using command lines.
[0149] In addition, the embodiment of the present application presents the inspection report corresponding to the inspection results to the front-end user in the form of charts and tables. The data corresponding to the inspection results can also be grouped according to the type of inspection item and / or the data corresponding to the inspection results can be classified according to the type of inspection level, so that it is more intuitive and readable.
[0150] This application can also store the data corresponding to the inspection results in a database periodically in chronological order to facilitate subsequent retrieval. In addition, most of the problems found can be directly repaired by receiving repair requests on the interface that displays the inspection results, without manually operating the container cluster again, and finding the corresponding resource objects with problems through command line tools and modifying them. In this way, the efficiency of repairing resource object health inspection problems can be improved.
[0151] In addition, the embodiments of the present application can also customize the inspection frequency of resource objects through a Web browser to determine single inspections or periodic inspections; customize inspection cycles to perform periodic inspections; and customize inspection report recipients to enable the sending of inspection reports, for example, reports can be sent by email.
[0152] In order to solve the problems existing in the prior art, preferably, an embodiment of the present application further provides a device for checking container cluster resource objects. Figure 4 A schematic diagram of the structure of a container cluster resource object inspection device according to an embodiment of the present application.
[0153] like Figure 4 As shown, the device 2000 includes a memory 2200 and a processor 2400 electrically connected to the memory 2200, and the memory 2200 stores a computer program that can be executed on the processor 2400. When the computer program is executed by the processor 2400, each process of any one of the above-mentioned container cluster resource object inspection method embodiments is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0154] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of any of the above-mentioned container cluster resource object inspection method embodiments is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. Among them, the computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0155] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0156] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0157] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A method for checking container cluster resource objects. It is characterized in that include: Receive a request for checking a resource object of a container cluster, where the request is submitted in a web form, where the web form records check items defined by a user through a web browser, where the check items include check items and at least one of a namespace, a check level, and a resource annotation, and where the web form covers checks on all resource objects of the container cluster; Acquire a resource object of the container cluster based on the request; According to the inspection items recorded in the Web form, the resource objects of the container cluster are filtered to determine the resource objects to be inspected; Checking the resource object to be checked; Rendering the inspection result corresponding to the resource object to be inspected to obtain a corresponding chart or table; presenting the chart or table; On the interface displaying the chart or table, a repair request for a predetermined inspection item in the inspection result is received, wherein the repair request is triggered by a user clicking a repair button corresponding to the predetermined inspection item, and a repair button and a corresponding repair suggestion are set at the position of the corresponding row of each inspection item; The predetermined inspection item corresponding to the repair request is repaired according to the repair suggestion corresponding to the repair button of the predetermined inspection item.
2. The method according to claim 1, It is characterized in that The resource objects of the container cluster are filtered to determine the resource objects to be checked, including at least one of the following: When the inspection items recorded in the Web form include inspection items, filtering out the resource objects to be inspected corresponding to the inspection items from the resource objects according to the inspection items recorded in the Web form; or When the check item of the Web form record includes a namespace, filtering out the resource objects to be checked corresponding to the namespace from the resource objects according to the namespace of the Web form record; or When the inspection item of the Web form record includes an inspection level, filtering out resource objects to be inspected corresponding to the inspection level from the resource objects according to the inspection level of the Web form record; or When the check items recorded in the Web form include resource annotations, the resource objects to be checked corresponding to the resource annotations are filtered out from the resource objects according to the resource annotations recorded in the Web form.
3. The method according to claim 1, It is characterized in that Also includes: The inspection results corresponding to the resource objects to be inspected are stored in a predetermined database in chronological order.
4. The method according to claim 1, It is characterized in that Also includes: According to the type of inspection item, the inspection results corresponding to the resource objects to be inspected are grouped and counted, and formatted into json data format for displaying the inspection results.
5. The method according to claim 1, It is characterized in that Checking the resource object to be checked includes: Obtain the inspection items, inspection frequency and inspection period customized in the Web form; The resource object to be inspected corresponding to the inspection item is inspected according to the inspection frequency and / or the inspection period.
6. A container cluster resource object inspection device, It is characterized in that include: A memory and a processor electrically connected to the memory, wherein the memory stores a computer program executable by the processor, and when the computer program is executed by the processor, the steps of the method for checking a container cluster resource object according to any one of claims 1 to 5 are implemented.
7. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for checking a container cluster resource object according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
container Cloud-platform multi-cluster building method, media and device based on Kubernetes and OpenStack
CN109067828A
Method and equipment for upgrading and checking storage system
CN111338678A
