Cloud cluster network resource recovery method, product, equipment and medium

Through the collaborative work of the cloud management platform and network resource cleaning components, the network resources of the K8s cluster are accurately scanned and recycled, and the resource residue problem caused by asynchronous communication between K8s and IAAS layer is solved, and the automation and intelligence level of resource management is improved.

CN120583154AActive Publication Date: 2025-09-02JINAN INSPUR DATA TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511030679.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-25
Publication Date
2025-09-02
Estimated Expiration
2045-07-25

AI Technical Summary

Technical Problem

In the prior art, the network resource recycling efficiency of the K8s cluster and the IAAS layer is low and easy to miss, resulting in resource residues and affecting system stability and resource scheduling.

Method used

Through the network resource recycling component of the cloud management platform, scan the cluster node network information table, establish a node network resource list, and use the network resource cleaning component to recycle abnormal port resources, combine the ConfigMap configuration file to obtain the target cluster identification, build an abnormal port resource list, traverse and recycle network port resources without corresponding containers.

Benefits of technology

It realizes accurate scanning and recycling of network resources, avoids resource residues, improves network resource utilization, ensures the consistency of the cloud cluster and the IAAS layer network resource status, and reduces manual operation and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120583154A_ABST
    Figure CN120583154A_ABST
Patent Text Reader

Abstract

The invention discloses an on-cloud cluster network resource recovery method, a product, equipment and a medium, and relates to the technical field of cloud computing, and the method comprises the steps: scanning a cluster node network information table through a network resource recovery assembly in a cloud management platform, establishing a node network resource list corresponding to each cluster node according to the obtained network resource information associated with each cluster node in the cloud server; recovering target network port resources of each cluster node in the node network resource detail table, and updating the two tables; obtaining a target cluster identifier from a ConfigMap configuration file of the cloud cluster; and constructing a network port resource list of which the network port state is abnormal based on the target cluster identifier, and utilizing a network resource cleaning component in the cloud cluster to recycle target network port resources without corresponding containers in the network port resources in the list. The efficiency of resource recovery of the cloud cluster network is improved, and the consistency of resource recovery is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud computing technology, and in particular to methods, products, equipment, and media for recovering cluster network resources on a cloud. Background Art

[0002] In cloud computing environments, resource recycling is crucial for improving resource utilization, reducing operating costs, and ensuring system stability. Ineffectively occupied computing, storage, and network resources not only waste resources but also degrade system performance and increase management complexity. Currently, network resource recycling in Kubernetes clusters and Infrastructure as a Service (IAAS) layers is primarily achieved through manual cleanup or simple scheduled tasks. Manual cleanup relies on regular inspections and operations by operations and maintenance personnel, which is inefficient and prone to omissions. While scheduled tasks can automatically delete expired resources, asynchronous communication and multi-module coordination delays between Kubernetes and IAAS often lead to resource retention issues. For example, when a cluster is deleted or a node is scaled down, only Kubernetes resources are deleted while the corresponding network ports at the IAAS layer are not simultaneously cleaned up. This results in ineffective use of resources such as IP addresses and virtual network cards. Furthermore, the status of these remaining resources can lead to inconsistencies between the Software Defined Network (SDN) controller and the Kubernetes cluster, impacting subsequent resource scheduling and service deployment.

[0003] It can be seen that how to improve the efficiency of cloud cluster network resource recovery and ensure the consistency of resource recovery is a problem that technical personnel in this field need to solve. Summary of the Invention

[0004] The purpose of the embodiments of the present invention is to provide a method, apparatus, device, and medium for recovering network resources in a cloud cluster, thereby improving the efficiency of recovering network resources in a cloud cluster and ensuring the consistency of resource recovery. The specific solution is as follows: In a first aspect, the present invention discloses a method for recovering network resources of a cloud cluster, comprising: Utilize the network resource recovery component in the cloud management platform to scan the cluster node network information table to obtain network resource information associated with each cluster node in the cloud server; wherein the cluster node network information table is constructed based on resource recovery events in the cloud management platform; Establishing a node network resource detailed table corresponding to each of the cluster nodes based on the network resource information; Reclaiming the first target network port resource of each cluster node in the node network resource detail table, and updating the node network resource detail table and the cluster node network information table; Get the target cluster ID from the ConfigMap configuration file of the cloud cluster; Building a list of network port resources with abnormal network port status based on the target cluster identifier; Traverse each network port resource in the network port resource list, and use the network resource cleaning component in the cloud cluster to reclaim the second target network port resource in each network port resource; wherein, the second target network port resource is a network port resource for which there is no corresponding container.

[0005] Optionally, the cloud management platform is deployed with multiple network resource recovery components; and the step of using the network resource recovery components in the cloud management platform to scan the cluster node network information table includes: Determining the roles of each of the network resource recovery components based on a distributed renewal lock preemption mechanism; wherein the roles include a primary role and a backup role; Determine the network resource recovery component having the primary role as the network resource recovery main component; The network resource recovery main component is used to scan the cluster node network information table.

[0006] Optionally, the method for recovering network resources of a cluster on the cloud further includes: Determine the network resource recovery component having a backup role as a network resource recovery backup component; Controlling the network resource recovery standby component to monitor the status of the network resource recovery main component; When the state of the network resource recovery main component is abnormal, a new network resource recovery main component is determined from the network resource recovery backup components based on the distributed renewal lock preemption mechanism.

[0007] Optionally, the establishing, based on the network resource information, a node network resource list corresponding to each of the cluster nodes, includes: Based on the network resource information, and using the asynchronous thread of the network resource recovery main component, a node network resource detailed table corresponding to each of the cluster nodes is established; Accordingly, the reclaiming of the first target network port resource of each cluster node in the node network resource list includes: The first target network port resource of each cluster node in the node network resource list is recycled using the asynchronous thread of the network resource recycling main component.

[0008] Optionally, building a cluster node network information table based on resource recovery events in the cloud management platform includes: Control the network resource recovery main component to monitor whether there is a resource recovery event in the cloud management platform based on the List / Watch mechanism; wherein the resource recovery event is a cloud cluster deletion event or a cluster node reduction event; If the resource recovery event occurs, the network resource recovery main component is controlled to construct a cluster node network information table based on the resource recovery event in the cloud management platform.

[0009] Optionally, the controlling the network resource recycling main component to construct a cluster node network information table based on resource recycling events in the cloud management platform includes: Controlling the network resource recycling main component to parse the resource recycling event to obtain event data; wherein the event data includes the cloud cluster identifier in the resource recycling event, the subnet identifier where the cluster node in the cloud cluster is located, the cluster node name, and the cluster node address; A cluster node network information table is constructed with the cluster node name and the cluster node address as a composite primary key, and the cloud cluster identifier and the subnet identifier as auxiliary index fields.

[0010] Optionally, the method of using a network resource recovery component in a cloud management platform to scan a cluster node network information table to obtain network resource information associated with each cluster node in a cloud server includes: Use the network resource recovery component in the cloud management platform to scan the cluster node network information table; If the cluster node network information table is not empty, the application programming interface of the software-defined network in the IAAS layer is called based on the cloud cluster identifier and subnet identifier in the cluster node network information table to obtain the network resource information associated with each cluster node in the cloud server.

[0011] Optionally, the network resource information includes the network port identifier and network port address of each cluster node, the primary key of the node network resource details table is the network port identifier, the auxiliary index fields of the node network resource details table are the root port and network port address, and the root port is the cluster node name and cluster node address. Optionally, the constructing a list of network port resources with abnormal network port status based on the target cluster identifier includes: The target cluster identifier and the abnormal network port status are used as key fields, and the application programming interface of the software-defined network in the IAAS layer is called to obtain each network port resource with an abnormal network port status in the cloud cluster corresponding to the target cluster identifier; A network port resource list is constructed, including each network port resource having an abnormal network port status.

[0012] Optionally, traversing each network port resource in the network port resource list and using a network resource cleanup component in the cloud cluster to reclaim a second target network port resource in each network port resource includes: Determine the current network port resource from the network port resource list; Parsing the application space and container name of the current network port resource; Calling the application programming interface of the cloud cluster with the application space and the container name as key fields, and determining whether there is a container corresponding to the current network port resource in the cloud cluster; If there is no container corresponding to the current network port resource, determining that the current network port resource is the second target network port resource, and using the network resource cleaning component in the cloud cluster to reclaim the current network port resource; Determine the next network port resource from the network port resource list, update the next network port resource to the current network port resource, and then jump back to the step of parsing the application space and container name of the current network port resource until all network port resources in the network port resource list are traversed.

[0013] Optionally, the utilizing the network resource cleanup component in the cloud cluster to reclaim the current network port resources includes: The network resource cleaning component in the cloud cluster is used to call the application programming interface of the software-defined network in the IAAS layer to reclaim the current network port resources.

[0014] Optionally, before obtaining the target cluster identifier from the ConfigMap configuration file of the cloud cluster, the following steps may also be included: Loading the authorization configuration file to obtain first authentication information and second authentication information; wherein the first authentication information is the authentication information required to access the application programming interface of the cloud cluster, and the second authentication information is the authentication information required to access the application programming interface of the software-defined network in the IAAS layer; The first authentication information and the second authentication information are used to establish a long connection between the application programming interface of the cloud cluster and the application programming interface of the software-defined network in the IAAS layer.

[0015] In a second aspect, the present invention discloses a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the aforementioned disclosed method for recovering cloud cluster network resources.

[0016] In a third aspect, the present invention discloses an electronic device, comprising: Memory, used to store computer programs; A processor is used to execute a computer program to implement the steps of the aforementioned disclosed method for recovering cluster network resources on the cloud.

[0017] In a fourth aspect, the present invention discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed method for recovering cluster network resources on the cloud are implemented.

[0018] It can be seen that the present invention uses the network resource recovery component in the cloud management platform to scan the cluster node network information table to obtain the network resource information associated with each cluster node in the cloud server; wherein, the cluster node network information table is constructed based on the resource recovery event in the cloud management platform; based on the network resource information, a node network resource details table corresponding to each cluster node is established; the first target network port resources of each cluster node in the node network resource details table are recovered, and the node network resource details table and the cluster node network information table are updated; the target cluster identifier is obtained from the ConfigMap configuration file of the cloud cluster; based on the target cluster identifier, a list of network port resources with abnormal network port status is constructed; each network port resource in the network port resource list is traversed, and the network resource cleaning component in the cloud cluster is used to recycle the second target network port resource in each network port resource; wherein, the second target network port resource is a network port resource for which no corresponding container exists.

[0019] The beneficial effects are as follows: the present invention realizes accurate scanning and recycling of network resources through the collaborative work of the network resource recycling component of the cloud management platform and the network resource cleaning component of the cloud cluster, and utilizes the construction and update of the cluster node network information table and the node network resource detailed table, thereby avoiding the problem of residual resources. On the one hand, based on the resource recovery event, the cluster node network information table is constructed and the network resource information is obtained, which can quickly locate the resources to be recycled; the node network resource detailed table is established to provide a detailed basis for resource recovery, ensure the accuracy and comprehensiveness of the recovery operation, and the recovery of the first target network port resource and the update of the table realize the timely cleanup and status synchronization of existing resources. On the other hand, the target cluster identifier is obtained from the ConfigMap configuration file, and then the abnormal network port resource list is constructed, the abnormal resource range is accurately locked, and the second target network port resource that does not have a corresponding container is recovered by traversing the network port resource list, thereby avoiding invalid resource occupation, improving network resource utilization, ensuring the consistency of the network resource status of the cloud cluster and the IAAS layer, effectively solving the problem of residual network resources caused by asynchronous communication and multi-module collaboration, reducing manual operation and maintenance costs, and improving the automation and intelligence level of network resource management in the cloud computing environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present invention, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0021] Figure 1 A flow chart of a method for recovering network resources from a cloud cluster provided by an embodiment of the present invention; Figure 2 A schematic diagram of a specific cloud cluster architecture provided by an embodiment of the present invention; Figure 3 A specific network resource tree diagram provided by an embodiment of the present invention; Figure 4 A schematic diagram of a specific component deployment provided by an embodiment of the present invention; Figure 5 A schematic diagram of a specific network resource recovery component processing flow provided by an embodiment of the present invention; Figure 6 A specific index relationship diagram provided by an embodiment of the present invention; Figure 7 A schematic diagram of a specific network resource cleanup component processing flow provided by an embodiment of the present invention; Figure 8 A flowchart of a specific method for recovering network resources from a cloud cluster provided by an embodiment of the present invention; Figure 9 A schematic diagram of the structure of a cloud cluster network resource recovery device provided by an embodiment of the present invention; Figure 10 A structural diagram of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0022] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.

[0023] In a cloud computing environment, resource recycling is crucial to improving resource utilization, reducing operating costs, and ensuring system stability. Ineffectively occupied computing, storage, and network resources not only cause waste, but also lead to decreased system performance and increased management complexity. Currently, network resource recycling in the K8s cluster and IAAS layer is mainly achieved through manual cleanup or simple scheduled tasks. Manual cleanup relies on regular inspections and operations by operation and maintenance personnel, which is inefficient and prone to omissions. Although scheduled tasks can automatically delete expired resources, due to asynchronous communication and multi-module coordination delays between the K8s and IAAS layers, resource residue problems often occur. For example, when a cluster is deleted or a node is scaled down, only the resources at the K8s layer are deleted, and the corresponding network ports at the IAAS layer are not cleaned up simultaneously, resulting in invalid occupation of resources such as IP addresses and virtual network cards. The status information of the residual resources will cause inconsistencies between the SDN controller and the K8s cluster status, affecting subsequent resource scheduling and business deployment.

[0024] The terms "including" and "having," as used in the present description and accompanying drawings, and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements and may include steps or elements that are not listed.

[0025] In order to enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0026] Next, a cloud cluster network resource recovery solution provided by an embodiment of the present invention is introduced in detail. Figure 1 A method for recovering network resources of a cloud cluster provided by an embodiment of the present invention includes: Step S11: Use the network resource recovery component in the cloud management platform to scan the cluster node network information table to obtain network resource information associated with each cluster node in the cloud server; wherein, the cluster node network information table is constructed based on resource recovery events in the cloud management platform.

[0027] For example Figure 2 The diagram of a specific cloud cluster architecture shown in the figure includes a cloud management platform (i.e., cloud management platform), cloud cluster, IAAS layer, etc. The network of the K8s cluster on the cloud has the following characteristics: 1) The nodes, containers, load balancing and other network resources of the K8s cluster on the cloud are actually managed by the IAAS layer SDN; 2) K8s cluster management and cloud network resource management adopt a distributed and asynchronous working mode; 3) In order to improve the container deployment density of the node and the utilization of network resources, network card virtualization technology (such as Vlan sub-interface, MacVlan, etc.) is usually used. For example Figure 3The figure shows a specific network resource tree diagram. Each cluster node has multiple network ports. Given the network characteristics of the K8s cluster on the cloud, the network resource management of the cluster on the cloud may have the following problems: 1) Since the K8s cluster management, cloud host management, and network resource management modules are distributed and work asynchronously, for example, when deleting the K8s cluster on the cloud, the K8s cluster may be deleted but the IAAS layer network resources may remain due to an abnormality in the network resource management module; 2) The network resources of the K8s cluster on the cloud are in a cascade relationship. A node can form a network resource tree. If only the root network resource is deleted, the index relationship of the leaf network resources will be lost, resulting in residual network resources.

[0028] In this embodiment, multiple network resource recovery components are deployed in the cloud management platform; the use of the network resource recovery component in the cloud management platform to scan the network information table of the cluster node includes: determining the role of each of the network resource recovery components based on a distributed renewal lock preemption mechanism; wherein the roles include a main role and a backup role; determining the network resource recovery component with the main role as the network resource recovery main component; and using the network resource recovery main component to scan the network information table of the cluster node.

[0029] For example Figure 4 The figure shows a specific component deployment diagram. Multiple network resource recovery components are deployed in the cloud management platform. The configuration of the API service is obtained, and data is loaded to complete the initialization of these network resource recovery components. By preempting the K8s distributed renewal lock, the network resource recovery component multi-copy master selection is realized. That is, based on the distributed renewal lock preemption mechanism, the role of each network resource recovery component is determined to be the main role or the backup role, and the network resource recovery component with the main role is determined as the network resource recovery master component; the network resource recovery master component is used to scan the network information table of the cluster node. It should be noted that the number of network resource recovery master components is 1.

[0030] In this embodiment, it also includes: determining the network resource recovery component with a backup role as a network resource recovery backup component; controlling the network resource recovery backup component to monitor the status of the network resource recovery main component; when the status of the network resource recovery main component is an abnormal state, determining a new network resource recovery main component from each of the network resource recovery backup components based on the distributed renewal lock preemption mechanism.

[0031] It can be understood that other network resource recovery components that are not the network resource recovery main components are network resource recovery backup components, that is, the network resource recovery component that plays the role of a backup role is determined as the network resource recovery backup component. The backup role monitors the status of the main role. If the status of the main role is abnormal, it preempts the main role. In other words, the network resource recovery backup component monitors the status of the network resource recovery main component; when the status of the network resource recovery main component is abnormal, a new network resource recovery main component is determined from each network resource recovery backup component based on the distributed renewal lock preemption mechanism. In this way, the network resource recovery process is guaranteed to be executed normally.

[0032] In this embodiment, a cluster node network information table is constructed based on resource recovery events in the cloud management platform, including: controlling the network resource recovery main component to monitor whether there is a resource recovery event in the cloud management platform based on the List / Watch mechanism; wherein, the resource recovery event is a cloud cluster deletion event or a cluster node shrinking event; if the resource recovery event exists, then controlling the network resource recovery main component to construct a cluster node network information table based on the resource recovery event in the cloud management platform. When a cloud cluster is deleted or a cluster node is shrunk through the cloud management platform, a cloud cluster deletion event or a cluster node shrinking event is generated in the cloud management platform. When the network resource recovery main component monitors the cloud cluster deletion event or the cluster node shrinking event based on the List / Watch mechanism, then the network resource recovery main component constructs a cluster node network information table based on the resource recovery event in the cloud management platform.

[0033] In this embodiment, the control of the network resource recovery main component constructs a cluster node network information table based on the resource recovery event in the cloud management platform, including: controlling the network resource recovery main component to parse the resource recovery event to obtain event data; wherein, the event data includes the cloud cluster identifier in the resource recovery event, the subnet identifier where the cluster node in the cloud cluster is located, the cluster node name and the cluster node address; constructing a cluster node network information table with the cluster node name and the cluster node address as a composite primary key, and the cloud cluster identifier and the subnet identifier as auxiliary index fields respectively.

[0034] When the network resource recycling main component obtains a resource recycling event, it parses the resource recycling event to obtain event data. Specifically, it obtains the cloud cluster identifier ClusterID, the subnet identifier SubnetID where the cluster node in the cloud cluster is located, the cluster node name NodeName, and the cluster node address NodeIP, and constructs the cluster node network information table clusterDatabase. The composite primary key of the cluster node network information table is the cluster node name and the cluster node address, and the auxiliary index fields are the subnet identifier and the cloud cluster identifier, as shown in Table 1: Table 1 Cluster node network information table

[0035] Use the network resource recovery component in the cloud management platform to periodically scan the cluster node network information table. If there is no data in the cluster node network information table, exit the network resource recovery process. If there is data in the cluster node network information table, call the IAAS layer SDN API with the SubnetID and NodeIP in the cluster node network information table as parameters to obtain the network resource information associated with each cluster node in the cloud server. Specifically, when SubnetID1 and NodeIP1 are used as parameters, the network resource information associated with NodeIP1 is obtained, and when SubnetID2 and NodeIP2 are used as parameters, the network resource information associated with NodeIP2 is obtained.

[0036] Step S12: establishing a node network resource list corresponding to each of the cluster nodes based on the network resource information.

[0037] In this embodiment, the node network resource details table corresponding to each of the cluster nodes is established based on the network resource information, including: based on the network resource information, and using the asynchronous thread of the network resource recovery main component to establish a node network resource details table corresponding to each of the cluster nodes.

[0038] For example Figure 5 The diagram shows a specific network resource recovery component processing flow chart, which starts an asynchronous thread, establishes a node network resource detail table networkDatabase corresponding to each cluster node based on network resource information and using the asynchronous thread of the network resource recovery main component, that is, stores the obtained network resource information in the node network resource detail table.

[0039] In this embodiment, the network resource information includes the network port identifier and network port address of each cluster node. The primary key of the node network resource details table is the network port identifier. The auxiliary index fields of the node network resource details table are the root port and network port address, respectively. The root port is the cluster node name and cluster node address.

[0040] The network resource information includes the network port identifier portID and the network port address portIP of each cluster node. It is understandable that since each cluster node includes multiple network ports, it is necessary to obtain the network port identifier portID and the network port address portIP of each cluster node. Figure 6As shown in the figure, the primary key of the node network resource details table is the network port identifier portID, and the auxiliary index fields of the node network resource details table are the root port parentPort and the network port address portIP. The root port is the cluster node name ClusterID and the cluster node address NodeName. Each cloud cluster forms a cluster cluster, each cloud cluster includes multiple cluster nodes, and each cluster includes multiple network ports.

[0041] Step S13: reclaiming the first target network port resource of each cluster node in the node network resource detail table, and updating the node network resource detail table and the cluster node network information table.

[0042] In this embodiment, the recycling of the first target network port resources of each cluster node in the node network resource details table includes: utilizing the asynchronous thread of the network resource recycling main component to recycle the first target network port resources of each cluster node in the node network resource details table.

[0043] The asynchronous thread of the network resource recovery main component scans the first target network port in the node network resource details table to recycle the first target network port resources corresponding to the first target network port, and calls the SDN API interface to delete the network port resources. In order to solve the problems of occasional network disconnection and call exception that may exist when calling the SDN API, a retry and time avoidance mechanism is adopted to improve the robustness of the API interface call, that is, based on the retry and time avoidance mechanism, and using the asynchronous thread of the network resource recovery main component to call the SDN API interface to recycle the first target network port resources of each cluster node in the node network resource details table. Specifically, if the call to the SDN API to delete the port is successful, the first target network port resources in the node network resource details table are deleted synchronously. If the deletion of the first target network port resources fails, the data in the node network resource details table is retained, and the deletion operation is continued in the next cycle. If all the network resources associated with the cluster node are deleted successfully, the associated data in the cluster node network information table is deleted, that is, the node network resource details table and the cluster node network information table are updated. For example, the cluster node network information table records cluster nodes A and B, wherein node network resource details tables 1 and 2 correspond to the network port resources of cluster nodes A and B respectively, wherein node network resource details table 1 includes network ports A1, A2, and A3 under cluster node A, and node network resource details table 2 includes network ports B1 and B2 under cluster node B. Among them, if the network port resources corresponding to network ports A1, A2, and A3 in node network resource details table 1 are all recycled, then cluster node A is directly deleted from the cluster node network information table. If network port B1 in node network resource details table 2 is recycled, but network port B2 is not recycled, cluster node B still needs to be retained in the cluster node network information table.

[0044] Step S14: Obtain the target cluster identifier from the ConfigMap configuration file of the cloud cluster.

[0045] In this embodiment, before obtaining the target cluster identifier from the ConfigMap configuration file of the cloud cluster, it also includes: loading the authorization configuration file to obtain first authentication information and second authentication information; wherein, the first authentication information is the authentication information required for accessing the application programming interface of the cloud cluster, and the second authentication information is the authentication information required for accessing the application programming interface of the software-defined network in the IAAS layer; using the first authentication information and the second authentication information to establish a long connection between the application programming interface of the cloud cluster and the application programming interface of the software-defined network in the IAAS layer.

[0046] First, initialize the network resource cleanup component in the cloud cluster. Load the authorization configuration file to obtain two-dimensional authentication information and establish a long connection. The specific process is: first, parse the first authentication information required to access the cloud cluster (K8s) API from the authorization configuration file, including the K8s API Server address, CA certificate data, Bearer Token or client certificate private key, which is used to verify the client and server identities and authorized operation permissions; at the same time, obtain the second authentication information for accessing the IAAS layer SDN controller API, such as the SDN controller URL, user name / password or API key, which is used to connect to the underlying network device; then establish a long connection with the K8s API Server based on the first authentication information, verify the server certificate through TLS (Transport Layer Security) handshake, use Token to complete RBAC authorization, and establish a persistent WebSocket channel to subscribe to resource change events such as Pod / Service; establish a long connection with the SDN controller based on the second authentication information, and pass the authentication Token or Basic Auth obtains operation permissions and maintains HTTP / 2 persistent connections to execute network configuration instructions in real time. The two persistent connections respectively carry bidirectional communication between the control plane (K8s resources) and the data plane (SDN network), ensuring the synchronization of cluster status and network configuration, and realizing collaborative management of cross-layer resources.

[0047] Next, obtain the target cluster identifier (ClusterID) from the on-premises cluster's ConfigMap configuration file. The ConfigMap configuration file is a resource object used by on-premises clusters to store non-confidential configuration data. It decouples configuration information from container applications and stores configuration data such as the target cluster identifier required to access the on-premises cluster in the form of key-value pairs. This data is then read and used by applications at runtime, enabling centralized configuration management and dynamic updates.

[0048] Step S15: constructing a list of network port resources with abnormal network port status based on the target cluster identifier.

[0049] In this embodiment, the construction of a list of network port resources with abnormal network port status based on the target cluster identifier includes: taking the target cluster identifier and the abnormal network port status as key fields, and calling the application programming interface of the software-defined network in the IAAS layer to obtain each network port resource with abnormal network port status in the cloud cluster corresponding to the target cluster identifier; and constructing a list of network port resources including each network port resource with abnormal network port status.

[0050] Start a scheduled task to periodically scan the garbage resources in the current cluster. Specifically, use the target cluster identifier and the abnormal state of the network port as key fields. That is, use the cluster ClusterID+Port_Status:DOWN as the key field to call the application programming interface of the software-defined network in the IAAS layer to obtain the network port resources with abnormal network port status in the cloud cluster corresponding to the target cluster identifier, thereby constructing a network port resource list PortList containing the network port resources with abnormal network port status. Among them, the application programming interface of the software-defined network in the IAAS layer is called based on the retry and time avoidance mechanism to obtain the network port resources with abnormal network port status in the cloud cluster corresponding to the target cluster identifier. That is, if the call to the application programming interface of the software-defined network in the IAAS layer fails, then exit the current processing flow and wait for the next cycle to arrive, so as to call the application programming interface of the software-defined network in the IAAS layer in the next cycle.

[0051] Step S16: traverse each network port resource in the network port resource list, and use the network resource cleaning component in the cloud cluster to recycle the second target network port resource in each network port resource; wherein, the second target network port resource is a network port resource for which there is no corresponding container.

[0052] In this embodiment, traversing each network port resource in the network port resource list and using the network resource cleaning component in the cloud cluster to recycle the second target network port resource in each network port resource includes: determining the current network port resource from the network port resource list; parsing the application space and container name of the current network port resource; calling the application programming interface of the cloud cluster with the application space and the container name as key fields, and judging whether there is a container corresponding to the current network port resource in the cloud cluster; if there is no container corresponding to the current network port resource, determining the current network port resource as the second target network port resource, and using the network resource cleaning component in the cloud cluster to recycle the current network port resource; determining the next network port resource from the network port resource list, and updating the next network port resource to the current network port resource, and then jumping back to the step of parsing the application space and container name of the current network port resource, until all network port resources in the network port resource list are traversed.

[0053] For example Figure 7The diagram shows a specific network resource cleaning component processing flow, which traverses each network port resource in the network port resource list and parses the application space namespace and container name podName of the current network port resource. The application programming interface of the cloud cluster is called with the application space and container name as key fields to determine whether the Pod resource exists, that is, whether there is a container corresponding to the current network port resource in the cloud cluster. If the Pod resource exists, it indicates that the Port resource is not a garbage resource, and the above steps are performed on the next network port resource. If the Pod resource does not exist, it indicates that the Port resource is a garbage resource, and the Port network resource is deleted. Specifically, if there is no container corresponding to the current network port resource, the current network port resource is determined to be the second target network port resource, and the network resource cleaning component in the cloud cluster is used to recycle the current network port resource, determine the next network port resource from the network port resource list, and update the next network port resource to the current network port resource, and then jump to the step of parsing the application space and container name of the current network port resource again until all network port resources in the network port resource list are traversed, that is, whether each network port resource in the network port resource list is a garbage resource is determined in turn. If so, the network port resource needs to be recycled.

[0054] In this embodiment, the use of the network resource cleaning component in the cloud cluster to reclaim the current network port resources includes: using the network resource cleaning component in the cloud cluster to call the application programming interface of the software-defined network in the IAAS layer to reclaim the current network port resources.

[0055] If the current network port resource is the second target network port resource, the network resource cleanup component in the cloud cluster is used to call the application programming interface of the software-defined network in the IAAS layer to recycle the current network port resource. The network resource recovery component of the cloud management platform can solve the problem of residual network resources when deleting a cloud cluster or scaling down a node. However, the problem of residual network resources that may occur in scenarios such as container creation and deletion requires the use of the network resource cleanup component in the cloud cluster (i.e., the NetworkGC module) to solve it. The network resource cleanup component provides the self-cleaning capability of the network resources of the K8s cluster.

[0056] Furthermore, before recovering network resources in a cloud cluster, you need to deploy multiple network resource recovery components on the cloud management platform and a single network resource cleanup component in the cloud cluster. Specifically, build container images for the network resource recovery component and the network resource cleanup component on the cloud management platform. Deploy the network resource recovery component on the cloud management platform using multiple replicas and check whether the containers are running normally. Deploy the network resource cleanup component on the cloud ICKS (i.e., InCloud K8S) cluster using a single replica and check whether the containers are running normally. Scale down the cluster on the cloud management platform, check the logs of the network resource module on the cloud management platform to see if node scaling events are received, and perform resource cleanup. Delete the cloud K8s cluster on the cloud management platform, check the logs of the network resource module on the cloud management platform to see if cluster deletion events are received, and perform resource cleanup. Use the cloud management platform to check whether any network resources are remaining.

[0057] This embodiment also includes: obtaining recycling record data from the network resource recycling log in the cloud management platform, preprocessing the recycling record data to obtain preprocessed data, and extracting resource features, time features, and business features from the preprocessed data. Based on the resource features, time features, and business features, a business network profile is constructed. If it is determined based on the business network profile that the current network resource recycling result meets the preset inefficiency pattern, a root cause report is generated indicating that the current network resource recycling result meets the preset inefficiency pattern, so that the user can perform repairs based on the root cause report. Multi-source feature integration ensures comprehensive and accurate analysis, and feature engineering and modeling achieve a quantitative description of resource usage patterns, accurately locating the root causes of inefficiencies, improving operation and maintenance efficiency through repairs, providing data support for network resource optimization, changing passive recycling to active governance, and improving resource utilization.

[0058] It can be seen that the present invention uses the network resource recovery component in the cloud management platform to scan the cluster node network information table to obtain the network resource information associated with each cluster node in the cloud server; wherein, the cluster node network information table is constructed based on the resource recovery event in the cloud management platform; based on the network resource information, a node network resource details table corresponding to each cluster node is established; the first target network port resources of each cluster node in the node network resource details table are recovered, and the node network resource details table and the cluster node network information table are updated; the target cluster identifier is obtained from the ConfigMap configuration file of the cloud cluster; based on the target cluster identifier, a list of network port resources with abnormal network port status is constructed; each network port resource in the network port resource list is traversed, and the network resource cleaning component in the cloud cluster is used to recycle the second target network port resource in each network port resource; wherein, the second target network port resource is a network port resource for which no corresponding container exists.

[0059] The beneficial effects are as follows: the present invention realizes accurate scanning and recycling of network resources through the collaborative work of the network resource recycling component of the cloud management platform and the network resource cleaning component of the cloud cluster, and utilizes the construction and update of the cluster node network information table and the node network resource detailed table, thereby avoiding the problem of residual resources. On the one hand, based on the resource recovery event, the cluster node network information table is constructed and the network resource information is obtained, which can quickly locate the resources to be recycled; the node network resource detailed table is established to provide a detailed basis for resource recovery, ensure the accuracy and comprehensiveness of the recovery operation, and the recovery of the first target network port resource and the update of the table realize the timely cleanup and status synchronization of existing resources. On the other hand, the target cluster identifier is obtained from the ConfigMap configuration file, and then the abnormal network port resource list is constructed, the abnormal resource range is accurately locked, and the second target network port resource that does not have a corresponding container is recovered by traversing the network port resource list, thereby avoiding invalid resource occupation, improving network resource utilization, ensuring the consistency of the network resource status of the cloud cluster and the IAAS layer, effectively solving the problem of residual network resources caused by asynchronous communication and multi-module collaboration, reducing manual operation and maintenance costs, and improving the automation and intelligence level of network resource management in the cloud computing environment.

[0060] See also Figure 8 This embodiment of the present invention discloses a specific method for recovering network resources from a cloud cluster. Compared with the previous embodiment, this embodiment further illustrates and optimizes the technical solution. It includes: Step S21: Use the network resource recovery component in the cloud management platform to scan the cluster node network information table; if the cluster node network information table is not empty, call the application programming interface of the software-defined network in the IAAS layer based on the cloud cluster identifier and subnet identifier in the cluster node network information table to obtain the network resource information associated with each cluster node in the cloud server; wherein, the cluster node network information table is constructed based on the resource recovery event in the cloud management platform.

[0061] Start an asynchronous thread and periodically scan the data in the cluster node network information table clusterDatabase. If there is no data in the cluster node network information table, exit the network resource recovery process; if there is data in the cluster node network information table, continue the subsequent process, that is, use SubnetID and NodeIP as parameters to call the IAAS layer SDN API to obtain the network resource information associated with each cluster node.

[0062] Step S22: establishing a node network resource list corresponding to each of the cluster nodes based on the network resource information.

[0063] Step S23: reclaiming the first target network port resource of each cluster node in the node network resource detail table, and updating the node network resource detail table and the cluster node network information table.

[0064] The network resource recycling component of the cloud management platform will be called when the cloud cluster is deleted or the cluster node is scaled down. The network resource tree is stored in the data table according to a certain index relationship for persistent storage, and an asynchronous coroutine is enabled to periodically scan the data table to recycle garbage resources.

[0065] Step S24: Obtain the target cluster identifier from the ConfigMap configuration file of the cloud cluster.

[0066] Step S25: constructing a list of network port resources with abnormal network port status based on the target cluster identifier.

[0067] Step S26: traverse each network port resource in the network port resource list, and use the network resource cleaning component in the cloud cluster to recycle the second target network port resource in each network port resource; wherein, the second target network port resource is a network port resource for which there is no corresponding container.

[0068] The K8s cluster network resource cleaning component provides the cluster with self-cleaning capabilities for network resources. It is mainly used to solve the problem of residual network resources that may appear in scenarios such as container creation and deletion. The network resource cleaning component will periodically obtain the network resources of the IAAS layer according to certain filtering conditions, and determine whether the network resources are garbage resources. If they are garbage resources, they will be recycled.

[0069] It can be seen that the present invention effectively solves the problem of residual network resources caused by multi-module communication anomalies, module service anomalies and other problems in scenarios such as deleting K8s clusters on the cloud, shrinking nodes, and cloud platform master-slave disaster recovery. The network resource recovery component of the cloud management platform is triggered and called when the cloud cluster is deleted or the cluster node is shrunk. The network resource tree is stored in the data table according to a specific index relationship to achieve persistence. At the same time, the asynchronous coroutine is enabled to periodically scan the data table to complete the recycling of garbage resources; and the network resource cleaning component of the K8s cluster provides the cluster with network resource self-cleaning capabilities, which is mainly used to solve the problem of residual network resources that may occur in scenarios such as container creation and deletion. The two form a synergistic effect by processing the resource residual problems of cluster-level operations and container-level operations respectively, and jointly achieve a comprehensive solution to the problem of residual network resources.

[0070] Figure 9 A schematic diagram of the structure of a cloud cluster network resource recovery device provided by an embodiment of the present invention includes: The resource acquisition module 11 is used to use the network resource recovery component in the cloud management platform to scan the cluster node network information table to obtain the network resource information associated with each cluster node in the cloud server; wherein, the cluster node network information table is constructed based on the resource recovery event in the cloud management platform.

[0071] The resource table establishing module 12 is configured to establish a node network resource detailed table corresponding to each of the cluster nodes based on the network resource information.

[0072] The first resource recovery module 13 is configured to recover the first target network port resource of each cluster node in the node network resource detail table, and update the node network resource detail table and the cluster node network information table.

[0073] The identification acquisition module 14 is used to obtain the target cluster identification from the ConfigMap configuration file of the cloud cluster.

[0074] The list building module 15 is configured to build a list of network port resources with abnormal network port status based on the target cluster identifier.

[0075] The second resource recovery module 16 is used to traverse each network port resource in the network port resource list, and use the network resource cleaning component in the cloud cluster to recycle the second target network port resource in each network port resource; wherein, the second target network port resource is a network port resource for which no corresponding container exists.

[0076] It can be seen that the present invention uses the network resource recovery component in the cloud management platform to scan the cluster node network information table to obtain the network resource information associated with each cluster node in the cloud server; wherein, the cluster node network information table is constructed based on the resource recovery event in the cloud management platform; based on the network resource information, a node network resource details table corresponding to each cluster node is established; the first target network port resources of each cluster node in the node network resource details table are recovered, and the node network resource details table and the cluster node network information table are updated; the target cluster identifier is obtained from the ConfigMap configuration file of the cloud cluster; based on the target cluster identifier, a list of network port resources with abnormal network port status is constructed; each network port resource in the network port resource list is traversed, and the network resource cleaning component in the cloud cluster is used to recycle the second target network port resource in each network port resource; wherein, the second target network port resource is a network port resource for which no corresponding container exists.

[0077] The beneficial effects are as follows: the present invention realizes accurate scanning and recycling of network resources through the collaborative work of the network resource recycling component of the cloud management platform and the network resource cleaning component of the cloud cluster, and utilizes the construction and update of the cluster node network information table and the node network resource detailed table, thereby avoiding the problem of residual resources. On the one hand, based on the resource recovery event, the cluster node network information table is constructed and the network resource information is obtained, which can quickly locate the resources to be recycled; the node network resource detailed table is established to provide a detailed basis for resource recovery, ensure the accuracy and comprehensiveness of the recovery operation, and the recovery of the first target network port resource and the update of the table realize the timely cleanup and status synchronization of existing resources. On the other hand, the target cluster identifier is obtained from the ConfigMap configuration file, and then the abnormal network port resource list is constructed, the abnormal resource range is accurately locked, and the second target network port resource that does not have a corresponding container is recovered by traversing the network port resource list, thereby avoiding invalid resource occupation, improving network resource utilization, ensuring the consistency of the network resource status of the cloud cluster and the IAAS layer, effectively solving the problem of residual network resources caused by asynchronous communication and multi-module collaboration, reducing manual operation and maintenance costs, and improving the automation and intelligence level of network resource management in the cloud computing environment.

[0078] Furthermore, the embodiment of the present application also discloses an electronic device, Figure 10This is a structural diagram of an electronic device according to an exemplary embodiment. The content in the diagram cannot be considered as any limitation on the scope of use of this application. The electronic device may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the cloud cluster network resource recovery method disclosed in any of the aforementioned embodiments. In addition, the electronic device in this embodiment may specifically be an electronic computer.

[0079] In this embodiment, the power supply 23 is used to provide operating voltage for various hardware devices on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and external devices. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0080] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0081] The operating system 221 is used to manage and control the hardware devices on the electronic device and the computer program 222, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of implementing the cloud cluster network resource recovery method executed by the electronic device disclosed in any of the aforementioned embodiments, the computer program 222 can further include computer programs capable of completing other specific tasks.

[0082] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when executed by a processor, the computer program implements the aforementioned disclosed method for recovering cloud cluster network resources. The specific steps of this method can be referred to the corresponding content disclosed in the aforementioned embodiments and will not be repeated here.

[0083] Furthermore, an embodiment of the present application also discloses a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the cloud cluster network resource recovery method disclosed in any of the aforementioned embodiments.

[0084] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.

[0085] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0086] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0087] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0088] The above is a detailed introduction to the technical solution provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the ideas of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for recovering network resources of a cloud cluster, characterized in that: include: Utilize the network resource recovery component in the cloud management platform to scan the cluster node network information table to obtain network resource information associated with each cluster node in the cloud server; wherein the cluster node network information table is constructed based on resource recovery events in the cloud management platform; Establishing a node network resource detailed table corresponding to each of the cluster nodes based on the network resource information; Reclaiming the first target network port resource of each cluster node in the node network resource detail table, and updating the node network resource detail table and the cluster node network information table; Get the target cluster ID from the ConfigMap configuration file of the cloud cluster; Building a list of network port resources with abnormal network port status based on the target cluster identifier; Traverse each network port resource in the network port resource list, and use the network resource cleaning component in the cloud cluster to recycle the second target network port resource in each network port resource; wherein, the second target network port resource is a network port resource for which there is no corresponding container.

2. The cloud cluster network resource recovery method according to claim 1, characterized in that: The cloud management platform is deployed with multiple network resource recovery components; the method of scanning the cluster node network information table using the network resource recovery components in the cloud management platform includes: Determining the roles of each of the network resource recovery components based on a distributed renewal lock preemption mechanism; wherein the roles include a primary role and a backup role; Determine the network resource recovery component having the primary role as the network resource recovery main component; The network resource recovery main component is used to scan the cluster node network information table.

3. The cloud cluster network resource recovery method according to claim 2, characterized in that: Also includes: Determine the network resource recovery component having a backup role as a network resource recovery backup component; Controlling the network resource recovery standby component to monitor the status of the network resource recovery main component; When the state of the network resource recovery main component is abnormal, a new network resource recovery main component is determined from the network resource recovery backup components based on the distributed renewal lock preemption mechanism.

4. The cloud cluster network resource recovery method according to claim 2, characterized in that: The establishing of a node network resource list corresponding to each of the cluster nodes based on the network resource information includes: Based on the network resource information, and using the asynchronous thread of the network resource recovery main component, a node network resource detailed table corresponding to each of the cluster nodes is established; Accordingly, the reclaiming of the first target network port resource of each cluster node in the node network resource list includes: The first target network port resource of each cluster node in the node network resource list is recycled using the asynchronous thread of the network resource recycling main component.

5. The cloud cluster network resource recovery method according to claim 2, characterized in that: Constructing a cluster node network information table based on resource recovery events in the cloud management platform, including: Control the network resource recovery main component to monitor whether there is a resource recovery event in the cloud management platform based on the List / Watch mechanism; wherein the resource recovery event is a cloud cluster deletion event or a cluster node reduction event; If the resource recovery event occurs, the network resource recovery main component is controlled to construct a cluster node network information table based on the resource recovery event in the cloud management platform.

6. The cloud cluster network resource recovery method according to claim 5, characterized in that: The controlling the network resource recycling main component constructs a cluster node network information table based on resource recycling events in the cloud management platform, including: Controlling the network resource recycling main component to parse the resource recycling event to obtain event data; wherein the event data includes the cloud cluster identifier in the resource recycling event, the subnet identifier where the cluster node in the cloud cluster is located, the cluster node name, and the cluster node address; A cluster node network information table is constructed with the cluster node name and the cluster node address as a composite primary key, and the cloud cluster identifier and the subnet identifier as auxiliary index fields.

7. The cloud cluster network resource recovery method according to claim 1, characterized in that: The method of using the network resource recovery component in the cloud management platform to scan the cluster node network information table to obtain the network resource information associated with each cluster node in the cloud server includes: Use the network resource recovery component in the cloud management platform to scan the cluster node network information table; If the cluster node network information table is not empty, the application programming interface of the software-defined network in the IAAS layer is called based on the cloud cluster identifier and subnet identifier in the cluster node network information table to obtain the network resource information associated with each cluster node in the cloud server.

8. The method for recovering network resources of a cloud cluster according to any one of claims 1 to 7, characterized in that: The network resource information includes the network port identifier and network port address of each cluster node. The primary key of the node network resource details table is the network port identifier. The auxiliary index fields of the node network resource details table are the root port and network port address respectively. The root port is the cluster node name and cluster node address.

9. The cloud cluster network resource recovery method according to claim 1, characterized in that: The step of constructing a list of network port resources with abnormal network port status based on the target cluster identifier includes: The target cluster identifier and the abnormal network port status are used as key fields, and the application programming interface of the software-defined network in the IAAS layer is called to obtain each network port resource with an abnormal network port status in the cloud cluster corresponding to the target cluster identifier; A network port resource list is constructed, including each network port resource having an abnormal network port status.

10. The cloud cluster network resource recovery method according to claim 9, characterized in that: The traversing each network port resource in the network port resource list and recycling the second target network port resource in each network port resource by using the network resource cleaning component in the cloud cluster includes: Determine the current network port resource from the network port resource list; Parsing the application space and container name of the current network port resource; Calling the application programming interface of the cloud cluster with the application space and the container name as key fields, and determining whether there is a container corresponding to the current network port resource in the cloud cluster; If there is no container corresponding to the current network port resource, determining that the current network port resource is the second target network port resource, and using the network resource cleaning component in the cloud cluster to reclaim the current network port resource; Determine the next network port resource from the network port resource list, update the next network port resource to the current network port resource, and then jump back to the step of parsing the application space and container name of the current network port resource until all network port resources in the network port resource list are traversed.

11. The cloud cluster network resource recovery method according to claim 10, characterized in that: The utilizing the network resource cleaning component in the cloud cluster to reclaim the current network port resources includes: The network resource cleaning component in the cloud cluster is used to call the application programming interface of the software-defined network in the IAAS layer to reclaim the current network port resources.

12. The cloud cluster network resource recovery method according to claim 11, characterized in that: Before obtaining the target cluster identifier from the ConfigMap configuration file of the cloud cluster, the following steps are also included: Loading the authorization configuration file to obtain first authentication information and second authentication information; wherein the first authentication information is the authentication information required to access the application programming interface of the cloud cluster, and the second authentication information is the authentication information required to access the application programming interface of the software-defined network in the IAAS layer; The first authentication information and the second authentication information are used to establish a long connection between the application programming interface of the cloud cluster and the application programming interface of the software-defined network in the IAAS layer.

13. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of the cloud cluster network resource recovery method described in any one of claims 1 to 12 are implemented.

14. An electronic device, characterized in that: include: memory for storing computer programs; A processor is used to execute the computer program to implement the steps of the cloud cluster network resource recovery method according to any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the cloud cluster network resource recovery method according to any one of claims 1 to 12 are implemented.

Citation Information

Patent Citations

  • An SDN-based container network resource scheduling method

    CN109743261A

  • Resource recovery method and device for resource management platform, equipment and readable medium

    CN112486689A

  • Resource recovery device and method in cloud computing platform

    CN113296956A

  • Cluster resource recovery method and device, equipment, storage medium and program product

    CN117573351A

  • Container cloud resource management method based on resource deployment auditing

    CN117827382A