IP Library Granted Patent US 12,184,720
Granted Patent B2
US 12,184,720 · App. 18/477,169 · Granted Dec 31, 2024

Kubernetes cluster load balance handling method and apparatus, and storage medium

Inventors: Siyu Wang (Hangzhou, CN); Yu Ding (Hangzhou, CN); Zhen Zhang (Hangzhou, CN)
Assignee: Hangzhou AliCloud Feitian Information Technology Co., Ltd.
H04L67/1008H04L43/028H04L67/1014
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,184,720
App. No.
18/477,169
Granted
Dec 31, 2024
Kind
B2
Abstract

The present disclosure discloses a method and apparatus for processing load balancing of a Kubernetes cluster, and a storage medium, wherein the method comprises: acquiring traffic configuration rules for controllers in the Kubernetes cluster by a central control component of the Kubernetes cluster; sending the traffic configuration rules to a proxy container corresponding to each of the controllers; and controlling data interaction between an API server and the controllers through the proxy container based on the traffic configuration rules. According to the present disclosure, the technical problem that load balancing is difficult to achieve due to single-point operation of the controllers caused by a single master is solved.

Claims (86)

1. A method comprising:

acquiring traffic configuration rules for controllers in a cluster by a central control component of the cluster, the cluster being a Kubernetes cluster;

sending the traffic configuration rules to a proxy container corresponding to each of the controllers; and

controlling a data interaction between an API server and the controllers through the proxy container based on the traffic configuration rules, the controlling the data interaction between the API server and the controllers through the proxy container based on the traffic configuration rules comprising:

sending data received by the proxy container to a controller corresponding to the proxy container;

in response to determining that the controller corresponding to the proxy container triggers data processing, calling an interface of the proxy container to determine that the data conforms to the traffic configuration rules; and

in response to determining that the data conforms to the traffic configuration rules, allowing the controller corresponding to the proxy container to perform a data processing.

2. The method according to claim 1 , wherein before the controlling the data interaction between the API server and the controllers through the proxy container based on the traffic configuration rules, the method further comprises:

receiving a data request instruction sent by at least one of the controllers through the proxy container;

sending the data request instruction to the API server through the proxy container; and

receiving data sent by the API server.

3. The method according to claim 1 , wherein before the controlling the data interaction between the API server and the controllers through the proxy container based on the traffic configuration rules, the method further comprises:

receiving a data request instruction triggered by the API server through the proxy container; and

in response to the data request instruction, receiving data sent by the API server through the proxy container.

4. The method according to claim 3 , wherein the controlling the data interaction between the API server and the controllers through the proxy container based on the traffic configuration rules comprises:

filtering the received data based on the traffic configuration rules in the proxy container to acquire the filtered data; and

sending the filtered data to a controller corresponding to the proxy container.

5. The method according to claim 1 , wherein the controlling the data interaction between the API server and the controllers through the proxy container based on the traffic configuration rules further comprises:

in response to determining that the data does not conform to the traffic configuration rules, disallowing the controller corresponding to the proxy container to perform the data processing.

6. The method according to claim 1 , wherein:

the traffic configuration rules comprise a global limit rule; and

after the sending the traffic configuration rules to the proxy container corresponding to each of the controllers, the method further comprises:

intercepting a request that does not conform to the global limit rule by the proxy container; or

sending a request that conforms to the global limit rule to the API server.

7. The method according to claim 1 , wherein:

the traffic configuration rules comprise a sharding routing rule; and

after sending the traffic configuration rules to a proxy container corresponding to each of the controllers, the method further comprises:

intercepting a webhook request from the API server by the proxy container;

determining that the webhook request conforms to the sharding routing rule of a current instance; and

forwarding the webhook request to a local webhook of the proxy container for processing.

8. The method according to claim 1 , wherein:

the traffic configuration rules comprise a sharding routing rule; and

after sending the traffic configuration rules to a proxy container corresponding to each of the controllers, the method further comprises:

intercepting a webhook request from the API server by the proxy container;

determining that the webhook request does not conform to the sharding routing rule of a current instance; and

forwarding the webhook request to an instance for which the webhook request conforms to the sharding routing rule of the instance for processing.

9. The method according to claim 1 , wherein the method further comprises:

setting a security protection strategy in the proxy container, wherein the security protection strategy comprises at least one of following: traffic limiting, fusing off, and one-click suspension.

10. The method according to claim 1 , wherein the method further comprises:

monitoring interaction information between the controller and the API server through the proxy container; and

displaying the monitored interaction information on a display interface.

11. An apparatus comprising:

one or more processors; and

one or more memories storing thereon computer-readable instructions that, when executed by the one or more processors, cause the one or more processors to perform acts comprising:

acquiring traffic configuration rules for controllers in a cluster by a central control component of the cluster, the cluster being a Kubernetes cluster;

sending the traffic configuration rules to a proxy container corresponding to each of the controllers; and

controlling a data interaction between an API server and the controllers through the proxy container based on the traffic configuration rules, the controlling the data interaction between the API server and the controllers through the proxy container based on the traffic configuration rules comprising:

sending data received by the proxy container to a controller corresponding to the proxy container;

in response to determining that the controller corresponding to the proxy container triggers data processing, calling an interface of the proxy container to determine that the data conforms to the traffic configuration rules; and

in response to determining that the data conforms to the traffic configuration rules, allowing the controller corresponding to the proxy container to perform a data processing.

12. The apparatus of claim 11 , wherein before the controlling the data interaction between the API server and the controllers through the proxy container based on the traffic configuration rules, the acts further comprise:

receiving a data request instruction sent by at least one of the controllers through the proxy container;

sending the data request instruction to the API server through the proxy container; and

receiving data sent by the API server.

13. The apparatus according to claim 11 , wherein before the controlling data interaction between the API server and the controllers through the proxy container based on the traffic configuration rules, the acts further comprise:

receiving a data request instruction triggered by the API server through the proxy container; and

in response to the data request instruction, receiving data sent by the API server through the proxy container.

14. The apparatus according to claim 13 , wherein the controlling the data interaction between the API server and the controllers through the proxy container based on the traffic configuration rules further comprises:

filtering the received data based on the traffic configuration rules in the proxy container to acquire filtered data; and

sending the filtered data to a controller corresponding to the proxy container.

15. The apparatus according to claim 11 , wherein the controlling the data interaction between the API server and the controllers through the proxy container based on the traffic configuration rules further comprises:

in response to determining that the data does not conform to the traffic configuration rules, disallowing the controller corresponding to the proxy container to perform the data processing.

16. One or more memories storing thereon computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform acts comprising:

acquiring traffic configuration rules for controllers in a cluster by a central control component of the cluster, the cluster being a Kubernetes cluster;

sending the traffic configuration rules to a proxy container corresponding to each of the controllers; and

controlling a data interaction between an API server and the controllers through the proxy container based on the traffic configuration rules, the controlling the data interaction between the API server and the controllers through the proxy container based on the traffic configuration rules comprising:

sending data received by the proxy container to a controller corresponding to the proxy container;

in response to determining that the controller corresponding to the proxy container triggers data processing, calling an interface of the proxy container to determine that the data conforms to the traffic configuration rules; and

in response to determining that the data conforms to the traffic configuration rules, allowing the controller corresponding to the proxy container to perform a data processing.

17. The one or more memories of claim 16 , wherein before the controlling the data interaction between the API server and the controllers through the proxy container based on the traffic configuration rules, the acts further comprise:

receiving a data request instruction sent by at least one of the controllers through the proxy container;

sending the data request instruction to the API server through the proxy container; and

receiving data sent by the API server.

18. The one or more memories according to claim 16 , wherein the controlling the data interaction between the API server and the controllers through the proxy container based on the traffic configuration rules further comprises:

in response to determining that the data does not conform to the traffic configuration rules, disallowing the controller corresponding to the proxy container to perform the data processing.

19. The one or more memories according to claim 16 , wherein:

the traffic configuration rules comprise a global limit rule; and

after the sending the traffic configuration rules to the proxy container corresponding to each of the controllers, the acts further comprise:

intercepting a request that does not conform to the global limit rule by the proxy container; or

sending a request that conforms to the global limit rule to the API server.

20. The one or more memories according to claim 16 , wherein:

the traffic configuration rules comprise a sharding routing rule; and

after sending the traffic configuration rules to a proxy container corresponding to each of the controllers, the acts further comprise:

intercepting a webhook request from the API server by the proxy container;

determining that the webhook request conforms to the sharding routing rule of a current instance; and

forwarding the webhook request to a local webhook of the proxy container for processing.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 22, 2026
From: HANGZHOU ALICLOUD FEITIAN INFORMATION TECHNOLOGY CO., LTD.
To: CLOUD INTELLIGENCE ASSETS HOLDING (SINGAPORE) PRIVATE LIMITED
Reel/Frame 075437/0941 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 4, 2024
From: WANG, SIYU; DING, YU; ZHANG, ZHEN
To: ALIBABA (CHINA) CO., LTD.
Reel/Frame 067612/0986 →
Priority Claims (1)
CN 202110343763.6 · Mar 30, 2021 · national
Continuity (2)
Continuation PCTCN2022077746 · Feb 24, 2022
Related Publication 20240022629A1 · Jan 18, 2024