Service load expansion method and system based on container network plug-in
Through the collaborative work of container network plug-in and Autoscaler components, data connection requests are monitored and expansion decisions are made, which solves the problem of business responsible for automatic expansion of containers, realizing automatic expansion and reducing system complexity.
Patent Information
- Application Number
- CN202411596222.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-02-18
AI Technical Summary
In the prior art, it is difficult to achieve automatic expansion of the service-responsible container without adding additional components.
Monitor data connection requests through the container network plug-in, and send notifications to the Autoscaler component based on the connection status and traffic statistics. The Autoscaler component makes scaling decisions based on the status and performs scaling or reduction operations, and synchronizes to the container network plug-in.
The automatic expansion of the service load container is realized, reducing the system complexity and reducing the probability of abnormal occurrence.
Smart Images

Figure CN119484547A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network communication technology, and in particular to a method and system for expanding service load based on a container network plug-in. Background Art
[0002] Cloud native serverless technology represented by the open source project knative monitors, proxies and caches the client's http requests. When there are no requests, knative can shut down the backend service container, thereby saving resources and flexibly scheduling. When a new request comes in, knative will discover the new connection, cache it, and then pull up the backend service container. After the service container is pulled up, knative will continue to send the cached request to the backend service container and complete the service. At present, the solutions for discovering connections, notifying autoscaler (a component of knative, whose main function is to automatically control the number of container loads) and caching requests are all based on seven-layer proxies, such as envoy (an open source high-performance proxy). However, these seven-layer proxies are generally located in user space, so when they perceive new connections, they have already been processed by the kernel network stack, so it takes a lot of time and is filtered by the network stack.
[0003] How to achieve automatic expansion of business-related containers without adding additional components is a technical problem that needs to be solved. Summary of the invention
[0004] The technical task of the present invention is to address the above shortcomings and provide a method and system for expanding business load based on container network plug-ins to solve the technical problem of how to achieve automatic expansion of business-related containers without adding additional components.
[0005] In a first aspect, the present invention provides a method for expanding business load based on a container network plug-in, which is applied between a container network plug-in and an Autoscaler component. The container network plug-in is deployed on a kubernetes cluster node to provide address translation and network connection, including the following steps:
[0006] For Kubernetes cluster nodes, the container network plug-in monitors data connection requests and sends notifications to the Autoscaler component based on the connection status and traffic statistics related to the data connection requests.
[0007] Based on the notification and the status of the business load containers corresponding to the current backend services, the Autoscaler component makes expansion decisions for the business load containers and performs expansion or reduction operations, and synchronizes the expansion decisions to the container network plug-in;
[0008] When the business load container of the service corresponding to the data connection request meets the conditions, the container network plug-in forwards the data packets related to the data connection request to the corresponding business load container based on the forwarding rules. If the business load container of the service corresponding to the current data connection request does not meet the conditions, the container network plug-in discards the data packets related to the data connection request based on the forwarding rules.
[0009] Preferably, the data connection is a TCP / UDP connection request, based on the TCP / UDP protocol, and the connection status includes unconnected, connecting and connected;
[0010] The traffic statistics information includes the number of data packets, the size of data packets and the timestamp.
[0011] Preferably, the container network plug-in periodically synchronizes the connection status and traffic statistics related to the data connection request to the Autoscaler component.
[0012] Preferably, the Autoscaler component periodically checks the connection status and traffic statistics information synchronized by the container network plug-in. When the access traffic or connection status of the service does not reach a predetermined threshold, the Autoscaler component makes a capacity expansion decision for the business load container of the corresponding service and performs a capacity expansion or reduction operation, and synchronizes the capacity expansion decision to the container network plug-in. When the business-responsible container of the service disappears, the container network plug-in adjusts the forwarding rules of the corresponding data packets of the relevant service based on the standard specifications of the container network plug-in.
[0013] Preferably, when the Autoscaler component detects that a service has no access and data traffic within a predetermined time period, it reduces the size of the relevant business load container and synchronizes the reduction decision to the container network plug-in.
[0014] In a second aspect, the present invention provides a service load expansion system based on a container network plug-in, including a network plug-in and an Autoscaler component, wherein the container network plug-in is deployed on a kubernetes cluster node to provide address translation and network connection;
[0015] For Kubernetes cluster nodes, the container network plug-in is used to monitor data connection requests and send notifications to the Autoscaler component based on the connection status and traffic statistics related to the data connection requests;
[0016] Based on the notification and the status of the business load containers corresponding to the current backend services, the Autoscaler component is used to make capacity expansion decisions for the business load containers and perform capacity expansion or reduction operations, and synchronize the capacity expansion decisions to the container network plug-in;
[0017] When the business load container of the service corresponding to the data connection request meets the conditions, the container network plug-in is used to forward the data packets related to the data connection request to the corresponding business load container based on the forwarding rules. If the business load container of the service corresponding to the current data connection request does not meet the conditions, the container network plug-in is used to discard the data packets related to the data connection request based on the forwarding rules.
[0018] Preferably, the data connection is a TCP / UDP connection request, based on the TCP / UDP protocol, and the connection status includes unconnected, connecting and connected;
[0019] The traffic statistics information includes the number of data packets, the size of data packets and the timestamp.
[0020] Preferably, the container network plug-in is used to periodically synchronize connection status and traffic statistics related to data connection requests to the Autoscaler component.
[0021] Preferably, the Autoscaler component is used to periodically check the connection status and traffic statistics information synchronized by the container network plug-in. When the access traffic or connection status of the service does not reach a predetermined threshold, the Autoscaler component is used to make a capacity expansion decision for the business load container of the corresponding service and perform a capacity expansion or reduction operation, and synchronize the capacity expansion decision to the container network plug-in. When the business-responsible container of the service disappears, the container network plug-in adjusts the forwarding rules of the corresponding data packets of the relevant service based on the standard specifications of the container network plug-in.
[0022] Preferably, the Autoscaler component is used to scale down the relevant business load container when it is counted that a service has no access and data traffic within a predetermined time period, and synchronize the scaling-down decision to the container network plug-in.
[0023] The container network plug-in-based service load expansion method and system of the present invention have the following advantages: using the existing component network plug-in and Autoscaler component of Kubernetes for improvement, monitoring data connection requests through the container network plug-in, and sending notifications to the Autoscaler component based on the connection status and traffic statistics related to the data connection request. Based on the notification and the status of the service load containers corresponding to the current backend services, the Autoscaler component makes expansion decisions for the service load containers and performs expansion operations or reduction operations, thereby realizing automatic expansion, reducing system complexity, and reducing the probability of abnormalities. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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 paying creative work.
[0025] The present invention is further described below in conjunction with the accompanying drawings.
[0026] Figure 1 This is a flowchart of a business load expansion method based on a container network plug-in in Example 1. DETAILED DESCRIPTION
[0027] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it. However, the embodiments are not intended to limit the present invention. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments may be combined with each other.
[0028] The embodiments of the present invention provide a method and system for expanding business load based on a container network plug-in, which are used to solve the technical problem of how to achieve automatic expansion of business-related containers without adding additional components.
[0029] Embodiment 1:
[0030] The present invention provides a method for expanding business load based on a container network plug-in, which is applied between the container network plug-in and the Autoscaler component. The container network plug-in is deployed on a kubernetes cluster node to provide address translation and network connection. The method includes the following three steps: data flow synchronization, expansion decision and data packet forwarding.
[0031] Step S100: Data flow synchronization: For kubernetes cluster nodes, the container network plug-in monitors data connection requests, and sends notifications to the Autoscaler component based on the connection status and traffic statistics related to the data connection requests.
[0032] In this embodiment, the data connection is a TCP / UDP connection request, based on the TCP / UDP protocol, and the connection status includes disconnected, connecting, and connected. The traffic statistics information will at least include five-tuple data of the four-layer connection, and the five-tuple data includes at least the number of data packets, the size of the data packet, and the timestamp.
[0033] The container network plug-in periodically synchronizes the connection status and traffic statistics related to data connection requests to the Autoscaler component. The synchronization method can be through a direct interface or through content subscription through a third party.
[0034] Step S200: Expansion decision: Based on the notification and the status of the business load containers corresponding to the current backend services, the Autoscaler component makes expansion decisions for the business load containers and performs expansion or reduction operations, and synchronizes the expansion decisions to the container network plug-in.
[0035] In this embodiment, the Autoscaler component periodically checks the connection status and traffic statistics information synchronized by the container network plug-in. When the access traffic or connection status of the service does not reach the predetermined threshold, the Autoscaler component makes a capacity expansion decision for the business load container of the corresponding service and performs a capacity expansion or reduction operation, and synchronizes the capacity expansion decision to the container network plug-in. When the business responsible container of the service disappears, the container network plug-in adjusts the forwarding rules of the corresponding data packets of the relevant service based on the standard specifications of the container network plug-in.
[0036] When the Autoscaler component finds that a service has no access and data traffic within a predetermined time period, it scales down the related business load containers and synchronizes the reduction decision to the container network plug-in.
[0037] Step S300: Data packet forwarding: When the business load container of the service corresponding to the data connection request meets the conditions, the container network plug-in forwards the data packet related to the data connection request to the corresponding business load container based on the forwarding rules. If the business load container of the service corresponding to the current data connection request does not meet the conditions, the container network plug-in discards the data packet related to the data connection request based on the forwarding rules.
[0038] In this embodiment, the container network plug-in performs bilateral synchronization with the scheduler responsible for automatic capacity expansion (such as the Autoscaler component in knative). The synchronization content is the corresponding available backends and the traffic corresponding to each backend (such as the number of data packets and the size of data packets) in the service that will be called currently.
[0039] When the available backend corresponding to a service does not exist (that is, when the Autoscaler component reduces the number of backend business load containers to 0), and the container network plug-in receives a TCP / UDP ack connection request that needs to connect to this service, it will notify the Autoscaler component and trigger the automatic expansion of the container to start a new business load container. However, this TCP / UDP ack connection request will be directly discarded. Before the backend container can be normally serviced, all received connection requests will be directly discarded.
[0040] The container network plug-in is also called CNI (container network interface). It is an interface for implementing the container network plug-in in the Kubernetes system. It is also a general term for all container network components that implement the interface. CNI is a core component of address translation and network connection in the Kubernetes system and a core component in the underlying infrastructure. The Autoscaler component (a component of knative, whose main function is to automatically control the number of container loads. The method of this embodiment is based on the existing components in Kubernetes, without the need to add additional components, reducing the complexity of the system.
[0041] Embodiment 2:
[0042] The present invention discloses a service load expansion system based on a container network plug-in, which includes a network plug-in and an Autoscaler component. The container network plug-in is deployed on a kubernetes cluster node to provide address translation and network connection.
[0043] For Kubernetes cluster nodes, the container network plug-in is used to monitor data connection requests and send notifications to the Autoscaler component based on the connection status and traffic statistics related to the data connection requests.
[0044] In this embodiment, the data connection is a TCP / UDP connection request, based on the TCP / UDP protocol, and the connection status includes disconnected, connecting, and connected. The traffic statistics information will at least include five-tuple data of the four-layer connection, and the five-tuple data includes at least the number of data packets, the size of the data packet, and the timestamp.
[0045] The container network plug-in periodically synchronizes the connection status and traffic statistics related to data connection requests to the Autoscaler component. The synchronization method can be through a direct interface or through content subscription through a third party.
[0046] Based on the notification and the status of the business load containers corresponding to the current backend services, the Autoscaler component is used to make expansion decisions for the business load containers and perform expansion or reduction operations, and synchronize the expansion decisions to the container network plug-in.
[0047] In this embodiment, the Autoscaler component periodically checks the connection status and traffic statistics information synchronized by the container network plug-in. When the access traffic or connection status of the service does not reach the predetermined threshold, the Autoscaler component makes a capacity expansion decision for the business load container of the corresponding service and performs a capacity expansion or reduction operation, and synchronizes the capacity expansion decision to the container network plug-in. When the business responsible container of the service disappears, the container network plug-in adjusts the forwarding rules of the corresponding data packets of the relevant service based on the standard specifications of the container network plug-in.
[0048] When the Autoscaler component finds that a service has no access and data traffic within a predetermined time period, it scales down the related business load containers and synchronizes the reduction decision to the container network plug-in.
[0049] When the business load container of the service corresponding to the data connection request meets the conditions, the container network plug-in is used to forward the data packets related to the data connection request to the corresponding business load container based on the forwarding rules. If the business load container of the service corresponding to the current data connection request does not meet the conditions, the container network plug-in is used to discard the data packets related to the data connection request based on the forwarding rules.
[0050] In this embodiment, the container network plug-in performs bilateral synchronization with the scheduler responsible for automatic capacity expansion (such as the Autoscaler component in knative). The synchronization content is the corresponding available backends and the traffic corresponding to each backend (such as the number of data packets and the size of data packets) in the service that will be called currently.
[0051] The system of this embodiment can execute the method disclosed in Example 1 to realize automatic expansion of the backend business load container, and the components used in the system are existing components of Kubernetes, without the need to add additional components, thereby reducing system complexity.
[0052] The present invention has been shown and described in detail above through the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art can know that the means in the above different embodiments can be combined to obtain more embodiments of the present invention, and these embodiments are also within the protection scope of the present invention.
Claims
1. A method for expanding business load based on container network plug-in, characterized in that: Applied between the container network plug-in and the Autoscaler component. The container network plug-in is deployed on the Kubernetes cluster node to provide address translation and network connection, including the following steps: For Kubernetes cluster nodes, the container network plug-in monitors data connection requests and sends notifications to the Autoscaler component based on the connection status and traffic statistics related to the data connection requests. Based on the notification and the status of the business load containers corresponding to the current backend services, the Autoscaler component makes expansion decisions for the business load containers and performs expansion or reduction operations, and synchronizes the expansion decisions to the container network plug-in; When the business load container of the service corresponding to the data connection request meets the conditions, the container network plug-in forwards the data packets related to the data connection request to the corresponding business load container based on the forwarding rules. If the business load container of the service corresponding to the current data connection request does not meet the conditions, the container network plug-in discards the data packets related to the data connection request based on the forwarding rules.
2. The method for expanding business load based on container network plug-in according to claim 1 is characterized in that: The data connection is a TCP / UDP connection request, based on the TCP / UDP protocol, and the connection status includes unconnected, connecting and connected; The traffic statistics information includes the number of data packets, the size of data packets and the timestamp.
3. The method for expanding business load based on container network plug-in according to claim 1 is characterized in that: The container network plug-in periodically synchronizes the connection status and traffic statistics related to data connection requests to the Autoscaler component.
4. The method for expanding business load based on container network plug-in according to claim 1, characterized in that: The Autoscaler component periodically checks the connection status and traffic statistics synchronized by the container network plug-in. When the access traffic or connection status of the service does not reach the preset threshold, the Autoscaler component makes a capacity expansion decision for the business load container of the corresponding service and performs capacity expansion or reduction operations, and synchronizes the capacity expansion decision to the container network plug-in. When the business responsible container of the service disappears, the container network plug-in adjusts the forwarding rules of the corresponding data packets of the relevant service based on the standard specifications of the container network plug-in.
5. The method for expanding business load based on container network plug-in according to claim 1, characterized in that: When the Autoscaler component finds that a service has no access and data traffic within a predetermined time period, it scales down the related business load containers and synchronizes the reduction decision to the container network plug-in.
6. A service load expansion system based on a container network plug-in, characterized in that: It includes network plug-ins and Autoscaler components. The container network plug-in is deployed on the Kubernetes cluster nodes to provide address translation and network connection. For Kubernetes cluster nodes, the container network plug-in is used to monitor data connection requests and send notifications to the Autoscaler component based on the connection status and traffic statistics related to the data connection requests; Based on the notification and the status of the business load containers corresponding to the current backend services, the Autoscaler component is used to make capacity expansion decisions for the business load containers and perform capacity expansion or reduction operations, and synchronize the capacity expansion decisions to the container network plug-in; When the business load container of the service corresponding to the data connection request meets the conditions, the container network plug-in is used to forward the data packets related to the data connection request to the corresponding business load container based on the forwarding rules. If the business load container of the service corresponding to the current data connection request does not meet the conditions, the container network plug-in is used to discard the data packets related to the data connection request based on the forwarding rules.
7. The service load expansion system based on container network plug-in according to claim 6 is characterized in that: The data connection is a TCP / UDP connection request, based on the TCP / UDP protocol, and the connection status includes unconnected, connecting and connected; The traffic statistics information includes the number of data packets, the size of data packets and the timestamp.
8. The service load expansion system based on container network plug-in according to claim 6 is characterized in that: The container network plug-in is used to periodically synchronize the connection status and traffic statistics related to data connection requests to the Autoscaler component.
9. The service load expansion system based on container network plug-in according to claim 6 is characterized in that: The Autoscaler component is used to periodically check the connection status and traffic statistics synchronized by the container network plug-in. When the access traffic or connection status of the service does not reach the predetermined threshold, the Autoscaler component is used to make expansion decisions for the business load container of the corresponding service and perform expansion or reduction operations, and synchronize the expansion decision to the container network plug-in. When the business responsible container of the service disappears, the container network plug-in adjusts the forwarding rules for the corresponding data packets of the relevant service based on the standard specifications of the container network plug-in.
10. The service load expansion system based on container network plug-in according to claim 6 is characterized in that: The Autoscaler component is used to scale down the relevant business load containers when statistics show that a service has no access and data traffic within a predetermined time period, and synchronize the scaling-down decision to the container network plug-in.
Citation Information
Patent Citations
Container cluster capacity expansion control method and device and electronic equipment
CN117097615A
Container resource processing method and device of Kubernetes cluster
CN117806775A