Node scheduling method, device, equipment and medium

Through the node scheduling method, select candidate nodes that support multiple network modes and deploy Pods, the problem of a single container cluster being compatible with CNI components that support multiple network modes is solved, and multi-mode network support for container clusters is realized.

CN116016162BActive Publication Date: 2025-05-16CHINA TELECOM CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211677950.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-26
Publication Date
2025-05-16
Estimated Expiration
2042-12-26

AI Technical Summary

Technical Problem

At this stage, there is a lack of a technical solution that enables a single container cluster to be compatible with CNI components that support multiple network modes.

Method used

Through the node scheduling method, the deployment request of the CNI component to be deployed is received, the node label is selected, the multiple candidate nodes of the node label include the first node label, the target deployment node is determined, and the to-deploy Pod is deployed to the target deployment node. The first node tag indicates that the node supports the network mode of the CNI components to be deployed.

Benefits of technology

It realizes the selection of the appropriate target deployment node in a single container cluster that supports CNI components that support multiple network modes, and successfully deploys the to-deploy Pods corresponding to the to-deployment CNI components to be deployed, so it is compatible with CNI components that support multiple network modes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116016162B_ABST
    Figure CN116016162B_ABST
Patent Text Reader

Abstract

The present application provides a node scheduling method, apparatus, device and medium, which relates to the field of cloud computing network technology. The method includes: receiving a deployment request for a CNI component to be deployed; in response to the deployment request, selecting multiple candidate nodes in a container cluster whose node labels include a first node label, wherein the first node label indicates that the node supports the network mode of the CNI component to be deployed; determining a target deployment node among the multiple candidate nodes; and deploying the Pod to be deployed corresponding to the CNI component to be deployed to the target deployment node. According to an embodiment of the present application, a single container cluster can be compatible with CNI components that support multiple network modes.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] In a cloud environment, cloud-native networks can have multiple CNI components corresponding to different network modes, such as a network mode based on VPC routing, a network mode based on ENI multiple auxiliary IPs, and a network mode based on multiple auxiliary network cards.

[0003] Since container network components (Conteinre Network Interface, CNI) in different network modes have different advantages and disadvantages, in some scenarios, a container cluster needs to be compatible with CNI components that support multiple network modes.

[0004] However, at present, there is a lack of a technical solution that can make a single container cluster compatible with CNI components that support multiple network modes.

[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0006] The present application provides a node scheduling method, apparatus, device and medium, which at least to some extent overcome the problem that a single container cluster cannot be compatible with CNI components that support multiple network modes.

[0007] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0008] According to one aspect of the present application, a node scheduling method is provided, including:

[0009] Receive a deployment request for the CNI component to be deployed;

[0010] In response to the deployment request, selecting, in the container cluster, a plurality of candidate nodes whose node labels include a first node label, where the first node label indicates that the node supports a network mode of the CNI component to be deployed;

[0011] Determine a target deployment node among multiple candidate nodes;

[0012] Deploy the Pod corresponding to the CNI component to be deployed to the target deployment node.

[0013] In one embodiment, in response to the deployment request, selecting multiple candidate nodes whose node labels include a first node label in the container cluster includes:

[0014] Get the network mode label of the workload of the Pod to be deployed, and use the network mode label as the first node label;

[0015] Node matching is performed among multiple nodes in the container cluster to obtain multiple nodes whose node labels include the first node label.

[0016] The multiple nodes obtained by matching are determined as candidate nodes.

[0017] In one embodiment, the method further comprises:

[0018] Establish at least one node pool for the nodes of the container cluster according to the network mode of the CNI component that the node expects to run itself, wherein the nodes in each node pool correspond to the same CNI component network mode;

[0019] For each node pool, a node label corresponding to the node pool is assigned to each node in the node pool.

[0020] In one embodiment, each node pool corresponds to a mutually exclusive set of network modes.

[0021] For each node of each node pool, the node includes: a mutually exclusive mode label corresponding to the mutually exclusive network mode in the mutually exclusive network mode set corresponding to the node pool.

[0022] In one embodiment, the node pool is: a multi-mode node pool supporting multiple network modes or a single-mode node pool supporting a single network mode.

[0023] In one embodiment, the method further comprises:

[0024] When a new node joins the container cluster, determine whether the node label of the new node includes a second node label that supports the network mode of the deployed CNI component;

[0025] When the node label of the new node includes the second node label, determining whether the new node is an optimal deployment node for the deployed CNI component;

[0026] When the new node is the optimal deployment node for the deployed CNI component, the deployed Pod of the deployed CNI component is scheduled from the current deployment node to the new node.

[0027] In one embodiment, determining a target deployment node from a plurality of candidate nodes includes:

[0028] Among multiple candidate nodes, filter out the non-selectable nodes that do not meet the preset filtering conditions to obtain at least one selectable node;

[0029] Among the at least one optional node, a node with the highest priority is selected as a target deployment node.

[0030] According to another aspect of the present application, a node scheduling device is provided, including:

[0031] A request receiving module, used to receive a deployment request of a CNI component to be deployed;

[0032] A candidate node selection module, configured to select, in response to a deployment request, a plurality of candidate nodes in the container cluster whose node labels include a first node label, where the first node label indicates that the node supports a network mode of the CNI component to be deployed;

[0033] A deployment node selection module is used to determine a target deployment node from multiple candidate nodes;

[0034] The Pod deployment module is used to deploy the Pod to be deployed corresponding to the CNI component to be deployed to the target deployment node.

[0035] According to another aspect of the present application, there is provided an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the above-mentioned node scheduling method by executing the executable instructions.

[0036] According to another aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned node scheduling method is implemented.

[0037] According to another aspect of the present application, a computer program product is provided, including a computer program, which implements the above-mentioned node scheduling method when executed by a processor.

[0038] The node scheduling method, apparatus, device and medium provided in the embodiments of the present application can select multiple candidate nodes whose node labels include a first node label from multiple nodes in the container cluster after receiving a deployment request for the CNI component to be deployed. Since the first node label indicates that the node supports the network mode of the CNI component to be deployed, correspondingly, multiple candidate nodes whose node labels include the first node label can all support the network mode of the component to be deployed, and the target deployment node selected from the candidate nodes can support the network mode of the CNI component to be deployed. Since the Pod to be deployed corresponding to the CNI component to be deployed can be deployed at the target deployment node that supports the network mode of the CNI component to be deployed, in the embodiments of the present application, a suitable target deployment node can be selected in a single container cluster that is compatible with CNI components that support multiple network modes to successfully deploy the Pod to be deployed corresponding to the CNI component to be deployed, thereby achieving compatibility of a single container cluster with CNI components that support multiple network modes.

[0039] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0041] Figure 1 A scheduling system provided by an embodiment of the present application is shown;

[0042] Figure 2 A schematic diagram of a process flow of an exemplary resource scheduling process provided in an embodiment of the present application is shown;

[0043] Figure 3 A schematic diagram showing a flow chart of a node scheduling method provided in an embodiment of the present application;

[0044] Figure 4 A schematic diagram of the structure of an exemplary node pool provided in an embodiment of the present application is shown;

[0045] Figure 5 A schematic diagram showing another exemplary resource scheduling process provided in an embodiment of the present application is shown;

[0046] Figure 6 A schematic diagram showing a flow chart of another node scheduling method provided in an embodiment of the present application;

[0047] Figure 7 A schematic diagram showing a flow chart of another node scheduling method provided in an embodiment of the present application;

[0048] Figure 8 A schematic diagram of a node scheduling device in an embodiment of the present application is shown;

[0049] Fig. 9 A structural block diagram of an electronic device according to an embodiment of the present application is shown; and

[0050] Fig.10 A schematic diagram of a computer-readable storage medium in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0051] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0052] In addition, the accompanying drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0053] It should be understood that the various steps described in the method implementation of the present application can be performed in different orders and / or performed in parallel. In addition, the method implementation may include additional steps and / or omit the steps shown. The scope of the present application is not limited in this respect.

[0054] It should be noted that the concepts such as "first" and "second" mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0055] It should be noted that the modifications of "one" and "plurality" mentioned in the present application are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0056] As described in the background technology, at present, there is a lack of a technical solution that can make a single container cluster compatible with CNI components that support multiple network modes.

[0057] Based on this, the embodiment of the present application provides a node scheduling solution that can be applied to cloud scenarios, such as cloud-native network scenarios. In the embodiment of the present application, a suitable target deployment node can be selected in a single container cluster that is compatible with CNI components that support multiple network modes to successfully deploy the Pod to be deployed corresponding to the CNI component to be deployed, thereby achieving compatibility with CNI components that support multiple network modes in a single container cluster.

[0058] Next, the technical solution provided in the embodiments of the present application is described.

[0059] Before introducing the technical solutions provided by the embodiments of the present application, the technical terms involved are first explained.

[0060] (1) Kubernetes, abbreviated as K8S, is an open source system for automatically deploying, scaling, and managing containerized applications. In other words, it is a container orchestration system used for container management and load balancing between containers.

[0061] (2) Pod, which is the smallest deployment unit in a Kubernetes cluster. A Pod consists of one or more containers. A Pod is the smallest unit that can be created and managed in a Kubernetes cluster. It is the smallest resource object model created or deployed by a user in the resource object model and is also the resource object for running containerized applications on Kubernetes.

[0062] A container can be understood as a special process that can divide resources, files, status, and configuration into an independent space. This independent space can be transferred to any host machine without affecting the operation of the software inside.

[0063] (3) Node: A managed independent host in a Kubernetes cluster, which can be a physical machine or a virtual machine. For example, a node can include a management node (Master) and a worker node (Worker).

[0064] (4) Container Network Interface (CNI), whose main function is to enable Pod resources to communicate across host machines.

[0065] In the working nodes of the Kubernetes cluster, you can add a CNI component corresponding to the network service cluster. This CNI component can connect the container instances deployed in the working nodes to the network service, so that the container instances can access other networks through the network service. The process of connecting the container instances deployed in the working nodes to the network service by the CNI component can occur at any stage of the life cycle of the container instance, realizing the decoupling of the container network configuration from the container life cycle, which helps to improve the flexibility of the container network configuration.

[0066] (5) Workload (Resource), which is one of the concepts of Kubernetes. Pods can be composed of scheduled tasks (cron jobs), deployments (deployments), daemon sets (daemonsets), etc. according to their types and combinations. These are collectively called workloads.

[0067] After introducing the above technical terms, in order to facilitate an overall understanding of the node scheduling solution provided in the embodiment of the present application, the scheduling system involved in the embodiment of the present application is first explained.

[0068] Figure 1 A scheduling system provided by an embodiment of the present application is shown. Figure 1 As shown, the scheduling system may include a scheduler 10 and a plurality of nodes 20 .

[0069] The scheduler 10 is one of the core components of the Kubernetes cluster. It is mainly responsible for the scheduling function of the entire cluster resources. It schedules the Pod to the optimal node 20 according to specific scheduling algorithms and strategies, so as to make more reasonable and full use of the cluster resources.

[0070] In order to understand the resource scheduling process of the scheduler as a whole, we will Figure 2 Let's take a specific example to illustrate.

[0071] Figure 2 FIG. 1 is a flow chart of an exemplary resource scheduling process provided by an embodiment of the present application. Figure 2 As shown, the scheduler can be divided into a pre-selection stage (Predecates) and a priority stage (Priorities) when scheduling.

[0072] In the pre-selection stage, nodes that do not meet the preset filtering conditions can be filtered out. Figure 2 As shown, in the pre-selected nodes, node 3 without sufficient resources can be filtered out, leaving node 1 and node 2.

[0073] In the optimization stage, the remaining nodes can be prioritized according to the priority to obtain the node priority ranking result. And, in the node priority ranking result, the node with the highest priority is selected to run the Pod. For example, continue to refer to Figure 2 , after the pre-selection phase, node 1 and node 2 are left, where the priority of node 1 is 2 and the priority of node 2 is 4. Since node 2 has a higher priority, node 4 can be selected to run the Pod.

[0074] After an overall introduction to the node scheduling process, the technical solution provided by the embodiments of the present application will be specifically described in conjunction with the accompanying drawings and embodiments.

[0075] First, a node scheduling method is provided in an embodiment of the present application, and the method can be executed by any electronic device with computing processing capabilities. For example, it can be executed by a scheduler of a Kubernetes cluster.

[0076] Figure 3 A schematic diagram of a node scheduling method provided in an embodiment of the present application is shown as follows: Figure 3 As shown, the node scheduling method provided in the embodiment of the present application includes the following steps S310 to S340.

[0077] S310: Receive a deployment request for a CNI component to be deployed.

[0078] In S310, the CNI component to be deployed may be a CNI component that needs to be deployed in a Kubernetes cluster, or may also be referred to as a CNI network component. In some embodiments, the CNI component in the embodiments of the present application may include a CNI component and its related services.

[0079] In some embodiments, the network mode of the CNI component to be deployed can be at least one of the following: a network mode based on VPC routing (VPC Route), a network mode based on ENI multiple auxiliary IPs (Multi-ENI IPs), a network mode based on multiple auxiliary network cards, a bridge (Bridge), a network card virtualization (IpVLan), etc.

[0080] S320: In response to the deployment request, select multiple candidate nodes in the container cluster whose node labels include a first node label, wherein the first node label indicates that the node supports a network mode of the CNI component to be deployed.

[0081] A node label is added to each node, and the node label is used to indicate the network mode of the CNI component that the node can support.

[0082] In some embodiments, a CNI component of a network mode corresponds to a node label, for example, a network mode based on VPC routing corresponds to a node label L1, and a network mode based on ENI multi-auxiliary IPs (Multi-ENI IPs) corresponds to a node label L2.

[0083] In some other embodiments, a node pool corresponds to a node label, and the nodes in the same node pool support the same network mode, and the network mode supported by the node pool is the network mode supported by the corresponding node label. Figure 4 FIG. 1 shows a schematic diagram of an exemplary node pool structure provided in an embodiment of the present application. Figure 4 As shown, node pool A corresponds to node label TagA, node pool B corresponds to node label TagB, ..., and so on, node pool N corresponds to node label TagN, where N is any positive integer. Exemplarily, node pool A supports network modes VPC Route and IPVlan, then node label TagA indicates compatibility with VPC Route and IPVlan.

[0084] For the first node label, in some embodiments, if the network mode of the CNI component to be deployed is network mode A, then the node label P1 indicating support for network mode A can be used as the first node label. In other embodiments, if the node label P2 indicates support for both network mode A and network mode B, and the node label P3 indicates support for both network mode A and network mode C, then the node label P2 and the node label P3 can be used as the first node label. Accordingly, a node whose node label includes the node label P2 and / or the node label P3 can be used as a candidate node.

[0085] In some embodiments, S320 may include the following steps A1 to A3.

[0086] Step A1, obtaining the network mode label of the workload of the Pod to be deployed, and using the network mode label as the first node label.

[0087] In step A1, the network mode label of the workload is used to indicate the network mode of the CNI component that the workload can support. The network mode label is similar to the node label, and the description of the node label in the above part of the embodiment of the present application can be referred to, which will not be repeated here.

[0088] In one example, Figure 5 FIG. 2 shows another exemplary resource scheduling process provided by an embodiment of the present application. Figure 5 As shown, a network mode label P1 can be added to the workload of the running Pod of the third-party CNI (i.e., the CNI component to be deployed).

[0089] Step A2: performing node matching among multiple nodes in the container cluster, and matching to obtain multiple nodes whose node labels include the first node label.

[0090] In step A2, the node may include one or more labels. For example, Figure 4 If the working node 01 belongs to the node pool A and the node pool N, the node labels TagA and TagN can be added to the working node 01.

[0091] In one example, see Figure 5 , since node 1 and node 2 are added with node label P1, node 1 and node 2 can be matched in step A2. Similarly, since the node label of node 3 does not contain node label P1, node 3 is considered unmatched and is removed.

[0092] Step A3: determine the multiple nodes obtained by matching as candidate nodes.

[0093] In one example, see Figure 5, after node 1 and node 2 are matched, node 1 and node 2 can be used as candidate nodes.

[0094] In S320, other methods may be used to select candidate nodes supporting the CNI component to be deployed from multiple nodes according to node labels. For example, the candidate nodes may be determined directly according to the network mode label corresponding to the network mode of the CNI component to be deployed. There is no specific limitation on this.

[0095] S330: Determine a target deployment node among multiple candidate nodes.

[0096] In some embodiments, S330 may include the following steps B1 and B2.

[0097] Step B1: Filter out the non-selectable nodes that do not meet the preset filtering conditions among multiple candidate nodes to obtain at least one selectable node.

[0098] In one embodiment, the preset filtering condition may be a condition that the selectable node needs to satisfy. Exemplarily, the preset filtering condition may include one or more of the filtering conditions corresponding to the following preset filtering algorithms 1-7.

[0099] Filtering algorithm 1, PodFitsResources, whether the remaining resources on the node are greater than the resources requested by the Pod. The filtering condition corresponding to this filtering algorithm may include that the remaining resources on the node are greater than the resources requested by the Pod.

[0100] Filtering algorithm 2, PodFitsHost, if the Pod specifies a node name (NodeName), check whether the node name matches the specified NodeName. The filtering condition corresponding to this filtering algorithm may include that the node name matches the specified NodeName.

[0101] Filtering algorithm 3, PodFitsHostPorts, whether the port already used on the node conflicts with the port applied for by the Pod. The filtering condition corresponding to this filtering algorithm may include that the port already used on the node does not conflict with the port applied for by the Pod.

[0102] Filtering algorithm 4, PodSelectorMatches, filters out nodes that do not match the label specified by the Pod. The filtering condition corresponding to this filtering algorithm may include that the node's label matches the label specified by the Pod.

[0103] Filtering algorithm 5, NoDiskConflict, the mounted volume does not conflict with the volume specified by the Pod, unless they are both read-only. The filtering condition corresponding to this filtering algorithm can include that the mounted volume does not conflict with the volume specified by the Pod.

[0104] Filtering algorithm 6, CheckNodeDiskPressure, checks whether the node disk space meets the requirements. The filtering condition corresponding to this filtering algorithm may include that the node disk space meets the requirements.

[0105] Filtering algorithm 7, CheckNodeMemoryPressure, checks whether the node memory is sufficient. The filtering condition corresponding to this filtering algorithm may include whether the node memory is sufficient.

[0106] It should be noted that in the embodiments of the present application, other preset filtering conditions may be set according to actual conditions and specific needs, and no specific limitation is imposed on this.

[0107] Step B2: Select a node with the highest priority from at least one optional node as a target deployment node.

[0108] S340, deploy the Pod to be deployed corresponding to the CNI component to be deployed to the target deployment node.

[0109] In S340, the CNI component to be deployed is deployed in the Pod to be deployed, and the Pod to be deployed can be run in the target deployment node. In some embodiments, the Pod to be deployed in the embodiment of the present application can include the Pod itself and the service (workload) derived from the Pod.

[0110] In some embodiments, the target deployment node may be a management node or a working node, without specific limitation.

[0111] The node scheduling method provided in the embodiment of the present application can select multiple candidate nodes whose node labels include a first node label from multiple nodes in the container cluster after receiving a deployment request for the CNI component to be deployed. Since the first node label indicates that the node supports the network mode of the CNI component to be deployed, accordingly, multiple candidate nodes whose node labels include the first node label can all support the network mode of the component to be deployed, and the target deployment node selected from the candidate nodes can support the network mode of the CNI component to be deployed. Since the Pod to be deployed corresponding to the CNI component to be deployed can be deployed at the target deployment node that supports the network mode of the CNI component to be deployed, in the embodiment of the present application, a suitable target deployment node can be selected in a single container cluster that is compatible with CNI components that support multiple network modes to successfully deploy the Pod to be deployed corresponding to the CNI component to be deployed, thereby achieving compatibility of a single container cluster with CNI components that support multiple network modes.

[0112] In some embodiments, Figure 6 FIG. 2 is a flow chart showing another node scheduling method provided by an embodiment of the present application. Figure 6 As shown, before S310, the node scheduling method may further include the step of assigning a node label to each node, namely the following steps S350 and S360. Exemplarily, the following steps S350 and S360 may be performed when a new cluster is created.

[0113] S350: Establish at least one node pool for the nodes of the container cluster according to the network mode of the CNI component that the node expects to run. The nodes in each node pool correspond to the same CNI component network mode. Figure 4 , the container cluster may include K management nodes (management nodes 01 to management nodes 0K) and M working nodes (working nodes 01 to working nodes 0M), where K and M are any positive integers. Then, N node pools, namely node pool A to node pool N, may be formed based on management nodes 01 to management nodes 0K and working nodes 01 to working nodes 0M.

[0114] In one embodiment, according to the number of CNI component network modes it supports, a node pool can be divided into: a multi-mode node pool that supports multiple network modes, and a single-mode node pool that supports a single network mode. Figure 4 , node pool B supports VPC Route and Bridge, that is, node pool B is a multi-mode node pool. For example, a single-mode node pool can be represented as a default node pool "default pool", and a single-mode node pool can default to a single network mode. By setting a single-mode node pool, container clusters such as Kubernetes clusters can be compatible with a single network mode.

[0115] S360: for each node pool, assign a node label corresponding to the node pool to each node in the node pool. Figure 4 , a node label TagA corresponding to node pool A can be assigned to each node in node pool A.

[0116] In one embodiment, each node pool corresponds to an exclusive network mode set ExclusiveSet. The exclusive network mode set represents the network modes that the nodes in the node pool cannot support. Exemplarily, the exclusive network mode set can be an empty set (i.e., it means that there are no exclusive network modes for the nodes in the node pool, such as Figure 4 ) or may include one or more mutually exclusive network modes, such as Figure 4 As shown in the mutually exclusive set of node pool B.

[0117] For each node of each node pool, the node includes: a mutually exclusive mode label corresponding to a mutually exclusive network mode in a mutually exclusive network mode set corresponding to the node pool. In some embodiments, when the node pool corresponds to mutually exclusive network mode A and mutually exclusive network mode B, the node label of the node pool can indicate mutual exclusion with mutually exclusive network mode A and mutually exclusive network mode B.

[0118] In one embodiment, when selecting candidate nodes, if the mutually exclusive mode label of a certain node indicates that it is mutually exclusive with the network mode of the CNI component to be deployed, the node can be removed from the candidate nodes. For example, if a certain node is added with a mutually exclusive mode label P1, the node can be removed from the candidate nodes. For another example, if the network mode of the CNI component to be deployed is Bridge, since the mutually exclusive network mode set of node pool A includes Bridge, the working node 03 with the node label TagA corresponding to node pool A can be removed from the candidate nodes.

[0119] In some embodiments, Figure 7 FIG. 2 is a flow chart showing another node scheduling method provided by an embodiment of the present application. Figure 7 As shown, the node scheduling method may further include the following steps S370 to S390.

[0120] S370: When a new node joins the container cluster, determine whether the node label of the new node includes a second node label that supports the network mode of the deployed CNI component.

[0121] It should be noted that the content of the second node label can refer to the relevant description of the first node label in the above part of the embodiment of the present application, and will not be repeated here.

[0122] For a deployed CNI component, it may be a CNI component that has been deployed on a node of a container cluster. Exemplarily, the CNI component may be a third-party CNI component.

[0123] S380: When the node label of the new node includes the second node label, determine whether the new node is an optimal deployment node for the deployed CNI component.

[0124] In some embodiments, if the new node meets the preset filtering conditions and the new node has the highest priority, the new node can be determined as the optimal deployment node for the deployed CNI component. The preset filtering conditions can be found in the above description of the embodiment of the present application in conjunction with step B1 and step B2, which will not be repeated here.

[0125] S390, when the new node is the optimal deployment node for the deployed CNI component, schedule the deployed Pod of the deployed CNI component from the current deployment node to the new node.

[0126] In S390, the deployed Pod may be a Pod with a deployed CNI component deployed.

[0127] Through the above steps S370 to S390, the CNI components in the container cluster can be reasonably scheduled when the node is expanded.

[0128] Furthermore, it should be noted that the technical solution provided by the embodiments of the present application may also have one or more of the following advantages.

[0129] Advantage 1: It ensures that multiple compatible CNI components and their related services can run on the same K8S node.

[0130] Advantage 2: It is compatible with various CNI components developed by third parties.

[0131] Advantage 3 solves the compatibility issues of CNI components in various cloud environments in terms of deployment and scaling. For example, in terms of deploying CNI components in container clusters, it provides automatic identification and deployment of CNI components based on node labels; in terms of scaling, when a new node is added, it automatically identifies and deploys the corresponding CNI component based on the label type of the newly added node.

[0132] Based on the same inventive concept, a node scheduling device is also provided in an embodiment of the present application, such as the following embodiment.

[0133] Figure 8 A schematic diagram of a node scheduling device in an embodiment of the present application is shown. Figure 8As shown, the node scheduling device 800 includes a request receiving module 810, a candidate node selection module 820, a deployment node selection module 830 and a Pod deployment module 840.

[0134] The request receiving module 810 is configured to receive a deployment request of a CNI component to be deployed.

[0135] The candidate node selection module 820 is used to select, in response to the deployment request, a plurality of candidate nodes in the container cluster whose node labels include a first node label, where the first node label indicates that the node supports a network mode of the CNI component to be deployed.

[0136] The deployment node selection module 830 is used to determine a target deployment node from multiple candidate nodes.

[0137] The Pod deployment module 840 is used to deploy the Pod to be deployed corresponding to the CNI component to be deployed to the target deployment node.

[0138] In one embodiment, the candidate node selection module 820 includes: a label processing unit, a node matching unit, and a node determination unit.

[0139] The label processing unit is used to obtain the network mode label of the workload of the Pod to be deployed, and use the network mode label as the first node label.

[0140] The node matching unit is used to perform node matching among multiple nodes in the container cluster, and match and obtain multiple nodes whose node labels include the first node label.

[0141] The node determination unit is used to determine the multiple nodes obtained by matching as candidate nodes.

[0142] In one embodiment, the node scheduling device 800 further includes: a node pool construction module and a label allocation module.

[0143] The node pool building module is used to establish at least one node pool for nodes of the container cluster according to the network mode of the CNI component that the node expects to run itself, wherein the nodes in each node pool correspond to the same CNI component network mode.

[0144] The label allocation module is used to allocate a node label corresponding to each node pool to each node in the node pool.

[0145] In one embodiment, each node pool corresponds to a set of mutually exclusive network modes.

[0146] For each node of each node pool, the node includes: a mutually exclusive mode label corresponding to the mutually exclusive network mode in the mutually exclusive network mode set corresponding to the node pool.

[0147] In one embodiment, the node pool is: a multi-mode node pool supporting multiple network modes or a single-mode node pool supporting a single network mode.

[0148] In one embodiment, the node scheduling device 800 further includes: a first judgment module, a second judgment module and a service scheduling module.

[0149] The first judgment module is used to judge whether the node label of the new node includes a second node label that supports the network mode of the deployed CNI component when the new node joins the container cluster.

[0150] The second judgment module is used to judge whether the new node is an optimal deployment node for the deployed CNI component when the node label of the new node includes the second node label.

[0151] The service scheduling module is used to schedule the deployed Pod of the deployed CNI component from the current deployment node to the new node when the new node is the optimal deployment node for the deployed CNI component.

[0152] In one embodiment, the deployment node selection module 830 includes: a node filtering unit and a node selection unit.

[0153] The node filtering unit is used to filter out the unselectable nodes that do not meet the preset filtering conditions from multiple candidate nodes to obtain at least one selectable node.

[0154] The node selection unit is used to select a node with the highest priority from at least one optional node as a target deployment node.

[0155] The node scheduling device provided in the embodiment of the present application can select multiple candidate nodes whose node labels include a first node label from multiple nodes in the container cluster after receiving a deployment request of the CNI component to be deployed. Since the first node label indicates that the node supports the network mode of the CNI component to be deployed, accordingly, multiple candidate nodes whose node labels include the first node label can all support the network mode of the component to be deployed, and the target deployment node selected from the candidate nodes can support the network mode of the CNI component to be deployed. Since the Pod to be deployed corresponding to the CNI component to be deployed can be deployed at the target deployment node that supports the network mode of the CNI component to be deployed, in the embodiment of the present application, a suitable target deployment node can be selected in a single container cluster that is compatible with CNI components that support multiple network modes to successfully deploy the Pod to be deployed corresponding to the CNI component to be deployed, thereby achieving compatibility of a single container cluster with CNI components that support multiple network modes.

[0156] It should be noted that Figure 8 The node scheduling device 800 shown can execute Figures 3 to 7The various steps in the method embodiment shown in the figure are implemented Figures 3 to 7 The various processes and effects in the method embodiment shown are not described in detail here.

[0157] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.

[0158] Refer to the following Fig. 9 hereinafter describes an electronic device 900 according to this embodiment of the present application. Fig. 9 The electronic device 900 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0159] like Fig. 9 As shown, the electronic device 900 is in the form of a general computing device. The components of the electronic device 900 may include but are not limited to: at least one processing unit 910, at least one storage unit 920, and a bus 930 connecting different system components (including the storage unit 920 and the processing unit 910).

[0160] The storage unit stores program codes, which can be executed by the processing unit 910, so that the processing unit 910 executes the steps described in the above “Exemplary Method” section of this specification according to various exemplary embodiments of the present application.

[0161] The storage unit 920 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 9201 and / or a cache storage unit 9202 , and may further include a read-only storage unit (ROM) 9203 .

[0162] The storage unit 920 may also include a program / utility 9204 having a set (at least one) of program modules 9205, such program modules 9205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0163] Bus 930 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0164] The electronic device 900 may also communicate with one or more external devices 940 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 900, and / or any device that enables the electronic device 900 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 950.

[0165] Furthermore, the electronic device 900 can also communicate with one or more networks (eg, a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through the network adapter 960 .

[0166] like Fig. 9 As shown, the network adapter 960 communicates with other modules of the electronic device 900 via the bus 930 .

[0167] It should be understood that although not shown in the figures, other hardware and / or software modules may be used in conjunction with the electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0168] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation methods of the present application.

[0169] In an exemplary embodiment of the present application, a computer-readable storage medium is further provided, which may be a readable signal medium or a readable storage medium. Fig.10 A schematic diagram of a computer-readable storage medium in an embodiment of the present application is shown. Fig.10 As shown, the computer-readable storage medium 1000 stores a program product capable of implementing the above-mentioned method of the present application.

[0170] In some possible implementations, various aspects of the present application may also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps of various exemplary implementations of the present application described in the above “Exemplary Method” section of this specification.

[0171] More specific examples of computer-readable storage media in the present application may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0172] In the present application, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof.

[0173] Readable signal media may also be any readable media other than readable storage media that can send, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.

[0174] In some examples, the program code contained on a computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0175] In specific implementation, the program code for performing the operation of the present application can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0176] Where a remote computing device is involved, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0177] The embodiment of the present application provides a computer program product or a computer program, which includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the node scheduling method provided in various optional ways in any embodiment of the present application.

[0178] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0179] In addition, although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0180] Through the description of the above implementation modes, it is easy for those skilled in the art to understand that the example implementation modes described here can be implemented by software, or by combining software with necessary hardware.

[0181] Therefore, the technical solution according to the implementation mode of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation mode of the present application.

[0182] Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein.

[0183] This application is intended to cover any variation, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application. The description and examples are considered to be exemplary only, and the true scope and spirit of the present application are indicated by the appended claims.

Claims

1. A node scheduling method, characterized in that: The method comprises: Receive a deployment request for the CNI component to be deployed; In response to the deployment request, selecting, in the container cluster, a plurality of candidate nodes whose node labels include a first node label, where the first node label indicates that the node supports a network mode of the CNI component to be deployed; Determining a target deployment node among the multiple candidate nodes; Deploy the Pod to be deployed corresponding to the CNI component to be deployed to the target deployment node; The method further comprises: Establish at least one node pool for the nodes of the container cluster according to the network mode of the CNI component that the node expects to run itself, wherein the nodes in each node pool correspond to the same CNI component network mode; For each node pool, a node label corresponding to the node pool is allocated to each node in the node pool.

2. The method according to claim 1, characterized in that In response to the deployment request, selecting, in the container cluster, a plurality of candidate nodes whose node labels include a first node label, comprises: Obtain a network mode label of the workload of the Pod to be deployed, and use the network mode label as the first node label; Performing node matching among the multiple nodes of the container cluster to obtain multiple nodes whose node labels include the first node label; The multiple nodes obtained by matching are determined as the candidate nodes.

3. The method according to claim 1, characterized in that Each node pool corresponds to a set of mutually exclusive network modes. For each node of each node pool, the node includes: a mutually exclusive mode label corresponding to a mutually exclusive network mode in a mutually exclusive network mode set corresponding to the node pool.

4. The method according to claim 3, characterized in that The node pool is: a multi-mode node pool supporting multiple network modes or a single-mode node pool supporting a single network mode.

5. The method according to claim 1, characterized in that The method further comprises: When a new node joins the container cluster, determining whether the node label of the new node includes a second node label that supports a network mode of the deployed CNI component; When the node label of the new node includes the second node label, determining whether the new node is an optimal deployment node for the deployed CNI component; When the new node is the optimal deployment node for the deployed CNI component, the deployed Pod of the deployed CNI component is scheduled from the current deployment node to the new node.

6. The method according to claim 1, characterized in that The determining of a target deployment node among the multiple candidate nodes includes: Among the multiple candidate nodes, filter out the non-selectable nodes that do not meet the preset filtering conditions to obtain at least one selectable node; Among the at least one optional node, a node with the highest priority is selected as the target deployment node.

7. A node scheduling device, characterized in that: include: A request receiving module, used to receive a deployment request of a CNI component to be deployed; A candidate node selection module, configured to select, in response to the deployment request, a plurality of candidate nodes in the container cluster whose node labels include a first node label, wherein the first node label indicates that the node supports a network mode of the CNI component to be deployed; A deployment node selection module, used to determine a target deployment node from among the multiple candidate nodes; A Pod deployment module, used to deploy the Pod to be deployed corresponding to the CNI component to be deployed to the target deployment node; A node pool building module, configured to establish at least one node pool for nodes of the container cluster according to a network mode of a CNI component that the node expects to run itself, wherein the nodes in each node pool correspond to the same CNI component network mode; The label allocation module is used to allocate a node label corresponding to each node pool to each node in the node pool.

8. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the node scheduling method described in any one of claims 1 to 6 by executing the executable instructions.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the node scheduling method described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Kubernetes Pod scheduling method based on multi-objective equilibrium optimization

    CN115022335A

  • Multi-network mode implementation method and device based on cloud native, equipment and medium

    CN115460075A