A cluster container network evaluation method and device, electronic equipment and program product
By selecting target objects closely related to business pods for probing on the cluster management node, and combining this with the probing module on the business node, the problems of resource waste and redundant probing in traditional container network SLA evaluation methods are solved, achieving a more efficient and accurate evaluation.
Patent Information
- Application Number
- CN202510238623.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2045-02-28
AI Technical Summary
Traditional container network SLA evaluation methods are costly and resource-intensive, leading to increased burden on the cluster network and redundant probing, which affects the accuracy of evaluation results.
By setting up an SLA module on the cluster management node, the target probe objects closely related to the business pods are selected for probe based on the probe information of the business pods, reducing redundant probes, and the probe module is embedded on the business nodes to obtain probe results that are closer to the actual business.
The container network SLA evaluation process has been optimized, reducing network load, improving the accuracy and efficiency of evaluation, and reducing resource consumption.
Smart Images

Figure CN119996235B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of containers, and in particular to a cluster container network evaluation method and device, an electronic device and a program product. BACKGROUND
[0002] With the development of cloud computing technology, cluster containers have become an important way of modern application deployment. This way realizes efficient use and flexible expansion of resources by packaging application programs and their dependencies into containers and deploying them to clusters.
[0003] In the cluster container architecture, the communication mechanism of the container network is relatively complex and is easily disturbed by factors such as network congestion and node failure, which leads to frequent fluctuations in its performance and affects the stable operation of the application, so it is particularly important to accurately evaluate the container network. The service level agreement (SLA) can accurately define the performance indicators of the container network and the service standards due to its perfect quantitative system, and is widely used in the service evaluation of the container network.
[0004] At present, the traditional SLA evaluation method has high running cost and large resource consumption, which increases the additional burden of the already complex container network. SUMMARY
[0005] The present application provides a cluster container network evaluation method, device, electronic device and program product, which can perform on-demand detection based on the detection information of the business pod, and can reduce the network burden caused by the container network evaluation process.
[0006] In a first aspect, the present application provides a cluster container network evaluation method, which is applied to a management node in a cluster. The management node is provided with a service level agreement (SLA) module, the cluster further includes a business node provided with a detection module, and the SLA module and the detection module are in communication connection. The method comprises: obtaining detection information of a to-be-detected business pod. The detection information includes a first service level and / or access target information of the to-be-detected business pod, the first service level is used to indicate the service level of the object in the cluster that needs to be detected, and the access target information is used to indicate the object to be accessed during the running of the to-be-detected business pod. Based on the detection information, all or part of the objects in the cluster are selected as target detection objects. The communication link between the to-be-detected business pod and the target detection object is detected by the detection module to obtain a detection result. Based on the detection result, the SLA evaluation parameters of the to-be-detected business pod are determined.
[0007] The cluster container network evaluation method provided in the application selects target detection objects from the cluster through the detection information of the to-be-detected business pod, compared with the wide and non-targeted detection method of the prior art, the application can select cluster objects closely related to the business pod according to the cluster object business level and the to-be-detected business pod access target, reduce invalid detection, and reduce the network burden caused by container network detection. At the same time, by setting a detection module on the business node to detect the target detection object, the detection result can also be quickly obtained by the business node based on the perception of the local network, and the detection period is shortened. In summary, the method provided in the application can optimize the process of container network SLA evaluation and reduce the network burden generated in the evaluation process.
[0008] In a possible implementation, the objects in the cluster include a pod, a physical node, or a service.
[0009] In another possible implementation, the detection information includes a first business level, and the selecting all or part of the target detection objects from the cluster based on the detection information includes: selecting, as the target detection objects, the objects of the first business level from all the objects in the cluster according to the first business level.
[0010] In another possible implementation, the detection information includes access target information of the to-be-detected business pod, and the selecting all or part of the target detection objects from the cluster based on the detection information includes: selecting, as the target detection objects, the objects to be accessed during the running of the to-be-detected business pod from all the objects in the cluster according to the access target information.
[0011] In another possible implementation, the detection information includes a first business level and access target information of the to-be-detected business pod, and the selecting all or part of the target detection objects from the cluster based on the detection information includes: selecting, as the target detection objects, the objects of the first business level and to be accessed during the running of the to-be-detected business pod from all the objects in the cluster according to the access target information and the first business level.
[0012] In another possible implementation, the method further includes: obtaining creation information of a newly created object, the newly created object including a pod or a service. In a case where the creation information includes access target information of the newly created object, the newly created object is created. In a case where the creation information does not include the access target information of the newly created object, the newly created object is rejected.
[0013] In another possible implementation, the method further includes: in a case where the creation information includes a business level of the newly created object, the newly created object is created. In a case where the creation information does not include the business level of the newly created object, a default business level is assigned to the newly created object and the newly created object is created.
[0014] In another possible implementation, the method further includes: obtaining a second service level. The pod of the second service level is selected from all service pods in the cluster as the to-be-probed service pod.
[0015] In another possible implementation, based on the detection result, the SLA evaluation parameter of the to-be-probed service pod is determined, including: based on the detection result, a first value and a second value are determined, the first value is a number of normal communication links, the normal communication link is a communication link between the to-be-probed service pod and the target detection object, and the detection result of the communication link is normal. The second value is a total number of communication links between the to-be-probed service pod and the target detection object. Based on a quotient of the first value and the second value, the SLA evaluation parameter of the to-be-probed service pod is determined.
[0016] In the second aspect, the present application provides a cluster container network evaluation device, which includes various functional modules for the method in the first aspect.
[0017] In the third aspect, the present application provides a computer program product, including: computer instructions; when the computer instructions run on an electronic device, the electronic device implements the method in the first aspect.
[0018] In the fourth aspect, the present application provides an electronic device, including: a processor and a memory; the memory stores instructions executable by the processor; and the processor is configured to execute the instructions, so that the electronic device implements the method in the first aspect.
[0019] In the fifth aspect, the present application provides a readable storage medium, including: software instructions; when the software instructions run in an electronic device, the electronic device implements the method in the first aspect.
[0020] The advantages of the second aspect to the fifth aspect are as described in the first aspect, and will not be described again. BRIEF DESCRIPTION OF DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.
[0022] Figure 1 A schematic diagram of a detection flow of a prior container network SLA evaluation method provided by the present application;
[0023] Figure 2A schematic diagram of an application scenario of a cluster container network evaluation method provided by an embodiment of the present application is shown in FIG. 1.
[0024] Figure 3 A flowchart of a cluster container network evaluation method provided by an embodiment of the present application is shown in FIG. 2.
[0025] Figure 4 A schematic diagram of a detection flow provided by an embodiment of the present application is shown in FIG. 3.
[0026] Figure 5 A flowchart of an SLA parameter calculation method provided by an embodiment of the present application is shown in FIG. 4.
[0027] Figure 6 A flowchart of an SLA module creation information verification method provided by an embodiment of the present application is shown in FIG. 5.
[0028] Figure 7 A flowchart of another SLA module creation information verification method provided by an embodiment of the present application is shown in FIG. 6.
[0029] Figure 8 A timing diagram of a creation information verification method provided by an embodiment of the present application is shown in FIG. 7.
[0030] Figure 9 A flowchart of a to-be-detected service pod determination method provided by an embodiment of the present application is shown in FIG. 8.
[0031] Figure 10 A schematic diagram of a cluster container network evaluation device provided by an embodiment of the present application is shown in FIG. 9.
[0032] Figure 11 A schematic diagram of an electronic device provided by an embodiment of the present application is shown in FIG. 10. DETAILED DESCRIPTION
[0033] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0034] It should be noted that the words "exemplarily" or "for example" in the embodiments of the present application are used to represent as an example, illustration or explanation. Any embodiment or design scheme described as "exemplarily" or "for example" in the embodiments of the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, the words "exemplarily" or "for example" are intended to present the relevant concept in a specific manner.
[0035] In order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, the terms "first", "second", etc. are used to distinguish the same or similar items with basically the same function and role, and those skilled in the art can understand that the terms "first", "second", etc. are not used to limit the quantity and execution order.
[0036] As described in the background, in order to cover the communication link of the container, the traditional network container SLA evaluation method selects a large range of probe targets for a service pod, and these probe targets may not be associated with the service pod, which will generate a lot of redundant probes. These redundant probes not only affect the evaluation result of the service pod container network, but also consume computing resources and network resources, causing a large network burden on the cluster network.
[0037] Exemplarily, Figure 1 A schematic diagram of a probe process of an existing container network SLA evaluation method provided by the present application is shown in FIG. 1, which includes a service node 110 and a service node 120. The service node 110 includes a service pod 112, a service pod 113, a service 114, and a probe container 111, and the service node 120 includes a service pod 122, a service pod 123, a service 124, and a probe container 121. Figure 1 Taking the probe container 111 as an example, the probe container 111 first needs to probe the service pods and services on the local service node 110 (the probing is represented by a dashed line), and then needs to probe the service node 120 and the service pods and services on the service node 120. When performing SLA evaluation, the probe container 140 in each service node 110 will probe all the service pods and services 130 in the service node 110 and report the results for SLA calculation. This method generates a large amount of invalid probes and resource waste.
[0038] Therefore, how to optimize the container network SLA evaluation method and reduce the burden on the cluster network is a problem to be solved in the current container technology field.
[0039] Based on this, the present application provides a cluster container network evaluation method, which can select objects closely related to a service pod from all objects in the cluster as probe targets according to the probe information of the service pod, thereby reducing the number of redundant probes and reducing the burden on the cluster network.
[0040] The cluster container network evaluation method provided by the present application can be applied to a control node of a kubernetes cluster, and the control node is in communication connection with a plurality of service nodes in the cluster. Specifically, as shown in FIG. 2,
[0041] Figure 2 As shown, the cluster includes a control node 210 and a plurality of service nodes 220, wherein:
[0042] The control node 210 is in communication connection with the plurality of service nodes 220, and is configured to centrally manage and coordinate resource allocation and task scheduling of each service node in the cluster, and to ensure stable operation of the cluster. Meanwhile, the control node 210 integrates data of each node, analyzes and makes decisions according to preset rules, and provides direction guidance for development of the cluster.
[0043] The control node 210 is deployed with an API Server module 230, a scheduler module 240, and an SLA module 250.
[0044] The API Server module 230 is an interface for interaction between the control node 210 and the service nodes 220, and is configured to receive and process requests of the service nodes.
[0045] The scheduler module 240 is configured to perform resource allocation and task scheduling according to real-time conditions of resources of the cluster and service demands.
[0046] The SLA module 250 is configured to obtain detection information of a to-be-detected service pod.
[0047] The SLA module 250 is further configured to select all or part of objects in the cluster as target detection objects based on the detection information.
[0048] The SLA module 250 is further configured to be in communication connection with the detection module 280, receive detection results uploaded by the detection module 280, and determine SLA evaluation parameters of the to-be-detected service pod based on the detection results.
[0049] The service nodes 220 are configured to carry and run various specific service applications, convert computing resources of the cluster into actual service, and directly provide functional support for users or other systems.
[0050] Each service node 220 is deployed with a service 260, a plurality of service pods 270, and a detection module 280.
[0051] The service 260 is configured to receive requests from the outside or other modules, process the requests according to predetermined rules and processes, and then return corresponding results. The service 260 is an interface for interaction between the service node and the outside, and a direct provider of service functions.
[0052] The service pods 270 are configured to carry specific service processes and related resources. Multiple service pods 270 can cooperate in parallel to jointly complete complex service tasks, and can realize horizontal expansion of the service by replication and expansion, thereby improving service processing capacity and reliability.
[0053] The detection module 280 is configured to detect a communication link between the to-be-detected service pod and a target detection object, obtain a detection result, and report the detection result to the SLA module.
[0054] In some embodiments, the target detection object includes a service pod, a service, and a service node.
[0055] It should be noted that the cluster can further include a plurality of control nodes 210, which are in communication connection.
[0056] As shown in Figure 3 A flowchart of a cluster container network evaluation method provided by the embodiments of the present application is shown in the figure, which can be applied to the control nodes described above. Figure 3 The method includes S301-S304.
[0057] S301, obtain detection information of a to-be-detected service pod.
[0058] The detection information includes a first service level and / or access target information of the to-be-detected service pod. The first service level is used to indicate a service level of an object in the cluster that needs to be detected, and the access target information is used to indicate an object to be accessed during the running of the to-be-detected service pod.
[0059] Specifically, the control node can obtain the detection information of the to-be-detected service pod in the cluster through the API Server module.
[0060] It should be noted that all objects in the cluster have their own service levels, which are used to indicate the importance of the service running of the cluster objects, and the service pods or services in the cluster all have corresponding access target information. The service level and the access target information can be configured when the cluster object is created, and the specific process can be referred to in the following Figure 6 and Figure 7 which will not be repeated here.
[0061] It should be further noted that the to-be-detected service pod is all or part of the service pods participating in the evaluation of the container network SLA selected from all service pods in the cluster. The specific selection process of the to-be-detected service pod can be referred to in the following Figure 9 which will not be repeated here.
[0062] In some embodiments, the probe information of the to-be-probed service pod can be stored in the service node. In this case, the service node can update the probe information of the to-be-probed service pod according to the running state of the to-be-probed service pod, and the service node can also implement a security protection policy on the probe information to protect the security of sensitive data in the probe information.
[0063] In other embodiments, the probe information of the to-be-probed service pod can also be stored in the control node. In this case, the control node can globally and uniformly manage the probe information of the service pod, which can reduce the communication request between the service node and the control node, and is also conducive to formulating a unified probe information management method to ensure the maintainability and scalability of the system.
[0064] In some embodiments, the objects in the cluster include: pods, physical nodes, or services.
[0065] A pod is a minimum deployment and management computing unit of the cluster, which can contain one or more closely related containers that share network namespaces, storage volumes, and other resources.
[0066] A physical node is an actual physical server in the cluster, which is the infrastructure for running pods. The physical node can be a traditional physical server or a cloud server.
[0067] A service is a resource object in the cluster for abstracting and exposing the network interface of a pod. It provides a unified access portal for a group of pods with the same function, and is responsible for load balancing external requests to the backend pods.
[0068] In some embodiments, the access object indicated by the access target information can include the following: pods, physical machines, services, and nothing.
[0069] Pod refers to other pods that are not to-be-probed service pods. Some to-be-probed service pods may need to access other pods to obtain some initialization information when starting.
[0070] Physical machine: During the running process of the to-be-probed service pod, it may need to access some resources on fixed physical machines.
[0071] Service: During the running process of the to-be-probed service pod, it may need to access some services such as databases and middleware.
[0072] Nothing: During the running process of the to-be-probed service pod, it does not need to access any other resources.
[0073] In some embodiments, the business level can be divided into cluster level, important level, general level and negligible level according to the importance of the pod or svc running in the cluster.
[0074] The cluster level represents the highest importance of the business level. The svc and pod of this level constitute the foundation of the entire cluster, and their stable operation is the premise of the normal operation of the cluster. Once a fault occurs, it is likely to trigger a chain reaction, causing the entire cluster to be in a paralyzed state, and all businesses relying on the cluster will be completely interrupted.
[0075] The important level mainly covers services and application instances that play a key supporting role in business availability, such as svc and pod responsible for order processing and payment settlement in e-commerce platforms. If these services have problems, they will not cause the entire cluster to collapse, but will make the corresponding business functions unable to provide normal services, seriously affecting user experience and business revenue.
[0076] The general level is the default business level, which is suitable for a large number of svc and pod that have relatively small impact on the overall operation of the cluster and the key business process, such as common log collection, resource monitoring and other basic services. Even if these services have temporary exceptions, they will not cause fatal damage to the stability of the cluster and the main business.
[0077] The negligible level is for svc and pod that are only used for testing, demonstration or have very low correlation with actual business, such as temporary test services in the development stage. Since they have almost no substantial impact on business operation, when performing network detection and other resource-consuming operations, objects of this level can be ignored to save system resources.
[0078] In other embodiments, the business level can also be divided according to the resource consumption generated by the pod or svc during operation, which can include: computing resource consumption, storage resource consumption, network resource consumption, etc.
[0079] S302, based on the detection information, selecting all or part of the objects in the cluster as target detection objects.
[0080] Specifically, the control node can select the target detection object corresponding to the to-be-detected business pod from all objects in the cluster according to one or more information contents in the detection information of the to-be-detected business pod through the SLA module.
[0081] It should be understood that, as known from the foregoing, there can be objects within the cluster that are irrelevant to the operation of the to-be-probed business pod, which can include objects that are not directly communicated with the to-be-probed business or objects that do not need to be accessed by the to-be-probed business pod. If such irrelevant objects are included in the detection range of the to-be-probed business pod, not only will the detection cost be increased, but also the evaluation result of the container network SLA of the to-be-probed business pod will be disturbed. Therefore, according to the detection information, such irrelevant objects are screened out, and objects directly related to or capable of affecting the to-be-probed business pod are obtained as target detection objects.
[0082] S303, detecting, by the detection module, a communication link between the to-be-probed business pod and the target detection object, to obtain a detection result.
[0083] Specifically, the control node sends the target detection object corresponding to the to-be-probed business pod to the detection module of the business node where the to-be-probed business pod is located through the SLA module, and then the detection module detects a communication link between the to-be-probed business pod and the target detection object to obtain a detection result.
[0084] The target detection object further includes specific access information, and the access information includes address information, port information, and a network protocol used by the target detection object.
[0085] In some embodiments, the address information of the target detection object can not exist in the form of an IP address, but in the form of a name or a label. In this case, the detection module can also send a query request to the API Server module to obtain the IP address of the target detection object.
[0086] In some embodiments, when the detection result obtained by the detection module is a failure or an unconnected state, the detection module can query the running state of the target detection object through the API Server module to confirm whether the target detection object exists. If the target detection object does not exist (for example, has been destroyed), the detection result corresponding to the target detection object is not reported.
[0087] In some embodiments, the detection module can periodically detect the target detection object, so as to obtain detection results at multiple time nodes.
[0088] In a possible implementation, after receiving the target detection object, the detection module constructs a detection identifier (for example, in the format of ip:port protocol) that can access the target detection object based on the address information, the port information, and the network protocol of the target detection object. Then, the detection module enters the network namespace of the to-be-probed business pod and detects the detection identifier to obtain a detection result.
[0089] For example, the working flow of the detection module is shown in Figure 4 , including:
[0090] S10, obtaining a target detection object.
[0091] The detection module receives the target detection object and the detection start instruction sent by the SLA module. Upon receiving the detection start instruction, the detection module constructs a detection target identifier of the target detection object based on the access information of the target detection object.
[0092] S20, entering the network namespace of the to-be-detected service node.
[0093] The detection module enters the network namespace of the to-be-detected service pod of the local service node and detects the target identifier on the to-be-detected service pod.
[0094] S30, detecting the service pod on the local service node.
[0095] If the target detection object includes the service pod on the local service node, the detection module detects other service pods on the local service node (e.g. Figure 4 , the service pod 550) and returns the detection result to the detection module.
[0096] S40, detecting other service nodes.
[0097] If the target detection object includes other service nodes (e.g. Figure 4 , the other service node 1 and the other service node 2), as well as service pods (e.g. Figure 4 , the service pod 520 and the service pod 540) and services (e.g. Figure 4 , the service 510 and the service 530) on the other service nodes, the detection module detects the service pods on the other service nodes and returns the detection result to the detection module.
[0098] S50, reporting the detection result.
[0099] The detection module reports the detection result of the above steps S30-S40 to the SLA module.
[0100] It should be understood that the target detection object of the business node is detected by the detection module on the business node, which can solve the disadvantages of establishing a detection container for detection in the traditional container network SLA evaluation method. In the traditional method, additional resource overhead is required to build a container, and the isolation of the container from the business node can cause the detection result to be biased. The detection module is directly embedded in the business node, which can detect in a manner closer to the actual operation of the business, has high real-time performance, and can reduce the error caused by the time difference between simulation and actual request.
[0101] S304, determining the SLA evaluation parameter of the to-be-detected business pod based on the detection result.
[0102] Specifically, the number of successful detection results and the total number of detection results can be calculated to obtain the container network SLA parameter of the to-be-detected business pod. The calculation process can be referred to in the following Figure 5 This will not be described here.
[0103] The cluster container network evaluation method provided by the embodiments of the present application can select objects closely related to the business pod from all objects in the cluster as detection targets based on the detection information of the business pod, thereby reducing the number of redundant detections. Moreover, the detection module is directly embedded in the business node, which can detect in a manner closer to the actual operation of the business, and reduces the resource consumption of building a business container in the traditional method. In summary, by reducing the number of redundant detections and reducing the resource consumption of building a business container, the container network evaluation method can effectively reduce the burden of the cluster network.
[0104] In some embodiments, in the case where the detection information includes a first business level, all or part of the target detection objects are selected from the cluster based on the detection information. Step S302 in the method can specifically include:
[0105] S3021, selecting objects of the first business level as target detection objects from all objects in the cluster according to the first business level.
[0106] It should be noted that the first business level can be obtained from the network detection information configured by the cluster administrator in the control node, or can be obtained from the preset network detection information. The network detection information is used to select the cluster objects participating in the container network evaluation.
[0107] In one possible implementation, the first business level can be a single business level, and the control node selects the target detection objects by comparing the size of the first business level with the business levels of all objects in the cluster.
[0108] In another possible implementation, the first service level can be a set of multiple service levels, and the control node selects the target probe object by comparing whether the service levels of all objects in the cluster are within the set of service levels.
[0109] For example, assuming that the first service level is the important level, the SLA module queries the API Server module for the set of service levels of all objects in the cluster, and compares the first service level with each service level in the set of service levels one by one, and selects the cluster object with a service level greater than or equal to the first service level as the target probe object.
[0110] For another example, assuming that the first service level is a set of multiple service levels, denoted as [general level, important level], the SLA module queries the API Server module for the set of service levels of all objects in the cluster, and determines whether the service level of each object is within the set of the first service level, and selects the cluster object with a service level of the general level or the important level as the target probe object.
[0111] In some embodiments, when the probe information includes the access target information of the to-be-probed service pod, the target probe object is selected from the cluster based on the probe information, and step S302 in the method can specifically include:
[0112] S3022, according to the access target information, selecting, from all objects of the cluster, an object to be accessed during running of the to-be-probed service pod as the target probe object.
[0113] Specifically, the access target information of the to-be-probed service pod can be a set of access targets, and the address information of each access target in the set is used as an identification mark, and the control node selects the target probe object from the objects in the cluster according to the identification marks.
[0114] In some embodiments, when the probe information includes the first service level and the access target information of the to-be-probed service pod, the target probe object is selected from the cluster based on the probe information, and step S302 in the method can specifically include:
[0115] S3023, according to the access target information and the first service level, selecting, from all objects of the cluster, an object with a service level of the first service level and to be accessed during running of the to-be-probed service pod as the target probe object.
[0116] In one possible implementation, the first service level can be compared with the service levels of the cluster objects to obtain a first screening result, and then the access target information of the to-be-probed service pod is referred to for a second screening within the first screening result, and the second screening result is obtained as the target probe object.
[0117] Another possible way, the cluster object can also be screened first with reference to the access target information of the to-be-detected service pod, to obtain a first screening result, and then the first service level is compared with the service level of the objects in the first screening result, to obtain a second screening result, and the second screening result is taken as the target detection object.
[0118] In another possible implementation, the cluster object can be screened with reference to the first service level and the access target information at the same time, and the screening result is taken as the target detection object.
[0119] For example, assuming that the detection information of a to-be-detected service pod has a first service level of important level, and the access target information includes access target 1, access target 2, and access target 3, and the service levels of these access targets are general level, important level, and cluster level respectively. First, the cluster object is screened according to the access target information of the to-be-detected service pod, to obtain a first screening result (i.e. the above-mentioned access target 1, access target 2, and access target 3). Then, in the first screening result, the objects greater than or equal to the first service level are screened out as the target detection object, i.e. access target 2 and access target 3.
[0120] In some embodiments, based on the detection result, the specific method for determining the SLA evaluation parameter of the to-be-detected service pod can calculate the ratio of the normal communication links in the detection result as the SLA evaluation parameter, in which case, as shown in Figure 5 the step S304 in the method can specifically include:
[0121] S3041, based on the detection result, determining a first value and a second value.
[0122] The first value is the number of normal communication links, and the normal communication link is a communication link between the to-be-detected service pod and the target detection object, and the detection result of which is normal. The second value is the total number of communication links between the to-be-detected service pod and the target detection object.
[0123] S3042, based on the quotient of the first value and the second value, determining the SLA evaluation parameter of the to-be-detected service pod.
[0124] It should be understood that by calculating the quotient of the first value and the second value in the detection result, the proportion of the normal communication link in the detection result is obtained, and through the proportion, the condition of the cluster container network can be intuitively understood.
[0125] In some embodiments, in steps S3041 and S3042, calculating the quotient of the first value and the second value of the detection result can intuitively represent the status of the container network of the cluster object in the detection result range. Further, the detection result can be filtered based on the service level and / or type of the specific target detection object to obtain a more fine-grained detection result, for example, the detection result of the communication link between the to-be-detected service pod and a certain type of access target, and for example, the detection result of the communication link between the to-be-detected service pod and a certain service level of the access target. By performing steps S3041-S3042 on the detection result, the status of the container network of the to-be-detected service pod and the specific target detection object can be obtained, and targeted analysis and problem optimization can be performed.
[0126] The service level and access target information of the cluster object in the method provided by the embodiments of the present application are specifically introduced below.
[0127] In some embodiments, the access target information included in the service pod detection information can be configured by the user when the user creates a new cluster object. In this case, in order to ensure that the newly created object includes the access target information, the creation information of the newly created object needs to be checked, for example, as shown in Figure 6 Before step S301, the method can further include:
[0128] S601, obtaining the creation information of the newly created object.
[0129] The newly created object includes a pod or a service.
[0130] Specifically, the control node can intercept the user's new object creation request in the API Server module, thereby obtaining the creation information of the newly created object.
[0131] S602, creating the newly created object in the case that the creation information includes the access target information of the newly created object.
[0132] S603, rejecting the creation of the newly created object in the case that the creation information does not include the access target information of the newly created object.
[0133] In some embodiments, the service level included in the service pod detection information can also be configured by the user when the user creates a new object. In this case, in order to ensure that the newly created object includes the service level of the object, the creation information of the newly created object needs to be checked, for example, as shown in Figure 7 Before step S301, the method can further include:
[0134] S701, creating the newly created object in the case that the creation information includes the service level of the newly created object.
[0135] S702, in the case that the creation information does not include a service level of the new object, a default service level is assigned to the new object and the new object is created.
[0136] In some embodiments, for the objects that already exist when the cluster is created, the control node can configure the service level for the objects.
[0137] Exemplarily, Figure 8 A timing diagram of a creation information verification method provided by an embodiment of the present application is shown in FIG. 1, which includes the following steps. Figure 8
[0138] S1, requesting default pods and services of a cluster.
[0139] The SLA module sends a request to the API Server module to obtain default pods and default services, which are objects that already exist when the cluster is initialized. The API Server receives the request and returns the default pods and default services to the SLA module.
[0140] S2, configuring a pre-set service level for the default pods and services.
[0141] The SLA module configures a pre-set service level for the default pods and services and sends the service level to the API Server module.
[0142] S3, obtaining creation information of a new object.
[0143] When the control node receives a creation request of a new object from a user, the SLA module verifies the integrity of the creation information.
[0144] S4, verifying whether the access target information exists in the creation information.
[0145] S5, if the access target information does not exist, the creation of the new object is rejected.
[0146] If the verification result indicates that the access target information does not exist, the creation is rejected and a prompt message that the access target information does not exist is returned to the user.
[0147] S6, if the access target information exists, verifying whether the access target information in the creation information is legal.
[0148] If the verification result indicates that the access target information exists, it is verified whether the content of the access target information is legal, for example, whether the format of the ip address required by the new object is correct.
[0149] S7, if the access target information is not legal, the creation of the new object is rejected.
[0150] If the verification result indicates that the target information is not legal, the creation is rejected, and a prompt message is returned to the user that the target information is not legal.
[0151] S8, if the target information is legal, check whether the service level in the creation information exists.
[0152] S9, if the service level does not exist, configure the default service level for the new object.
[0153] S10, if the service level exists or the default service level is configured, execute the object creation.
[0154] If the target information contains the service level or the SLA module has configured the default level for the target information, the SLA module checks and forwards the creation information to the API Server module to create the new object.
[0155] S11, return the creation success information.
[0156] It should be noted that steps S7 or S5 indicate that the content of the creation information is incomplete, the object creation is rejected, and a prompt message is returned to the user, so after steps S7 and S5 are executed, the subsequent steps will not be executed.
[0157] The above steps S601-603 and S701-702 can provide accurate detection targets for the subsequent detection process by standardizing the creation information of the new object, reduce unnecessary detection, and make the detection more targeted.
[0158] In some embodiments, the method for determining the to-be-detected service pod in step S301 can be as shown in the following table. Figure 9 Before step S301, the method can further include:
[0159] S901, obtain the second service level.
[0160] Specifically, the control node can obtain the second service level from the network detection information.
[0161] S902, select the pod of the second service level from all service pods in the cluster as the to-be-detected service pod.
[0162] Specifically, the control node can query the service levels of all service pods in the cluster through the API Server module, and select the service pod of the second service level as the to-be-detected service pod.
[0163] In a possible implementation, the second service level can be a single service level, and the control node selects the service pod to be probed by comparing the second service level with the service levels of all service pods in the cluster.
[0164] In another possible implementation, the second service level can be a set of multiple service levels, and the control node selects the service pod to be probed by comparing whether the service levels of all service pods in the cluster are within the set of service levels.
[0165] For example, assuming that the second service level is an important level, the SLA module queries the API Server module for the set of service levels of all service pods in the cluster, and compares the second service level with each service level in the set of service levels one by one, and selects all service pods with a service level greater than or equal to the second service level as the service pods to be probed.
[0166] For another example, assuming that the second service level is a set of multiple service levels, denoted as [general level, important level], the SLA module queries the API Server module for the set of service levels of all service pods in the cluster, and judges whether the service level of each service pod is within the set of second service levels, and selects service pods with a service level of general level or important level as the service pods to be probed.
[0167] The above mainly describes the solutions provided by the embodiments of the present application from the perspective of methods. To implement the above functions, the corresponding hardware structures and / or software modules are included. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of the examples described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is implemented in hardware or computer software driven hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0168] In an exemplary embodiment, the present application further provides a cluster container network evaluation device, as shown in Figure 10 The cluster container network evaluation device includes an acquisition module 101 and a processing module 102.
[0169] The acquisition module 101 is configured to acquire probe information of a service pod to be probed. The probe information includes a first service level and / or access target information of the service pod to be probed. The first service level is used to indicate a service level of an object in the cluster that needs to be probed, and the access target information is used to indicate an object to be accessed during running of the service pod to be probed.
[0170] The processing module 102 is configured to select all or part of the objects in the cluster as target detection objects based on the detection information.
[0171] The processing module 102 is further configured to detect, by the detection module, a communication link between the to-be-detected service pod and the target detection objects, to obtain a detection result.
[0172] The processing module 102 is further configured to determine an SLA evaluation parameter of the to-be-detected service pod based on the detection result.
[0173] In a possible implementation, the objects in the cluster include a pod, a physical node, or a service.
[0174] In another possible implementation, the processing module 102 is specifically configured to, in a case where the detection information includes a first service level, select all or part of the target detection objects from the cluster based on the detection information, including: selecting, as the target detection objects, objects of the first service level from all the objects in the cluster according to the first service level.
[0175] In another possible implementation, the processing module 102 is specifically configured to, in a case where the detection information includes access target information of the to-be-detected service pod, select all or part of the target detection objects from the cluster based on the detection information, including: selecting, as the target detection objects, objects to be accessed during running of the to-be-detected service pod from all the objects in the cluster according to the access target information.
[0176] In another possible implementation, the processing module 102 is specifically configured to, in a case where the detection information includes a first service level and access target information of the to-be-detected service pod, select all or part of the target detection objects from the cluster based on the detection information, including: selecting, as the target detection objects, objects of the first service level and to be accessed during running of the to-be-detected service pod from all the objects in the cluster according to the access target information and the first service level.
[0177] In another possible implementation, the obtaining module 101 is further configured to: obtain creation information of a newly created object, the newly created object including a pod or a service. In a case where the creation information includes access target information of the newly created object, create the newly created object. In a case where the creation information does not include the access target information of the newly created object, refuse to create the newly created object.
[0178] In another possible implementation, the obtaining module 101 is further configured to: in a case where the creation information includes a service level of the newly created object, create the newly created object. In a case where the creation information does not include the service level of the newly created object, assign a default service level to the newly created object and create the newly created object.
[0179] In another possible implementation, the method further includes: obtaining a second service level; and selecting a pod of the second service level from all service pods in the cluster as the to-be-probed service pod.
[0180] In another possible implementation, the processing module 102 is specifically configured to determine the SLA evaluation parameter of the to-be-probed service pod based on the detection result, including: determining a first value and a second value based on the detection result, the first value being a number of normal communication links, the normal communication link being a communication link between the to-be-probed service pod and the target detection object, the detection result of which is normal; the second value being a total number of communication links between the to-be-probed service pod and the target detection object; and determining the SLA evaluation parameter of the to-be-probed service pod based on a quotient of the first value and the second value.
[0181] It should be noted that, Figure 10 The division of the modules in the above is illustrative, and is only a logical function division. In actual implementation, another division manner can be used. For example, two or more functions can be integrated in one processing module. The integrated module can be implemented in the form of hardware or in the form of a software function module.
[0182] In the example embodiment, as described above, the computing device can specifically be a computer or a service, or an electronic device having a computing processing function. In this case, the embodiment of the present application further provides an electronic device, Figure 11 A schematic diagram of an electronic device provided by the embodiment of the present application is shown in FIG. 1. As shown in the figure, the electronic device includes a processor 10, a memory 20, a communication line 30, a communication interface 40, and an input / output interface 50. Figure 11
[0183] The processor 10, the memory 20, the communication interface 40, and the input / output interface 50 can be connected through the communication line 30.
[0184] The processor 10 is configured to execute instructions stored in the memory 20 to implement the cluster container network evaluation method provided in the embodiments of the present application. The processor 10 can be a CPU, a general-purpose processor, a network processor (NP), a digital signal processing (DSP), a microprocessor, a micro control unit (MCU) / single-chip microcomputer, a programmable logic device (PLD), or any combination thereof. The processor 10 can also be any other device with processing capabilities, such as a circuit, a device, or a software module, and the embodiments of the present application are not limited in this regard. In an example, the processor 10 can include one or more CPUs, such as the CPU0 and the CPU1 in FIG. 1. Figure 11 As an optional implementation, the electronic device can include multiple processors, for example, in addition to the processor 10, the electronic device can further include a processor 60 (illustrated by a dashed line in FIG. 1). Figure 11
[0185] The memory 20 is configured to store instructions. For example, the instructions can be a computer program. Alternatively, the memory 20 can be a read-only memory (ROM) or another type of static storage device that can store static information and / or instructions, or a random access memory (RAM) or another type of dynamic storage device that can store information and / or instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or another type of optical disk storage, a magneto-optical disk, a magnetic disk storage or another type of magnetic storage device, and the like, and the embodiments of the present application are not limited in this regard.
[0186] It should be noted that the memory 20 can exist independently of the processor 10, or can be integrated with the processor 10. The memory 20 can be located within the electronic device, or can be located outside the electronic device, and the embodiments of the present application are not limited in this regard.
[0187] The communication line 30 is configured to transmit information between components included in the electronic device.
[0188] The communication interface 40 is configured to communicate with other devices or other communication networks. The other communication networks can be an Ethernet, a radio access network (RAN), a wireless local area network (WLAN), or the like. The communication interface 40 can be a module, a circuit, a transceiver, or any device capable of realizing communication.
[0189] The input / output interface 50 is configured to realize the human-computer interaction between the user and the electronic device. For example, the input / output interface 50 is configured to realize the action interaction or the information interaction between the user and the electronic device.
[0190] For example, the input / output interface 50 can be a mouse, a keyboard, a display screen, or a touch display screen, or the like. The action interaction or the information interaction between the user and the electronic device can be realized through the mouse, the keyboard, the display screen, or the touch display screen, or the like.
[0191] It should be noted that, Figure 11 The structure shown in the figures does not constitute a limitation on the electronic device, and the electronic device can include more or fewer components than those shown in the figures, or a combination of some components, or a different arrangement of components. Figure 11 The electronic device can include more or fewer components than those shown in the figures, or a combination of some components, or a different arrangement of components.
[0192] In an example embodiment, the electronic device provided by the embodiments of the present application further includes a computer program product. The computer program product includes computer instructions. When the computer instructions are executed in the electronic device, the electronic device realizes the method in the foregoing method embodiments.
[0193] In an example embodiment, the electronic device provided by the embodiments of the present application further includes a computer program product. The computer program product includes computer instructions. When the computer instructions are executed in the electronic device, the electronic device realizes the method in the foregoing method embodiments. The computer readable storage medium can be a non-transitory computer readable storage medium. For example, the non-transitory computer readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, or the like.
[0194] In the above embodiments, all or part can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part can be implemented in the form of a computer program product. The computer program product includes one or more computer-executable instructions. When the computer-executable instructions are loaded and executed on a computer, all or part generates the flow or function according to the embodiments of the present application. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer-executable instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another, for example, the computer-executable instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode.
[0195] Although the present application is described herein in conjunction with various embodiments, it is understood that other variations of the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed application, from an inspection of the drawings, the disclosure, and the appended claims. The word "comprising" does not exclude other components or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. A single processor or other unit can fulfill the functions of several items recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to an advantage.
[0196] Although the present application is described herein in conjunction with specific features and embodiments thereof, it is understood that modifications and combinations can occur to those skilled in the art to which the present application pertains, within its spirit and scope. Accordingly, the description and drawings are to be regarded as illustrative in nature and are not to be regarded as limiting the scope of the application as defined in the appended claims. Obviously, various modifications and changes are possible in the present application without departing from the spirit and scope of the application. Accordingly, it is intended that all such modifications and changes be included in the scope of the application as patended herein. The scope of the application is to be limited only by the claims.
[0197] The above merely provides specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any change or replacement within the technical scope disclosed in the present application should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for evaluating a cluster container network, characterized in that, The method is applied to a management node in a cluster, wherein a service level agreement (SLA) module is arranged in the management node, and the cluster further includes a service node, wherein a detection module is arranged in the service node, and the SLA module is in communication connection with the detection module; The method includes: obtaining detection information of a to-be-detected service pod; the detection information includes a first service level and / or access target information of the to-be-detected service pod; the first service level is used to indicate a service level of an object that needs to be detected in the cluster; and the access target information is used to indicate an object to be accessed during running of the to-be-detected service pod; based on the detection information, selecting all or part of objects in the cluster as target detection objects; detecting, by the detection module, a communication link between the to-be-detected service pod and the target detection objects to obtain a detection result; based on the detection result, determining an SLA evaluation parameter of the to-be-detected service pod.
2. The method of claim 1, wherein, The objects in the cluster include a pod, a physical node, or a service.
3. The method of claim 1, wherein, The detection information includes the first service level; and based on the detection information, selecting all or part of target detection objects from the cluster includes: selecting, according to the first service level, objects of the first service level from all objects in the cluster as the target detection objects.
4. The method of claim 1, wherein, The detection information includes the access target information of the to-be-detected service pod; and based on the detection information, selecting all or part of target detection objects from the cluster includes: selecting, according to the access target information, objects to be accessed during running of the to-be-detected service pod from all objects in the cluster as the target detection objects.
5. The method of claim 1, wherein, The detection information includes the first service level and the access target information of the to-be-detected service pod; and based on the detection information, selecting all or part of target detection objects from the cluster includes: selecting, according to the access target information and the first service level, objects to be accessed during running of the to-be-detected service pod and having the first service level from all objects in the cluster as the target detection objects.
6. The method of claim 1, wherein, The method further includes: obtaining creation information of a newly created object; the newly created object includes a pod or a service; in a case where the creation information includes access target information of the newly created object, creating the newly created object; in a case where the creation information does not include the access target information of the newly created object, refusing to create the newly created object.
7. The method of claim 6, wherein, The method further includes: in a case where the creation information includes a service level of the newly created object, creating the newly created object; in a case where the creation information does not include the service level of the newly created object, assigning a default service level to the newly created object and creating the newly created object.
8. The method according to any one of claims 1 to 7, characterized in that, The method further includes: obtaining a second service level; selecting, from all service pods in the cluster, a pod of the second service level as the to-be-detected service pod.
9. The method according to any one of claims 1 to 7, characterized in that, The SLA evaluation parameter of the to-be-detected service pod is determined based on the detection result, including: Based on the detection result, a first value and a second value are determined; the first value is the number of normal communication links; the normal communication link is a communication link between the to-be-detected service pod and the target detection object; the second value is the total number of communication links between the to-be-detected service pod and the target detection object; Based on the quotient of the first value and the second value, the SLA evaluation parameter of the to-be-detected service pod is determined.
10. A cluster container network evaluation apparatus characterized by comprising: The cluster container network evaluation device is applied to a management node in a cluster, and a service level agreement (SLA) module is arranged in the management node. The cluster also includes a service node, and a detection module is arranged in the service node. The SLA module and the detection module are in communication connection. The cluster container network evaluation device includes an acquisition module and a processing module. The acquisition module is used to acquire detection information of a to-be-detected service pod. The detection information includes a first service level and / or access target information of the to-be-detected service pod. The first service level is used to indicate the service level of an object in the cluster that needs to be detected. The access target information is used to indicate an object to be accessed during the running of the to-be-detected service pod. The processing module is used to select all or part of objects in the cluster as target detection objects based on the detection information. The processing module is also used to detect a communication link between the to-be-detected service pod and the target detection object by the detection module to obtain a detection result. The processing module is also used to determine an SLA evaluation parameter of the to-be-detected service pod based on the detection result.
11. An electronic device, comprising: It includes: A processor and a memory; The memory stores instructions executable by the processor; The processor is configured to execute the instructions, so that the electronic device implements the method of any one of claims 1-9.
12. A readable storage medium, characterized by, It includes: Software instructions; When the software instructions run in an electronic device, the electronic device implements the method of any one of claims 1-9.
13. A computer program product, characterised in that, It includes: Computer instructions; When the computer instructions run in an electronic device, the electronic device implements the method of any one of claims 1-9.
Citation Information
Patent Citations
Node fault processing method and device, equipment, medium and program product
CN114942859A
Service level target management method and system, electronic equipment and storage medium
CN116668543A