Information collection method, device, electronic device and computer-readable storage medium
By using two types of Pod objects in the target cluster for information interaction in multi-cluster management, collecting cluster status and node information, the problem of high complexity of information collection in multi-cluster management is solved, efficiency is improved and computing pressure on the server is reduced.
Patent Information
- Application Number
- CN202211416911.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-14
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2042-11-14
AI Technical Summary
In hybrid multi-cloud scenarios, cluster status and node information need to be obtained in real time in multi-cluster management. In the existing technology, the server needs to traverse and access each cluster, resulting in high processing complexity and high computing pressure.
By obtaining configuration instructions, at least two types of initial container set Pod objects in the target cluster are run, and target data is collected based on the information interaction between these Pod objects.
It improves information collection efficiency, reduces the processing complexity and calculation pressure of the server, and decouples the server and information collection logic.
Smart Images

Figure CN115776489B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of cloud computing technologies, and in particular to fields such as cloud native and container technologies. Specifically, it relates to an information collection method, apparatus, electronic device, and computer-readable storage medium. Background Art
[0002] Cloud native technologies have promoted the development speed of hybrid multi-clouds. The hybrid multi-cloud scenario increases the complexity of unified operation and maintenance management. Therefore, in the hybrid multi-cloud scenario, multi-cluster (such as k8s / k3s clusters) management is particularly important.
[0003] In multi-cluster management, it is necessary to obtain the cluster status and information of each node in the cluster in real time. In related technologies, the server will traverse and access each cluster to obtain information and perform related calculation and processing. Summary of the Invention
[0004] The present disclosure provides an information collection method, apparatus, electronic device, and computer-readable storage medium.
[0005] According to one aspect of the present disclosure, there is provided an information collection method, including:
[0006] Obtaining a configuration instruction, where the configuration instruction is used to instruct a target cluster to configure configuration information related to information collection;
[0007] Responding to the configuration instruction, running at least two types of initial container set Pod objects in the target cluster;
[0008] Collecting target data according to the information interaction between the at least two types of Pod objects.
[0009] According to another aspect of the present disclosure, there is provided an information collection method, including:
[0010] Sending a configuration instruction to a target cluster; wherein the configuration instruction is used to instruct the target cluster to configure configuration information related to information collection;
[0011] Receiving target data from the target cluster; wherein the target data is obtained by the target cluster through information collection based on the configuration instruction.
[0012] According to another aspect of the present disclosure, there is provided an information collection apparatus, including:
[0013] An instruction obtaining module, configured to obtain a configuration instruction, where the configuration instruction is used to instruct a target cluster to configure configuration information related to information collection;
[0014] A Pod running module, configured to respond to the configuration instruction and run at least two types of container set Pod objects in the target cluster;
[0015] A data acquisition module, configured to collect target data according to the information interaction between at least two types of Pod objects.
[0016] According to another aspect of the present disclosure, there is provided an information collection device, including:
[0017] An instruction sending module, configured to send a configuration instruction to a target cluster; wherein, the configuration instruction is used to instruct the target cluster to configure configuration information related to information collection;
[0018] A data receiving module, configured to receive target data from the target cluster; wherein, the target data is obtained by the target cluster through information collection based on the configuration instruction.
[0019] According to another aspect of the present disclosure, there is provided an electronic device, including:
[0020] At least one processor; and
[0021] A memory communicatively connected to the at least one processor; wherein,
[0022] The memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the method of any embodiment in the present disclosure.
[0023] According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method of any embodiment in the present disclosure.
[0024] According to another aspect of the present disclosure, there is provided a computer program product, including a computer program, which when executed by a processor, implements the method of any embodiment in the present disclosure.
[0025] By adopting the technical solution provided by the present disclosure, the target cluster can, based on the obtained configuration instruction, utilize the information interaction between two types of Pod objects in the cluster to complete information collection in the cluster, improving the information collection efficiency, while reducing the processing complexity of the server and the computing pressure on the server.
[0026] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The drawings are used to better understand the solution and do not constitute a limitation to the present disclosure. Among them:
[0028] Figure 1 It is a schematic diagram of a processing scenario according to an embodiment of the present disclosure;
[0029] Figure 2 It is a schematic flowchart of an information collection method according to an embodiment of the present disclosure;
[0030] Figure 3 It is a schematic flowchart of an information collection method according to another embodiment of the present disclosure;
[0031] Figure 4 It is a schematic structural diagram of a system for implementing an information collection method in an application example;
[0032] Figure 5 It is a schematic block diagram of an information collection device according to an embodiment of the present disclosure;
[0033] Figure 6 It is a schematic block diagram of an information collection device according to another embodiment of the present disclosure;
[0034] Figure 7 It is a schematic block diagram of an information collection device according to still another embodiment of the present disclosure;
[0035] Figure 8 It is a schematic block diagram of an information collection device according to still another embodiment of the present disclosure;
[0036] Figure 9 It is a schematic block diagram of an information collection device according to still another embodiment of the present disclosure;
[0037] Figure 10 It is a block diagram of an electronic device for implementing the information collection method according to an embodiment of the present disclosure. Detailed implementation manners
[0038] The following describes exemplary embodiments of the present disclosure with reference to the accompanying drawings. Various details of the embodiments of the present disclosure are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0039] As used herein, the term "and / or" merely describes an association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent three cases: A exists alone, both A and B exist simultaneously, and B exists alone. As used herein, the term "at least one" means any one of a plurality or any combination of at least two of a plurality. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set composed of A, B, and C. As used herein, the terms "first" and "second" are used to refer to multiple similar technical terms and distinguish them, rather than limiting the order or meaning that there are only two. For example, the first feature and the second feature refer to two categories / two features. The first feature can be one or more, and the second feature can also be one or more.
[0040] In addition, for a better illustration of the present disclosure, numerous specific details are given in the following specific embodiments. Those skilled in the art should understand that the present disclosure can also be implemented without certain specific details. In some instances, methods, means, elements, and circuits well-known to those skilled in the art are not described in detail to highlight the gist of the present disclosure.
[0041] The following briefly explains the basic concepts related to the embodiments of the present disclosure. It should be understood that the basic concepts introduced below do not limit the embodiments of the present disclosure.
[0042] 1. Cluster: A cluster is a group of independent computers interconnected by a high-speed network. A cluster includes a control node and computing nodes, where Pods run on the computing nodes. Common clusters include k8s (Kubernetes) clusters and k3s (lightweight Kubernetes) clusters, which support automated deployment, large-scale scalability, and application containerization management.
[0043] 2. Pod (container set): A Pod is the smallest / simplest basic unit created or deployed in a cluster environment. A Pod represents a process running on the cluster (similar to a process running on Linux). A Pod provides two shared resources: network and storage. Each Pod can be assigned an independent IP address, and each container in the Pod shares the network namespace, including the IP address and network ports. There are two ways to use a Pod: running one container in a Pod, or running multiple containers simultaneously in a Pod. The multiple containers cooperate with each other and share resources, and the Pod manages the storage resources of these containers as an entity.
[0044] 3. CRD (Custom Resource Definition): A CRD is a description of a CR (Custom Resource). A CR is an API (Application Programming Interface) extension mechanism in the cluster, enabling users to conveniently extend the cluster functions without modifying the cluster source code. The CRD will define the CR and list its configuration information.
[0045] 4. Operator: An Operator is a custom Kubernetes controller that uses CRs to manage applications and their components.
[0046] 5. API-server (Application Programming Interface Service): The API-server is the entry point of the cluster. Any operations of adding, deleting, modifying, or querying cluster resources by users and programs need to go through the API-server.
[0047] To facilitate understanding of the technical solution provided by this disclosure, Figure 1 a schematic diagram of a processing scenario according to an embodiment of this disclosure is shown. As Figure 1 shown, in the embodiment of this disclosure, the server can be connected to multiple clusters. Figure 1 Three clusters are exemplarily shown, and taking the interaction processing flow between the server and Cluster 1 as an example, the configuration process of the processing scenario of the embodiment of this disclosure is described. As Figure 1 shown, the configuration process includes the following steps:
[0048] S101. The server sends a configuration instruction to the cluster.
[0049] S102. The cluster interface (such as the API-server) defines the CRD according to the configuration instruction.
[0050] S103. The controller (such as the Operator) deploys at least two types of Pod objects according to the CRD, and the at least two types of Pod objects are used to perform information interaction according to the configuration in the CRD.
[0051] The above processing scenario is an example, which exemplarily describes the relationship between the server, the cluster interface, the CRD, the controller, and the Pod, that is, the cluster interface interacts with the server for the configuration instruction to configure the CRD according to the configuration instruction, so that the controller can deploy at least two types of Pod objects based on the configuration in the CRD, so that the cluster can complete information collection by using the information interaction between the two types of Pod objects.
[0052] According to an embodiment of this disclosure, an information collection method is provided. Figure 2It is a schematic flowchart of an information collection method according to an embodiment of the present disclosure. This method can be applied to an information collection device. Exemplarily, this information collection device can be deployed in a target cluster. The target cluster can refer to a cluster for which information / data is to be collected. Exemplarily, this target cluster can be a k8s cluster or a k3s cluster. In some possible implementation manners, this method can be implemented by a processor calling computer-readable instructions stored in a memory. As Figure 2 shown, this method includes:
[0053] S201. Obtain a configuration instruction, where the configuration instruction is used to instruct the target cluster to configure configuration information related to information collection.
[0054] S202. In response to the configuration instruction, run at least two types of Pod objects in the target cluster.
[0055] S203. According to the information interaction between at least two types of Pod objects, collect target data.
[0056] Exemplarily, the above configuration instruction can be sent by a server to the target cluster. The server can refer to a terminal / server that provides user services based on the computing capabilities of one or more clusters. The above configuration instruction can also be obtained by interacting with the user, or can also be pre-configured on the target cluster.
[0057] In some examples, the configuration information indicated by the configuration instruction can include information related to deploying Pod objects, and can also include information related to triggering or running information collection, such as the image address of the Pod object, the running parameters of the information collection process, etc.
[0058] Correspondingly, in response to the configuration instruction, the target cluster can automatically complete information collection through the running of at least two types of Pod objects based on the above information related to triggering or running information collection, without the server initiating a request every time information is collected.
[0059] In one embodiment, the at least two types of Pod objects can include a first type of Pod object for calling other Pod objects to collect data and sending the data to the server, and a second type of Pod object for collecting data.
[0060] In one example, the information interaction between at least two types of Pod objects can include: the first type of Pod object calls the second type of Pod object, the second type of Pod object collects relevant data, and returns the data to the first type of Pod object.
[0061] Exemplarily, the target data can be data obtained by processing the collected data through operations such as calculation, summarization, and data structure conversion by a Pod object. Based on this, by running at least two types of Pod objects, data available to the server can be obtained, such as data that can be presented to users. In this way, the information processing logic can be decoupled from the server of the collection entity. When the above processing logic needs to be adjusted, there is no need to modify the code information of the server. Instead, only the configuration instructions need to be modified to update the collection logic by modifying the corresponding configuration in the target cluster.
[0062] Using the information collection method provided in the above embodiment, the target cluster can complete information collection based on the obtained configuration instructions by leveraging the information interaction between two types of Pod objects in the cluster, decoupling the server from the information collection logic, improving the information collection efficiency, reducing the processing complexity of the server, and alleviating the computing pressure on the server.
[0063] Optionally, after the target data is collected, the above information collection method may further include: sending the target data to the server.
[0064] As an exemplary implementation manner, step S203 above, collecting the target data according to the information interaction between at least two types of Pod objects, includes: sending the resource information to be collected from a first type of Pod object in the target cluster to a second type of Pod object in the target cluster; obtaining the collected data corresponding to the resource information to be collected through the second type of Pod object; and obtaining the target data based on the collected data.
[0065] Among them, the first type of Pod object is used to call the second type of Pod object. Exemplarily, the first type of Pod object can send the resource information to be collected to the second type of Pod object by calling the http (Hyper Text Transfer Protocol) interface of the second type of Pod object.
[0066] Exemplarily, the resource information to be collected may include the resource information of the cluster and / or the resource information of the nodes in the cluster. Among them, the resource information of the cluster may include the Pod information of the cluster, namespaces, PVC (Persistent Volume Claim), etc.; the resource information of the nodes includes the usage information and remaining information of system resources such as the CPU (Central Processing Unit), Memory, and Disk of the nodes.
[0067] Exemplarily, the collected data is the real-time data corresponding to the above resource information. Correspondingly, the target data can be the data obtained after processing the collected data, such as calculation, summarization, data structure conversion, etc.
[0068] Adopting the above implementation manner, through the information interaction of two types of Pod objects, data is automatically collected, and the collected data is processed in the cluster, which improves the data collection efficiency, reduces the processing complexity of the server, and reduces the computing pressure on the server.
[0069] Optionally, for different resource information, different Pod objects can be used for collection.
[0070] In one example, the second type of Pod object includes a first Pod object corresponding to a node in the target cluster, and this first Pod object can also be called a node information detection Pod (node-detector Pod).
[0071] Correspondingly, obtaining the collected data through the second type of Pod object can include: through the first Pod object, determining the first resource information related to the node in the resource information to be collected, and collecting the first collected data corresponding to the first resource information; wherein, the first collected data is used to characterize the state of the node.
[0072] For example, the first resource information includes the usage information, remaining information, etc. of various system resources such as the CPU, Memory, Disk, etc. of the node. The first collected data is used to characterize the real-time state of the above information.
[0073] According to this example, the first collected data corresponding to the first resource information related to the node is collected by using the first Pod object, so that it is not necessary for the server to initiate a request to access the interface service of the cluster each time, nor is it necessary for the server to set up another agent (proxy module) to support the collection of node information, which simplifies the information collection process.
[0074] In one example, the second type of Pod object includes a second Pod object corresponding to the target cluster, and this second Pod object can also be called a meta-information detection Pod (Meta-detector Pod).
[0075] Correspondingly, collecting the target data corresponding to the target resource information through the second type of Pod object can include: through the second Pod object, determining the second resource information related to the target cluster in the resource information to be collected, and collecting the second collected data corresponding to the second resource information; wherein, the second collected data is used to characterize the state of the target cluster.
[0076] For example, the second resource information includes meta-information of the target cluster, such as Pod information, namespaces, PVCs, etc. The second collected data is used to characterize the real-time status of the above information.
[0077] According to this example, the second collected data corresponding to the second resource information related to the target cluster is collected by using the second Pod object, so that it is not necessary for the server to initiate a request and access the cluster interface service every time it collects, simplifying the information collection process.
[0078] In one embodiment, according to the collected data, target data is obtained, including: processing the collected data based on a pre-configured data display structure to obtain the target data.
[0079] Exemplarily, the data display structure can point to the data form for presenting data to the user. Based on this data display structure, the processing forms such as calculation, summarization, and data structure conversion that need to be performed on the collected data can be determined.
[0080] Exemplarily, through a second type of Pod object, such as a cluster information detection Pod and a meta-information detection Pod, the collected data can be calculated and processed based on this data display structure, so as to achieve calculation in the cluster.
[0081] Exemplarily, through a first type of Pod object, the collected data obtained by the second type of Pod object can be summarized and data structure conversion processing can be performed based on this data display structure. For example, the first type of Pod object merges the first collected data and the multiple second collected data corresponding to multiple nodes based on this data display structure to obtain the target data.
[0082] By adopting the above embodiment, the collected information is calculated in the target cluster, thereby improving the data collection efficiency and at the same time reducing the calculation pressure on the server.
[0083] In one embodiment, through a first type of Pod object in the target cluster, the resource information to be collected is sent to a second type of Pod object in the target cluster, including:
[0084] Based on pre-configured running time information, the first type of Pod object is triggered to send the resource information to be collected to the second type of Pod object.
[0085] Among them, the running time information can be used to indicate the time node for the first type of Pod object to send this resource information. For example, the running time information can be a specified time node or a collection interval duration.
[0086] Adopting the above implementation manner, at least two types of Pod objects are automatically triggered based on the running time information for information interaction, thereby completing information collection, without the need for the server to initiate a request and access the cluster's interface service every time information is collected, simplifying the information collection process.
[0087] As an exemplary implementation manner, the above step S202, in response to a configuration instruction, runs at least two types of Pod objects in the target cluster, including: in response to a configuration instruction, configuring a CRD; according to the CRD, running at least two types of Pod objects in the target cluster.
[0088] Exemplarily, when receiving a configuration instruction, configure the CRD through the interface of the target cluster, and the CRD can describe the deployment parameters and running parameters of the above at least two types of Pod objects for deploying the above at least two types of Pod objects and for instructing the above at least two types of Pod objects to perform information collection.
[0089] Optionally, the above process of configuring the CRD can be executed when it is necessary to deploy the above Pod objects or when it is necessary to update the information processing logic of each Pod object. It can be understood that through CRD-ification, when the information processing logic needs to be updated, the CRD is changed through the interface of the target cluster, and information collection can be performed according to the new information processing logic without modifying the main logic of the server, thereby decoupling the collection main server and the specific implementation method.
[0090] In one example, according to the CRD, running at least two types of Pod objects in the target cluster includes: running at least two types of Pod objects according to the running parameters defined by the CRD. Among them, the running parameters include at least one of the running time information of at least two types of Pod objects, the resource information to be collected, the data display structure of the target data, and the address information of the server.
[0091] According to this example, the CRD can be used to define the running parameters of at least two types of Pod objects. Thus, by changing the CRD, the running parameters can be updated, and thus the triggering conditions for collection, the output form of data, and the output address can be flexibly configured to better match the application requirements.
[0092] In one example, before running at least two types of Pod objects according to the CRD, it further includes: deploying at least two types of Pod objects according to the Pod image addresses defined by the CRD.
[0093] Among them, the Pod image addresses can include the image addresses of each Pod object among at least two types of Pod objects.
[0094] Optionally, for the first type of Pod objects and the second Pod objects in the second type that are used to collect cluster information, they can be deployed using the Deployment (stateless deployment) method, that is, one such type of Pod is deployed in each cluster.
[0095] Optionally, for the first Pod objects in the second type of Pod objects that are used to collect node information, they can be deployed using the DaemonSet (daemon set) method, that is, one such type of Pod is deployed corresponding to each node.
[0096] According to this example, the CRD can be used to define the image addresses of at least two types of Pod objects. Thus, by changing the CRD, each deployed Pod object can be updated, simplifying the update process of the Pod objects and facilitating real-time matching of application requirements.
[0097] According to an embodiment of the present disclosure, there is also provided an information collection method. Figure 3 It is a schematic flowchart of an information collection method according to another embodiment of the present disclosure. This method can be applied to an information collection device. Exemplarily, this information collection device can be deployed in a server. The server can refer to a terminal / server that provides user services based on the computing power of one or more clusters. In some possible implementation manners, this method can be implemented by a processor invoking computer-readable instructions stored in a memory. As Figure 3 shown, this method includes:
[0098] S301. Send a configuration instruction to a target cluster; wherein, the configuration instruction is used to instruct the target cluster to configure configuration information related to information collection;
[0099] S302. Receive target data from the target cluster.
[0100] Wherein, the target data is obtained by the target cluster using at least two types of Pod objects for information collection.
[0101] Optionally, the above configuration instruction can be sent when it is necessary to deploy or update at least two types of Pod objects in the target cluster, so as to implement an information collection method that matches application requirements using the at least two types of Pod objects in the target cluster.
[0102] Wherein, the configuration information indicated by the configuration instruction can include the image address and running parameters of the Pod object. The utilization method of this configuration information can be implemented with reference to the foregoing embodiments and will not be elaborated herein.
[0103] According to the above method provided by the embodiments of the present disclosure, the server sends a configuration instruction to the target cluster, enabling the target cluster to complete the configuration related to information collection and implement information collection based on this configuration. There is no need for the server to initiate a request and access the interface service of the cluster every time information is collected, which improves the information collection efficiency, reduces the processing complexity of the server, and reduces the computing pressure on the server.
[0104] To facilitate the understanding of the technical solutions of the embodiments of the present disclosure, a specific application example is provided below taking the k8s cluster as an example. Figure 4 The structural schematic diagram of the system for implementing the information collection method in this application example is shown. Among them, the system includes a server 410 and the connected k8s clusters 420-440.
[0105] In this application example, the information collection method includes a configuration process and an information collection process.
[0106] In the configuration process, the server 410 deploys at least two types of Pod objects in each k8s cluster through the Operator, including a report detector Pod (report-detector Pod, corresponding to the above-mentioned first type of Pod object) and an information detector Pod (corresponding to the above-mentioned second type of Pod object). Among them, according to the different information to be detected, the information detector Pod can include a meta-information detector Pod (meta-detector Pod) and a node information detector Pod (node-detector Pod).
[0107] Specifically, taking the cluster 420 as an example, the configuration process includes the following steps:
[0108] (1) The server 410 defines a CRD through the interface of the k8s cluster 420, describing the image addresses of the three Pods, the resource information to be collected, the collection interval duration, the reporting address (the address of the server), and the data display structure.
[0109] (2) The Operator deploys the meta-information detector Pod 421, the node information detector Pod 422, and the report detector Pod 423 according to the image addresses of the Pods in the CRD. When the CRD is generated, the Operator updates each deployed Pod without modifying the main logic of the server for information collection, greatly simplifying the information collection process and decoupling the main service for collection on the server and the specific implementation method.
[0110] Among them, the resource information to be collected is the sum of the cluster information and the node information.
[0111] The meta - information detection Pod 421 is used to obtain cluster information. The meta - information detection Pod 421 is deployed in the form of Deployment (stateless deployment), that is, only one needs to be deployed for each cluster.
[0112] The node - information detection Pod 422 is used to obtain node information. The node - detection Pod 422 is deployed in the form of DaemonSet (daemon set), that is, one is deployed for each node, and there are generally multiple nodes in each cluster.
[0113] The report - detection Pod 423 is used to summarize the collected data obtained by the meta - information detection Pod 421 and the node - information detection Pod 422, and merge the collected data according to the data display structure and then send it to the server 410.
[0114] During the information collection process, when the above Pods have been deployed in the cluster 420 and the CRD does not need to be changed, the following steps can be directly executed. If the CRD needs to be changed, that is, when the data collection logic needs to be updated, the server 410 changes the image address of the Pod, the resource information to be collected, the collection interval duration, and the reporting address through the interface of the cluster 420, and then executes the following steps:
[0115] (1) The report - detection Pod 423 actively calls the http interfaces of the meta - information detection Pod 421 and the node - information detection Pod 422 based on the resource information to be collected described in the CRD and the collection interval duration in the CRD. It can be understood that the resource information to be collected is sent to the meta - information detection Pod 421 and the node - information detection Pod 422.
[0116] (2) The meta - information detection Pod 421 and the node - information detection Pod 422 respectively determine the resource information related to the cluster information and node information from the resource information to be collected, and respectively collect the corresponding data. The meta - information detection Pod 421 and the node - information detection Pod 422 also perform statistical calculations on the data they collect according to the data display structure, which is convenient for subsequent display to users. It realizes the calculation of the collected data in the cluster and reduces the calculation pressure on the server. Then, the meta - information detection Pod 421 and the node - information detection Pod 422 send the calculated collection information back to the report - detector Pod through their respective http interfaces.
[0117] (3) The report - detection Pod 423 merges the data collected and sent back by the meta - information detection Pod 421 and the node - information detection Pod 422 based on the data display structure to obtain the target data in the cluster, and then sends the target data to the server corresponding to the reporting address described in the CRD. The server displays the data to the user for viewing according to the data display structure.
[0118] It can be seen that according to the information collection method of the present disclosure embodiment, the server sends a configuration instruction to the target cluster, and the target cluster can complete information collection based on this configuration instruction by using the information interaction between two types of Pod objects in the cluster, decoupling the server from the information collection logic, improving the information collection efficiency, reducing the processing complexity of the server, and reducing the computing pressure on the server.
[0119] According to an embodiment of the present disclosure, the present disclosure also provides an information collection device for implementing the above method. Figure 5 The schematic block diagram of the information collection device provided by an embodiment of the present disclosure is shown. This information collection device can be deployed in the target cluster.
[0120] An instruction acquisition module 511 is configured to acquire a configuration instruction, and the configuration instruction is used to instruct the target cluster to configure configuration information related to information collection;
[0121] A Pod operation module 512 is configured to respond to the configuration instruction and operate at least two types of container set Pod objects in the target cluster;
[0122] A data acquisition module 513 is configured to acquire target data according to the information interaction between at least two types of Pod objects.
[0123] In some embodiments, on the basis of Figure 5 , as Figure 6 shown, the data acquisition module 513 includes:
[0124] A resource information sending module 611 is configured to send the resource information to be collected to a second type of Pod object in the target cluster through a first type of Pod object in the target cluster;
[0125] A data acquisition unit 612 is configured to acquire the acquisition data corresponding to the resource information to be collected through the second type of Pod object;
[0126] A data processing unit 613 is configured to obtain target data according to the acquisition data.
[0127] In some embodiments, the second type of Pod object includes a first Pod object corresponding to a service node in the target cluster;
[0128] The data acquisition unit 612 is configured to: determine first resource information related to the service node in the resource information to be collected through the first Pod object, and acquire first acquisition data corresponding to the first resource information; wherein, the first acquisition data is used to characterize the state of the service node.
[0129] In some embodiments, the second type of Pod object includes a second Pod object corresponding to the target cluster;
[0130] The data acquisition unit 612 is configured to: determine, through a second Pod object, second resource information related to a target cluster in the resource information to be acquired, and acquire second acquisition data corresponding to the second resource information; wherein the second acquisition data is used to characterize the state of the target cluster.
[0131] In some embodiments, the data processing unit 613 is configured to: process the acquired data based on a pre-configured data display structure to obtain target data.
[0132] In some embodiments, the resource information sending unit 611 is configured to: trigger a first type of Pod object to send the resource information to be acquired to a second type of Pod object based on pre-configured running time information.
[0133] In some embodiments, as Figure 7 shown, the Pod operation module 512 includes:
[0134] The CRD configuration unit 711 is configured to respond to a configuration instruction and configure a Custom Resource Definition (CRD).
[0135] The operation unit 712 is configured to run at least two types of Pod objects in the target cluster according to the CRD.
[0136] In some embodiments, the operation unit 712 is configured to: run at least two types of Pod objects according to the running parameters defined by the CRD.
[0137] Wherein the running parameters include at least one of the running time information of at least two types of Pod objects, the resource information to be acquired, the data display structure of the target data, and the address information of the server.
[0138] In some embodiments, as Figure 8 shown, the Pod operation module 512 further includes:
[0139] The Pod deployment unit 811 is configured to deploy at least two types of Pod objects according to the Pod image address defined by the CRD.
[0140] According to an embodiment of the present disclosure, the present disclosure further provides another information acquisition device for implementing the above method. Figure 9 The schematic block diagram of an information acquisition device provided by another embodiment of the present disclosure is shown, and the information acquisition device can be deployed in a server.
[0141] The instruction sending module 911 is configured to send a configuration instruction to a target cluster; wherein the configuration instruction is used to instruct the target cluster to configure configuration information related to information acquisition.
[0142] A data receiving module 912 is configured to receive target data from a target cluster, where the target data is obtained by an information collection device in the target cluster.
[0143] In the embodiments of the present disclosure, the specific implementation manners and beneficial effects of each module or unit are as described above and will not be elaborated here. In the technical solution of the present disclosure, the acquisition, storage, and application of the user's personal information involved all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.
[0144] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0145] Figure 10 FIG. shows a schematic block diagram of an exemplary electronic device 1000 that can be used to implement the embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, a personal digital assistant, a cellular phone, a smart phone, a wearable device, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely exemplary and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0146] As Figure 8 shown, the device 1000 includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1002 or a computer program loaded from a storage unit 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the device 1000 can also be stored. The computing unit 1001, the ROM 1002, and the RAM 1003 are connected to each other through a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0147] A plurality of components in the device 1000 are connected to the I / O interface 1005, including: an input unit 1006, such as a keyboard, a mouse, etc.; an output unit 1007, such as various types of displays, speakers, etc.; a storage unit 1008, such as a magnetic disk, an optical disk, etc.; and a communication unit 1009, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1009 allows the device 1000 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0148] The computing unit 1001 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1001 executes the various methods and processes described above, such as an information collection method. For example, in some embodiments, an information collection method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 1000 via the ROM 1002 and / or the communication unit 1009. When the computer program is loaded into the RAM 1003 and executed by the computing unit 1001, one or more steps of the information collection method described above can be executed. Alternatively, in other embodiments, the computing unit 1001 can be configured to execute an information collection method by any other suitable means (e.g., by means of firmware).
[0149] The various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a dedicated or general-purpose programmable processor, receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0150] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to the processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the program codes are executed by the processor or controller, the functions / operations specified in the flowchart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as an independent software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0151] In the context of this disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0152] In order to provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, speech input, or tactile input).
[0153] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0154] A computer system can include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The client-server relationship is generated by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, or a server of a distributed system, or a server incorporating a blockchain.
[0155] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and no limitations are imposed herein.
[0156] The above specific embodiments do not constitute a limitation on the protection scope of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub - combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the principles of this disclosure shall be included within the protection scope of this disclosure.
Claims
1. An information collection method, including: obtaining a configuration instruction for indicating configuration information related to information collection in a target cluster, where the configuration information includes information related to the triggering or running of information collection; responding to the configuration instruction and running at least two types of container set Pod objects in the target cluster; collecting target data based on the information interaction between the at least two types of Pod objects, where the target data is data obtained after performing at least one of calculation, summarization, and data structure conversion on the collected data; wherein, the responding to the configuration instruction and running at least two types of Pod objects in the target cluster includes: responding to the configuration instruction and configuring a Custom Resource Definition (CRD); running at least two types of Pod objects in the target cluster according to the CRD.
2. The method according to claim 1, wherein, the collecting the target data based on the information interaction between the at least two types of Pod objects includes: sending resource information to be collected by a first type of Pod object in the target cluster to a second type of Pod object in the target cluster; obtaining, by the second type of Pod object, the collected data corresponding to the resource information to be collected; obtaining the target data based on the collected data.
3. The method according to claim 2, wherein, the second type of Pod object includes a first Pod object corresponding to a node in the target cluster; the obtaining, by the second type of Pod object, the collected data corresponding to the resource information to be collected includes: determining, by the first Pod object, first resource information related to the node in the resource information to be collected, and collecting first collected data corresponding to the first resource information; wherein, the first collected data is used to characterize the state of the node.
4. The method according to claim 2, wherein, the second type of Pod object includes a second Pod object corresponding to the target cluster; the obtaining, by the second type of Pod object, the collected data corresponding to the resource information to be collected includes: determining, by the second Pod object, second resource information related to the target cluster in the resource information to be collected, and collecting second collected data corresponding to the second resource information; wherein, the second collected data is used to characterize the state of the target cluster.
5. The method according to claim 2, wherein, the obtaining the target data based on the collected data includes: processing the collected data based on a pre-configured data display structure to obtain the target data.
6. The method according to claim 2, wherein, the sending, by the first type of Pod object in the target cluster, the resource information to be collected to the second type of Pod object in the target cluster includes: triggering, based on pre-configured running time information, the first type of Pod object to send the resource information to be collected to the second type of Pod object.
7. The method according to claim 1, wherein, Running at least two types of Pod objects in the target cluster according to the CRD includes: Running the at least two types of Pod objects according to the running parameters defined by the CRD; Wherein, the running parameters include at least one of the running time information of the at least two types of Pod objects, the resource information to be collected, the data display structure of the target data, and the address information of the server.
8. The method according to claim 7, Wherein, Before running the at least two types of Pod objects according to the CRD, it further includes: Deploying the at least two types of Pod objects according to the Pod image address defined by the CRD.
9. An information collection method, Including: Sending a configuration instruction to the target cluster; wherein, the configuration instruction is used to instruct the target cluster to configure configuration information related to information collection; Receiving target data from the target cluster; wherein, the target data is collected by the target cluster by executing the method according to any one of claims 1-8.
10. An information collection device, Including: An indication acquisition module, configured to acquire a configuration instruction, where the configuration instruction is used to instruct a target cluster to configure configuration information related to information collection, and the configuration information includes information related to the trigger or running of information collection; A Pod running module, configured to run at least two types of container set Pod objects in the target cluster in response to the configuration instruction; A data acquisition module, configured to acquire target data according to the information interaction between the at least two types of Pod objects, where the target data is data obtained after performing at least one of calculation, summarization, and data structure conversion on the acquired data; Wherein, the Pod running module is configured to: Respond to the configuration instruction and configure a Custom Resource Definition (CRD); Run at least two types of Pod objects in the target cluster according to the CRD.
11. An information collection device, Including: An indication sending module, configured to send a configuration instruction to the target cluster; wherein, the configuration instruction is used to instruct the target cluster to configure configuration information related to information collection; A data receiving module, configured to receive target data from the target cluster; wherein, the target data is collected by the device according to claim 10 in the target cluster.
12. An electronic device, Including: At least one processor; And A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method according to any one of claims 1-9.
13. A non-transitory computer-readable storage medium storing computer instructions, Wherein, The computer instructions are used to cause the computer to execute the method according to any one of claims 1-9.
14. A computer program product, including a computer program, where the computer program, when executed by a processor, implements the method according to any one of claims 1-9.
Citation Information
Patent Citations
service deployment method and device for multiple Kubernetes clusters
CN113849266A
Network early warning method and device, electronic equipment and storage medium
CN115333928A