Super-large scale Kubernetes cluster List request optimization method

By introducing self-developed gateways and Operator modifications into the Kubernetes cluster, the ResourceVersion view is managed, Apiserver List requests are reduced, the problem of OOM crashes in ultra-large Kubernetes clusters is solved, and system stability and node management capabilities are improved.

CN118550641APending Publication Date: 2024-08-27CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410520999.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-28
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

In a very large-scale Kubernetes cluster with cloud-native containers, when the number of Node nodes exceeds 10,000 and the number of Pods exceeds 1 million, the Apiserver of the Kubernetes system is prone to OOM crashes, leading to instability. Existing technologies are difficult to effectively solve this problem.

Method used

The self-developed Kubernetes dedicated gateway is used for traffic management and load balancing, and the ResourceVersion view of the Operator is managed through the gateway. The Operator is modified to reduce List requests directly to Apiserver and instead obtain data from other Operators to avoid Apiserver overload.

Benefits of technology

It effectively avoids Kubernetes cluster collapse, improves system stability, greatly increases the number of nodes that can be managed, reduces the occurrence of avalanche problems, and enhances the overall stability of the cluster.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118550641A
    Figure CN118550641A
Patent Text Reader

Abstract

The invention discloses a method for optimizing a List request of a super-large-scale Kubernetes cluster, and belongs to the field of containers, in a large-scale Kubernetes construction scene based on a cloud native container, in order to avoid the situation that the Kubernetes cluster crashes or is unstable, the method solves the problem through the patent, and the capacity and characteristics of the super-large-scale Kubernetes cluster comprise the steps that a gateway assembly of self-research adaptive Kubernetes is added, and the Kubernetes cluster is constructed in a large-scale Kubernetes construction scene based on the cloud native container; the gateway component needs to send the current ReSource Version views of all Operators for monitoring the same resource to all Operators, and the current ReSource Version views of all Operators for monitoring the same resource need to be sent to all Operators; according to the invention, when the network is disconnected and the List is needed again every time, the reconstructed Operator finds out the Operator which is larger than the current ResourceVersion from the ResourceVersion view sent by the gateway, and obtains the List total data from the Operator, so that the List requests of the Apiserver of the Kubernetes system are greatly reduced, and the stability of the super-large-scale Kubernetes cluster is greatly enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of containers, and in particular relates to a method for optimizing List requests of an ultra-large-scale Kubernetes cluster. Background Art

[0002] In the construction of ultra-large-scale Kubernetes clusters of cloud-native containers, when the number of Node nodes exceeds 10,000 and the number of Pods exceeds 1 million, the Kubernetes system Controller and the user-developed Operator will go to the Kubernetes Apiserver to list all Pod data, which will cause Apiserver to experience OOM and other avalanche scenarios. At this time, a method is needed to solve the above problems. Summary of the invention

[0003] The technical problem to be solved by the present invention is to provide a method for optimizing List requests of ultra-large-scale Kubernetes clusters in response to the shortcomings of the background technology, which effectively avoids the crash or instability of the Kubernetes cluster in the large-scale Kubernetes construction scenario based on cloud native containers.

[0004] The present invention adopts the following technical solutions to solve the above technical problems:

[0005] A method for optimizing List requests in a super-large-scale Kubernetes cluster, specifically comprising the following steps;

[0006] Step 1: Add a Kubernetes-specific gateway and adapt the Kubernetes protocol to perform traffic management to achieve load balancing.

[0007] Step 2: The gateway manages the resources that the operator is following, manages the operators that are following the same resource in the current ResourceVersion view, and sends the ResourceVersion of the resource to all operators that are following the resource in real time.

[0008] Step 3: Each of the modified Operators receives and stores the ResourceVersion view sent by the gateway, and the Operator that pays attention to the resource requests to verify whether the corresponding ResourceVersion is correct;

[0009] Step 4: If a large number of operators go to the Kubernetes Apiserver to list data at the same time, the Apiserver will crash due to OOM. After the corresponding Apiserver crashes, the subsequent Operator performs the List operation again. A large number of List requests will flood the next Apiserver, causing all the Apiservers of Kubernetes to crash one by one due to OOM. The Operator needs to be modified so that it can list data from its sibling Operator based on information such as ResourceVersion.

[0010] Step 5: After the modified Operator determines that it needs to re-list the data, it selects an Operator with a larger ResourceVersion than its own based on the ResourceVersion view of all Operators that pay attention to the resource, and goes to the Operator to list the full data.

[0011] As a further preferred solution of the method for optimizing List requests of a super-large-scale Kubernetes cluster of the present invention,

[0012] In step 1, the Kubernetes-specific gateway is completely transparent to Kubernetes users, and the client can access the gateway without any modification.

[0013] As a further preferred solution of the method for optimizing List requests of a super-large-scale Kubernetes cluster of the present invention, in step 1, load balancing is changed from the TCP connection level to the HTTP request level, thereby achieving fast and effective load balancing and completely solving the problem of kube-api server load imbalance.

[0014] As a further preferred solution of the method for optimizing List requests of a super-large-scale Kubernetes cluster of the present invention, in step 1, common gateway functions such as current limiting, degradation, and dynamic service discovery are supported.

[0015] As a further preferred solution of the method for optimizing List requests of a super-large-scale Kubernetes cluster of the present invention, in step 3, the Operator paying attention to the resource requests to verify whether the corresponding ResourceVersion is correct according to the ResourceVersion view sent down.

[0016] As a further preferred solution of the method for optimizing List requests of a super-large-scale Kubernetes cluster of the present invention, in step 3, the corresponding Operator is transformed to support querying the current ResourceVersion of the corresponding resource, so that Operators paying attention to the same resource will perform mutual resource ResourceVersion verification.

[0017] As a further preferred solution of the method for optimizing List requests in a super-large-scale Kubernetes cluster of the present invention, in step 3, each time the modified Operator needs the List again after the network is disconnected, it finds an Operator with a larger ResourceVersion than its current ResourceVersion from the ResourceVersion view sent by the gateway, and obtains the full List data from this Operator.

[0018] As a further preferred solution of the method for optimizing List requests of a super-large-scale Kubernetes cluster of the present invention, in step 4, the ResourceVersion of the Operator lags far behind the Apiserver component of Kubernetes due to network jitter or network delay, which triggers the re-removal of the full List data.

[0019] As a further preferred solution of the method for optimizing List requests of a super-large-scale Kubernetes cluster of the present invention, in step 5, the Operator searches for a suitable Operator to list data, determines whether the current pressure of the corresponding Operator is too large, selects a suitable Operator from the Operator list, and then goes to this Operator to list all the data.

[0020] As a further preferred solution of the method for optimizing List requests of a super-large-scale Kubernetes cluster of the present invention, in step 5, a suitable Operator is selected from the Operator list according to ResourceVersion and load indicators.

[0021] Compared with the prior art, the present invention adopts the above technical solution and has the following technical effects:

[0022] 1. The present invention adds a self-developed gateway that adapts to the Kubernetes system protocol to manage all Kubernetes traffic, avoid the uneven traffic that often occurs in Kubernetes, and manage the ResourceVersion view of all Operators;

[0023] 2. All operators of the present invention receive the ResourceVersion view of all operators that focus on the same resource from the self-developed gateway. When the operator re-lists data, it lists the full data from other operators to avoid the avalanche problem of the Apiserver component of the Kubernetes system;

[0024] 3. When building a container ultra-large-scale Kubernetes cluster, the present invention can easily manage more than 20,000 nodes in a single Kubernetes cluster, saving a lot of management resources;

[0025] 4. Compared with the current Kubernetes cluster, the patented method of the present invention can greatly reduce the avalanche problem of ultra-large-scale Kubernetes clusters, greatly increase the stability of the cluster, and significantly increase the number of Node machines that the Kubernetes cluster can manage. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, 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 application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0027] Figure 1 This is the current status of Kubernetes in this invention;

[0028] Figure 2 It is a schematic diagram of the self-developed gateway component of the present invention;

[0029] Figure 3 It is a schematic diagram of the operator modified according to the present invention. DETAILED DESCRIPTION

[0030] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings:

[0031] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. The present invention is described in detail below based on the drawings and preferred embodiments, and the purpose and effect of the present invention will become clearer. It should be understood that the specific embodiments described here are only used to explain the present invention and are not used to limit the present invention.

[0032] Glossary

[0033] Provide a definition or brief explanation of the technical keywords in the proposal. Abbreviations need to be given in full in Chinese and English. For the same object being described, please ensure that the terms used in the briefing are consistent.

[0034] Example: SRv6 SFC (Segment Routing over IPv6 Service Function Chain): is a technology that adds SRv6 path information to the original message to guide the message to pass through the application layer service device in sequence along the specified path.

[0035] SC (Service Classifier): Located at the edge of the SRV6 SFC service chain network, it is the source node of the service chain path. SC can use different diversion methods to introduce service data into the SRV6 TE Policy tunnel for forwarding.

[0036] The present invention is based on the large-scale Kubernetes construction scenario of cloud native containers. In order to avoid the crash or instability of the Kubernetes cluster, this patent solves the problem. The capabilities and characteristics of the ultra-large-scale container Kubernetes cluster include:

[0037] 1. Add a self-developed gateway component adapted to Kubernetes. This gateway component needs to send the current ResourceVersion view of all Operators that monitor the same resource to all Operators;

[0038] 2. Every time the modified Operator needs the List again after the network is disconnected, it finds an Operator with a larger ResourceVersion than its current one from the ResourceVersion view sent by the gateway, and obtains the full List data from this Operator. This greatly reduces the List requests of the Apiserver of the Kubernetes system, greatly enhancing the stability of the ultra-large-scale Kubernetes cluster.

[0039] A method for optimizing List requests in a super-large-scale Kubernetes cluster, characterized in that it specifically comprises the following steps:

[0040] Self-developed Kubernetes-specific gateway, which adapts to the Kubernetes protocol for traffic management and load balancing. It is completely transparent to Kubernetes users, and clients can access the gateway without any modification. Load balancing is changed from TCP connection level to HTTP request level, thereby achieving fast and effective load balancing, completely solving the problem of kube-apiserver load imbalance. It supports common gateway functions such as current limiting, downgrade, and dynamic service discovery.

[0041] The gateway manages the resources that the operator is concerned about, manages the current ResourceVersion view of the operators that are concerned about the same resource, and sends the ResourceVersion of the resource to all operators that are concerned about the resource in real time. Each of the modified operators receives and stores the ResourceVersion view sent by the gateway, and requests the operators that are concerned about these resources to verify whether the corresponding ResourceVersion is correct based on the sent ResourceVersion view. Therefore, the corresponding operators need to be modified to support querying the current ResourceVersion of the corresponding resources, so that the operators that are concerned about the same resource will perform mutual resource ResourceVersion verification;

[0042] The ResourceVersion of the Operator lags far behind the Apiserver component of Kubernetes due to network jitter or network delay, which triggers a re-list of all data. If a large number of Operators go to the Apiserver of Kubernetes to list data at the same time, the Apiserver will crash due to OOM. After the corresponding Apiserver crashes, the subsequent Operator performs the List operation again, so a large number of List requests will flood the next Apiserver, which will cause all the Apiservers of Kubernetes to crash one by one due to OOM. Therefore, the patent will transform the Operator so that the Operator will go to the brother Operator to list data based on the ResourceVersion and other information.

[0043] After the modified Operator determines that it needs to re-list data, it selects an Operator with a larger ResourceVersion than its own based on the ResourceVersion view of all Operators that pay attention to the resource, and then goes to the Operator to list the full data. This greatly reduces the List requests of the Kubernetes Apiserver component and increases system stability. When the Operator looks for a suitable Operator to list data, it also needs to determine whether the current pressure of the corresponding Operator is too high. It selects a suitable Operator from the Operator list based on indicators such as ResourceVersion and load, and then goes to this Operator to list the full data.

[0044] In the practice of building large-scale Kubernetes clusters for cloud-native containers, each Kubernetes node Kubelet, Kubernetes system Controller, and user-developed Operator will list metadata to the Kubernetes Apiserver, such as Pod, Node, Service, and other related metadata. When the node scale of an ultra-large-scale Kubernetes cluster exceeds 10,000 nodes, the number of Pods will easily exceed 1 million. Listing all Pod data at once will cause the Kubernetes Apiserver OOM crash or instability. Therefore, this patented method greatly reduces the need for the Kubernetes Apiserver to list all data, thereby enhancing the stability of ultra-large-scale Kubernetes.

[0045] In the construction of a large-scale Kubernetes cluster with cloud-native containers, when the number of nodes exceeds 10,000 and the number of Pods exceeds 1 million, the Kubernetes system Controller and the user-developed Operator will go to the Kubernetes Apiserver to list all the Pod data, which will cause the Apiserver to experience OOM and other avalanche scenarios. At this time, a method that can solve the above problems is needed. Figure 1 As shown:

[0046] Self-developed gateway components such as Figure 2 As shown:

[0047] The gateway adapts to the Kubernetes protocol to manage traffic and achieve load balancing;

[0048] The gateway manages the resources that all operators are concerned about, manages the operators that are concerned about the same resource according to the current ResourceVersion view, and sends it to all operators that are concerned about this resource;

[0049] Each of the modified Operators receives and stores the ResourceVersion view sent by the gateway;

[0050] Modify the Operator, such as Figure 3 As shown:

[0051] The ResourceVersion of the Operator lags far behind the Apiserver component of Kubernetes due to network jitter or latency, which triggers a re-list of all data.

[0052] After the Operator determines that it needs to re-list the data, it selects an Operator with a larger ResourceVersion than its own based on the ResourceVersion view of all Operators that pay attention to the resource, and then lists the full data to the Operator. This greatly reduces the List requests of the Kubernetes Apiserver component and increases system stability.

[0053] Those skilled in the art can understand that the above are only preferred examples of the invention and are not intended to limit the invention. Although the invention is described in detail with reference to the above examples, those skilled in the art can still modify the technical solutions recorded in the above examples or replace some of the technical features with equivalents. Any modification, equivalent replacement, etc. made within the spirit and principle of the invention should be included in the protection scope of the invention. All technical features in this embodiment can be freely combined according to actual needs.

[0054] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for optimizing List requests in a super-large-scale Kubernetes cluster, characterized by: The specific steps include: Step 1: Add a Kubernetes-specific gateway and adapt the Kubernetes protocol to perform traffic management to achieve load balancing. Step 2: The gateway manages the resources that the operator is following, manages the operators that are following the same resource in the current ResourceVersion view, and sends the ResourceVersion of the resource to all operators that are following the resource in real time. Step 3: Each of the modified Operators receives and stores the ResourceVersion view sent by the gateway, and the Operator that pays attention to the resource requests to verify whether the corresponding ResourceVersion is correct; Step 4: If a large number of operators go to the Kubernetes Apiserver to list data at the same time, the Apiserver will crash due to OOM. After the corresponding Apiserver crashes, the subsequent Operator performs the List operation again. A large number of List requests will flood the next Apiserver, causing all the Apiservers of Kubernetes to crash one by one due to OOM. The Operator needs to be modified so that it can list data from its sibling Operator based on information such as ResourceVersion. Step 5: After the modified Operator determines that it needs to re-list the data, it selects an Operator with a larger ResourceVersion than its own based on the ResourceVersion view of all Operators that pay attention to the resource, and goes to the Operator to list the full data.

2. According to claim 1, a method for optimizing List requests in a super-large-scale Kubernetes cluster is characterized in that: In step 1, the Kubernetes-specific gateway is completely transparent to Kubernetes users, and the client can access the gateway without any modification.

3. According to claim 1, a method for optimizing List requests in a super-large-scale Kubernetes cluster is characterized in that: In step 1, load balancing is changed from the TCP connection level to the HTTP request level, thereby achieving fast and effective load balancing and completely solving the problem of kube-apiserver load imbalance.

4. According to claim 1, a method for optimizing List requests in a super-large-scale Kubernetes cluster is characterized in that: In step 1, common gateway functions such as current limiting, degradation, and dynamic service discovery are supported.

5. According to claim 1, a method for optimizing List requests in a super-large-scale Kubernetes cluster is characterized in that: In step 3, the resource operator is monitored based on the ResourceVersion view that is sent down to verify whether the corresponding ResourceVersion is correct.

6. According to claim 1, a method for optimizing List requests in a super-large-scale Kubernetes cluster is characterized in that: In step 3, the corresponding Operator is modified to support querying the current ResourceVersion of the corresponding resource, so that Operators that focus on the same resource will perform mutual resource ResourceVersion verification.

7. According to claim 1, a method for optimizing List requests in a super-large-scale Kubernetes cluster is characterized in that: In step 3, each time the modified Operator needs the List again after a network outage, it finds an Operator with a larger ResourceVersion than its current one from the ResourceVersion view sent by the gateway, and obtains the full List data from this Operator.

8. According to claim 1, a method for optimizing List requests in a super-large-scale Kubernetes cluster is characterized in that: In step 4, the ResourceVersion of the Operator lags far behind the Apiserver component of Kubernetes due to network jitter or network delay, which triggers the re-list of the full data.

9. According to claim 1, a method for optimizing List requests in a super-large-scale Kubernetes cluster is characterized in that: In step 5, the Operator looks for a suitable Operator to list data, determines whether the current pressure of the corresponding Operator is too high, selects a suitable Operator from the Operator list, and then goes to this Operator to list all the data.

10. The method for optimizing List requests in a super-large-scale Kubernetes cluster according to claim 9, characterized in that: In step 5, select a suitable Operator from the Operator list based on ResourceVersion and load indicators.

Citation Information

Cited By

  • Method and apparatus for optimizing watch request in ultra-large-scale kubernetes cluster

    WO2026103885A1