Container scheduling method and device, equipment, medium and program product

By monitoring the remaining number of network card slots of the work node in real time, automatically selecting the target node and determining the target slot, the service instance creation failure caused by container scheduling to cloud hosts with insufficient resources is solved, and efficient resource allocation is achieved.

CN119603306APending Publication Date: 2025-03-11JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411783406.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

In a multi-cloud environment, scheduling containers to cloud hosts with insufficient resources may cause service instance creation to fail, requiring manual operation and maintenance processing, and resource allocation efficiency is low.

Method used

By monitoring the remaining number of network card slots of the working node in real time, automatically selecting the target node and determining the target slot to achieve automatic access to the elastic network card.

Benefits of technology

It effectively reduces the failure of instance creation caused by insufficient number of remaining network card slots on the work node, and improves the flexibility and efficiency of resource allocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119603306A_ABST
    Figure CN119603306A_ABST
Patent Text Reader

Abstract

The invention provides a container scheduling method, device and equipment, a medium and a program product, which can be applied to the field of cloud computing. The method comprises the steps that in response to a network card configuration request of a shared container cluster for a target container, a target node corresponding to the target container is determined according to the remaining number of network card slots of each working node in the shared container cluster, and the remaining number of the network card slots is obtained through real-time monitoring of a resource monitor in the operation process of the working nodes; scheduling the target container to the target node, so as to determine a target card slot matched with the target container from a plurality of residual network card slots of the target node under the condition of successful scheduling; and connecting the created elastic network card corresponding to the target container to the target node based on the target card slot to complete network card configuration of the target container, the elastic network card being used for establishing network connection between the shared container cluster and the service platform.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of cloud computing technology, and more specifically, to a container scheduling method, device, equipment, medium, and program product. Background Art

[0002] In a multi-cloud environment, users will plan multiple VPC networks (Virtual Private Cloud) according to their functions. Some VPC networks are used to deploy the service platform control plane cluster, while others are used to deploy the container management cluster required for the service platform components. The working nodes in the container management cluster can use different types of cloud hosts. If the number of network card slots on the cloud host of the working node is insufficient, the relevant technology will expand the cloud host or schedule the container to other working nodes with sufficient elastic network card resources.

[0003] In the process of implementing the concept of the present disclosure, the inventors found that there are at least the following problems in the related technology: when facing changes in working node resources, if the container is scheduled to a cloud host with insufficient resources, it may cause the service instance to fail to create, so manual operation and maintenance are required, and the resource allocation efficiency is low. Summary of the invention

[0004] In view of this, the present disclosure provides a container scheduling method, apparatus, device, medium and program product.

[0005] One aspect of the present disclosure provides a container scheduling method, comprising: in response to a network card configuration request for a target container from a shared container cluster, determining a target node corresponding to the target container according to the remaining number of network card slots of each working node in the shared container cluster, wherein the remaining number of network card slots is obtained by real-time monitoring by the working node using a resource listener during operation, and the service resources of the shared container cluster are marked with exposure annotations for accessing a service platform; scheduling the target container to the target node, so as to determine a target card slot matching the target container from multiple remaining network card slots of the target node when the scheduling is successful; and connecting the created elastic network card corresponding to the target container to the target node based on the target card slot to complete the network card configuration of the target container, wherein the elastic network card is used to establish a network connection between the shared container cluster and the service platform.

[0006] According to an embodiment of the present disclosure, the container scheduling method also includes: obtaining a list of working nodes with remaining network card slots reported by the above-mentioned resource listener; determining the remaining number of network card slots of each working node based on the node names in the above-mentioned working node list; upon receiving the above-mentioned network card configuration request, reporting the node names with remaining network card slots and the corresponding remaining number of network card slots to the cluster scheduler; and adding a tag for characterizing the need to configure an elastic network card in the container resource configuration field of the above-mentioned target container, so that the above-mentioned cluster scheduler determines the corresponding target node for the above-mentioned target container based on the above-mentioned tag.

[0007] According to an embodiment of the present disclosure, the target container is scheduled to the target node to determine a target slot matching the target container from a plurality of remaining network card slots of the target node when the scheduling is successful, including: when the target node is determined to be obtained, the number of network card slots of the target node is deducted and updated to bind the target node to the target container; a corresponding container instance is created in the target node according to the container specification of the target container; and a remaining slot list of the target node is traversed to determine a target slot corresponding to the container instance from the plurality of remaining network card slots.

[0008] According to an embodiment of the present disclosure, based on the target card slot, the elastic network card corresponding to the target container is connected to the target node to complete the network card configuration of the target container, including: creating an elastic network card corresponding to the target container according to the routing address of the service platform; connecting the elastic network card to the cloud host of the target node, and configuring the elastic network card to the namespace of the target container to complete the network card configuration of the target container.

[0009] According to an embodiment of the present disclosure, the container scheduling method also includes: when determining that the above-mentioned shared container cluster is in the cloud lower layer mode, calculating the number of elastic network cards reserved for the container network interface plug-in for each of the above-mentioned working nodes in the above-mentioned shared container cluster; for each of the above-mentioned working nodes, according to the above-mentioned number of elastic network cards, determining the available network card slots in the above-mentioned working node, so as to configure the container based on the above-mentioned available network card slots.

[0010] According to an embodiment of the present disclosure, the above-mentioned calculation of the number of elastic network cards reserved for the container network interface plug-in of each of the above-mentioned working nodes in the above-mentioned shared container cluster includes: determining the estimated total number of containers corresponding to each of the above-mentioned working nodes; for each of the above-mentioned working nodes, taking the estimated total number of containers of the above-mentioned working node and the number of addresses supported by a single elastic network card as the quotient and integer, to obtain the above-mentioned number of elastic network cards, wherein the above-mentioned estimated total number of containers is greater than or equal to the number of external elastic network card devices on the above-mentioned working node.

[0011] According to an embodiment of the present disclosure, the container scheduling method also includes: applying for load balancing for the service resources of the shared container cluster on the service platform; mounting the elastic network card used by each container in the service resources to the load balancing of the service platform.

[0012] Another aspect of the present disclosure provides a container scheduling device, including: a node determination module, for responding to a network card configuration request of a shared container cluster for a target container, and determining a target node corresponding to the target container according to the remaining number of network card slots of each working node in the shared container cluster, wherein the remaining number of network card slots is obtained by real-time monitoring by the working node using a resource listener during operation, and the service resources of the shared container cluster are marked with exposure annotations for accessing a service platform; a container scheduling module, for scheduling the target container to the target node, so as to determine a target card slot matching the target container from a plurality of remaining network card slots of the target node when the scheduling is successful; and a network card connection module, for connecting the elastic network card created corresponding to the target container to the target node based on the target card slot, so as to complete the network card configuration of the target container, wherein the elastic network card is used to establish a network connection between the shared container cluster and the service platform.

[0013] Another aspect of the present disclosure provides an electronic device, including: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described above.

[0014] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the above method when executed.

[0015] Another aspect of the present disclosure provides a computer program product, the computer program product comprising computer executable instructions, and the instructions are used to implement the above method when executed.

[0016] According to the embodiments of the present disclosure, the target node is automatically selected for the target container according to the remaining number of network card slots of each working node, and the corresponding target card slot is determined, thereby realizing automatic access to the elastic network card. In the face of changes in working node resources, the problem of instance creation failure due to insufficient number of remaining network card slots of a certain working node is effectively reduced, the flexibility of resource allocation is improved, and the resource allocation efficiency is higher. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0018] Figure 1 An exemplary system architecture to which the container scheduling method and apparatus of the present disclosure can be applied is schematically shown;

[0019] Figure 2 A flowchart of a container scheduling method according to an embodiment of the present disclosure is schematically shown;

[0020] Figure 3 A schematic diagram schematically shows a service instance in a container scheduling method according to an embodiment of the present disclosure;

[0021] Figure 4 A schematic diagram of container scheduling in a container scheduling method according to an embodiment of the present disclosure is schematically shown;

[0022] Figure 5 The schematic diagram of elastic network card allocation in the container scheduling method according to an embodiment of the present disclosure is schematically shown;

[0023] Figure 6 A block diagram schematically shows a data processing device according to an embodiment of the present disclosure; and

[0024] Figure 7 A block diagram of an electronic device suitable for implementing a container scheduling method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0025] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0026] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0027] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0028] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0029] In the embodiments of the present disclosure, the collection, updating, analysis, processing, use, transmission, provision, disclosure, storage, etc. of the data involved (for example, including but not limited to user personal information) are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security, and national security.

[0030] In the embodiments of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.

[0031] Instance operation and deployment Most customers now choose to use container cluster management systems to manage containers. Each container management cluster needs to deploy at least three master nodes and three nodes responsible for storing and synchronizing the status information of the container management cluster to ensure a three-zone deployment architecture.

[0032] Demand scenario 1: If a container management cluster is created under each VPC, it will cause waste of management and control plane resources and increase operation and maintenance costs.

[0033] Scenario 2: Operations and maintenance want the container management cluster to occupy as few subnet address resources as possible, so they choose to use the cloud upper layer mode to manage the container network in the cluster and create a container management cluster. However, containers in some instances need to communicate directly with the external cloud network.

[0034] Therefore, in scenario 1, you can consider using an architecture that allows multiple VPCs in a tenant to share a container management cluster. The shared container management cluster uses a separate service VPC, and other VPCs connect and forward cross-VPC traffic by inserting the elastic network card of their own VPC subnet into the working node (cloud host) of the container management cluster's VPC. The elastic network card products of multiple public cloud vendors support this function.

[0035] In scenario 2, you need to configure network cards for these instances that can communicate with the external subnet so that they can communicate with the container.

[0036] Regardless of scenario 1 or scenario 2, elastic network cards are a necessary resource for the successful creation of service instances. The working nodes of the container management cluster on the public cloud use public cloud host products. Different types of cloud hosts are limited by the underlying physical resources and have different restrictions on the number of elastic network card slots. For example, type 1 cloud hosts support 4 card slots, and type 2 cloud hosts support 8 card slots. If a network card is occupied, the amount of resources will be reduced. Resource limitations and uneven resource distribution have a certain impact on container scheduling. If a container is scheduled to a cloud host with insufficient resources, it may cause the service instance to fail to create and require manual operation and maintenance.

[0037] Manual intervention is required to expand the capacity of the cloud host or delete the container to schedule it to other working nodes with sufficient elastic network card resources. The flexibility is relatively poor. Multiple service instances may be created on the shared container cluster, and each instance occupies different resources. This places high demands on the initial planning of the operation and maintenance personnel, increasing the labor cost.

[0038] The embodiments of the present disclosure provide a container scheduling method, device, equipment, medium and program product. The method includes: responding to a network card configuration request of a shared container cluster for a target container, determining a target node corresponding to the target container according to the remaining number of network card slots of each working node in the shared container cluster, wherein the remaining number of network card slots is obtained by real-time monitoring of the working node using a resource listener during operation, and the service resources of the shared container cluster are marked with exposure annotations for accessing a service platform; scheduling the target container to the target node, so as to determine a target card slot that matches the target container from a plurality of remaining network card slots of the target node when the scheduling is successful; based on the target card slot, connecting the elastic network card created corresponding to the target container to the target node to complete the network card configuration of the target container, wherein the elastic network card is used to establish a network connection between the shared container cluster and the service platform.

[0039] Figure 1 The following schematically shows an exemplary system architecture to which the container scheduling method and apparatus disclosed herein can be applied. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.

[0040] like Figure 1As shown, the system architecture 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0041] The user may use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software, etc. (only for example).

[0042] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0043] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0044] It should be noted that the container scheduling method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the container scheduling device provided in the embodiment of the present disclosure can generally be set in the server 105. The container scheduling method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Correspondingly, the container scheduling device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Alternatively, the container scheduling method provided in the embodiment of the present disclosure can also be executed by the first terminal device 101, the second terminal device 102 or the third terminal device 103, or can also be executed by other terminal devices different from the first terminal device 101, the second terminal device 102 or the third terminal device 103. Accordingly, the container scheduling device provided in the embodiment of the present disclosure may also be arranged in the first terminal device 101, the second terminal device 102 or the third terminal device 103, or in other terminal devices different from the first terminal device 101, the second terminal device 102 or the third terminal device 103.

[0045] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0046] Figure 2 The flowchart of the container scheduling method according to an embodiment of the present disclosure is schematically shown.

[0047] like Figure 2 As shown, the method includes operations S210 to S230.

[0048] In operation S210, in response to the shared container cluster's request for configuring a network card for the target container, a target node corresponding to the target container is determined according to the remaining number of network card slots of each working node in the shared container cluster, wherein the remaining number of network card slots is obtained by real-time monitoring by the working node using a resource listener during operation, and the service resources of the shared container cluster are marked with exposure annotations for accessing the service platform.

[0049] In operation S220 , the target container is scheduled to the target node, so that if the scheduling is successful, a target card slot matching the target container is determined from a plurality of remaining network card slots of the target node.

[0050] In operation S230, based on the target card slot, the created elastic network card corresponding to the target container is connected to the target node to complete the network card configuration of the target container, wherein the elastic network card is used to establish a network connection between the shared container cluster and the service platform.

[0051] According to an embodiment of the present disclosure, in a multi-cloud environment, the hybrid cloud management service platform will manage public cloud clusters. Users will create multiple types of container management clusters according to different functions, including multiple public cloud clusters, and create corresponding application instances. Specifically, users may plan multiple VPC networks according to functions, and these VPCs belong to the same tenant. Some of the VPCs are used to deploy the service platform control plane cluster, and some VPCs are used to deploy the container management clusters required by the service platform components.

[0052] According to an embodiment of the present disclosure, the working nodes in the container management cluster can use different types of cloud hosts. If the number of network card slots on the cloud host of the working node is insufficient, the service platform instance creation will fail. Therefore, consider using a cluster architecture that uses multiple VPCs to share containers. Specifically, using public cloud network components, the external elastic network card is automatically configured on demand based on the access protocol in the container cluster operation and maintenance mode. The external network card is registered as a schedulable device based on the device plug-in mechanism to control the scheduling of the container.

[0053] According to the embodiments of the present disclosure, the shared container cluster is set in the tenant's private network, and the service platform is set in the tenant's application private network, and the two have the same network area. In addition, the private network of the shared container cluster needs to plan an independent network segment, which cannot overlap with the network segment of the application private network. The application private network is used to establish the user company's homepage, e-commerce platform and other applications, which belong to the user of the service platform.

[0054] Figure 3 A schematic diagram of a service instance in a container scheduling method according to an embodiment of the present disclosure is schematically shown.

[0055] According to an embodiment of the present disclosure, a subnet is created in the application private network, and a service instance is created under this subnet through the console of the service platform. At the same time, the console creates the service instance on the shared container cluster. Since the application in the application private network subnet needs to access the entrance of this service instance, the service instance needs to expose the accessible domain name to this subnet, and the service resources of the shared container cluster are marked with an exposure annotation for accessing the service platform.

[0056] like Figure 3As shown, a subnet 311 is created in the application private network 310, and a service instance 312 is under the subnet 311. The service instance 312 includes a load balancer 313 and a security group 314. The load balancer 313 is a technology that evenly distributes network traffic or requests to multiple servers, and the security group 314 is a virtual firewall that controls the network traffic in and out of the server. The two work together to ensure high availability and security of the service.

[0057] According to an embodiment of the present disclosure, in response to a network card configuration request of a shared container cluster for a target container, the remaining number of network card slots of each working node in the shared container cluster obtained by real-time monitoring by a resource listener is obtained. The target node corresponding to the target container is determined according to the number of network card slots. Specifically, the working node with the largest number of network card slots can be determined as the target node, or it can be determined according to the operating status of each working node combined with the number of network card slots.

[0058] According to an embodiment of the present disclosure, the target container is scheduled to the working node, and the target container is marked to indicate that the target container needs to apply for a network card slot. If the scheduling is successful, the target card slot is randomly determined from the multiple remaining network card slots in the working node. An elastic network card is created and configured for the target container to connect the private network of the shared container cluster and the application private network of the service platform.

[0059] According to an embodiment of the present disclosure, an elastic network card is connected to a target node based on a target card slot to complete the network card configuration of a target container. The management of an external elastic network card can be managed by a network controller or by a device plug-in controller in a shared container cluster. Specifically, in the process of management by a device plug-in controller, the node agent module sends an allocation request of an elastic network card to the device plug-in controller to manage it.

[0060] According to the embodiments of the present disclosure, the target node is automatically selected for the target container according to the remaining number of network card slots of each working node, and the corresponding target card slot is determined, thereby realizing automatic access to the elastic network card. In the face of changes in working node resources, the problem of instance creation failure due to insufficient number of remaining network card slots of a certain working node is effectively reduced, the flexibility of resource allocation is improved, and the resource allocation efficiency is higher.

[0061] According to an embodiment of the present disclosure, the container scheduling method also includes: obtaining a list of working nodes with remaining network card slots reported by a resource listener; determining the remaining number of network card slots of each working node based on the node names in the working node list; upon receiving a network card configuration request, reporting the node names with remaining network card slots and the corresponding remaining number of network card slots to a cluster scheduler; and adding a tag to the container resource configuration field of the target container to indicate that an elastic network card needs to be configured, so that the cluster scheduler determines the corresponding target node for the target container based on the tag.

[0062] According to an embodiment of the present disclosure, a service platform instance on a shared container cluster adds an exposed annotation to the service resources that need to be exposed. A custom resource definition is set for each resource of the elastic network card, load balancing, domain name, and security group on the platform instance. The network controller, also known as the resource listener, monitors changes in service resources and containers, elastic network cards, load balancing, domain names, and security groups.

[0063] According to an embodiment of the present disclosure, a network controller daemon container is provided on each working node in a shared container cluster, and the device plug-in controller in the network controller daemon container reports a list of working nodes with remaining network card slots to the node agent module through a list observation mechanism when it is started. The network controller daemon container is responsible for configuring the necessary routing for the external elastic network card of the working node, accessing the device plug-in interface, communicating with the node agent module of the working node, registering the number of devices, and allocating devices.

[0064] According to the embodiment of the present disclosure, after the node agent module gets the list, it adds the remaining number of network card slots in the form of extended resources and reports it to the cluster scheduler. At this time, the resource capacity of the cluster scheduler displays xxxx / enic: num. Among them, xxxx represents the working node, enic represents the network card slot, and num represents the remaining number of network card slots.

[0065] According to an embodiment of the present disclosure, a tag for indicating that an elastic network card needs to be configured is added to the container resource configuration field of the target container that needs to configure an elastic network card. Specifically, the statement xxxx / enic:1 can be added. The cluster scheduler searches for a working node with a satisfying number of enic as the target node for the target container based on the tag. When a network card configuration request is received, a working node is selected for the target container through a list of working nodes reported in real time, so that reasonable allocation of resources can be achieved.

[0066] According to an embodiment of the present disclosure, a target container is scheduled to a target node, so that when the scheduling is successful, a target card slot matching the target container is determined from a plurality of remaining network card slots of the target node, including: when the target node is determined to be obtained, the number of network card slots of the target node is deducted and updated to bind the target node to the target container; a corresponding container instance is created in the target node according to the container specification of the target container; and a remaining card slot list of the target node is traversed to determine a target card slot corresponding to the container instance from a plurality of remaining network card slots.

[0067] According to an embodiment of the present disclosure, when the target node is determined to be obtained, the number of network card slots of the target node is deducted by 1 to complete the binding of the target node and the target container. After the target container is successfully scheduled, the node agent module starts to create the corresponding container instance. According to the previously marked mark, if it is found that this target container needs to apply for a network card slot, one will be taken from the remaining card slot list of the target node, and an allocation request will be sent to the device plug-in controller.

[0068] According to an embodiment of the present disclosure, after receiving the allocation request, the device plug-in controller does not take any action. The actual management of the external elastic network card is managed by the network controller, and subsequent operations are continued by the network controller. By binding the target node to the target container and determining the corresponding target card slot, the elastic network card can be automatically accessed.

[0069] According to an embodiment of the present disclosure, based on the target card slot, the elastic network card created corresponding to the target container is connected to the target node to complete the network card configuration of the target container, including: creating an elastic network card corresponding to the target container according to the routing address of the service platform; connecting the elastic network card to the cloud host of the target node, and configuring the elastic network card to the namespace of the target container to complete the network card configuration of the target container.

[0070] According to an embodiment of the present disclosure, the network controller creates and configures an elastic network card for the target container to connect the private network of the shared container cluster and the application private network of the service platform. The elastic network card applied for belongs to the application private network, and an address in the routing address of the subnet of the application private network is used to create the elastic network card.

[0071] According to an embodiment of the present disclosure, the network controller connects the elastic network card to the cloud host of the scheduled target node. Then the elastic network card is configured under the namespace of the target container to complete the network card configuration of the target container. In the face of changes in the working node resources, the elastic network card is automatically connected to improve the flexibility of resource allocation and make resource allocation more efficient.

[0072] According to an embodiment of the present disclosure, the container scheduling method also includes: when determining that the shared container cluster is in the cloud lower layer mode, calculating the number of elastic network cards reserved for the container network interface plug-in in each working node in the shared container cluster; for each working node, determining the available network card slots in the working node according to the number of elastic network cards, so as to configure the container based on the available network card slots.

[0073] According to an embodiment of the present disclosure, when the target container of the external elastic network card is scheduled to the target node, it will occupy the resource of one address of one network card. The container network interface plug-in also needs to support the address resources of the container to be scheduled by the shared container cluster, so the currently scheduled working node needs to have sufficient address resources to configure the address of the container. Specifically, the container network interface plug-in in the cloud upper layer mode needs to occupy network card resources, while the cloud lower layer mode does not need to occupy the elastic network card. The amount of address resources required by the container network interface plug-in in the cloud upper layer mode is the number of elastic network cards reserved for the container network interface plug-in * the number of auxiliary addresses supported by a single network card.

[0074] According to an embodiment of the present disclosure, after the container network interface plug-in completes the configuration of the container network of the container, that is, after the cluster scheduler schedules the container to the appropriate working node and configures the address of the container, the external elastic network card is not created at this time. When a network card configuration request is received, the available network card slots in the working node are determined by determining the number of elastic network cards, so as to configure the target container based on the available network card slots. By calculating the number of elastic network cards, the resource allocation process is more reasonable.

[0075] According to an embodiment of the present disclosure, the number of elastic network cards reserved for the container network interface plug-in of each working node in the shared container cluster is calculated, including: determining the estimated total number of containers corresponding to each working node; for each working node, taking the estimated total number of containers of the working node and the number of addresses supported by a single elastic network card as the quotient and integer, to obtain the number of elastic network cards, wherein the estimated total number of containers is greater than or equal to the number of external elastic network card devices on the working node.

[0076] According to the embodiment of the present disclosure, assuming that the number of addresses supported by a single network card is 20, and the total number of estimated containers in a working node is 110, the number of elastic network cards can be calculated to be 5. The estimated total number of containers is greater than or equal to the number of external elastic network card devices, because not every container in a working node needs to apply for an elastic network card. By calculating the number of elastic network cards, the resource allocation process is more reasonable.

[0077] Figure 4 A schematic diagram of container scheduling in a container scheduling method according to an embodiment of the present disclosure is schematically shown.

[0078] like Figure 4As shown, the shared container cluster includes node 1 and node 2 and a cluster scheduler 401. For node 1, node 1 includes multiple containers 402 and multiple network card slots 403. Among them, a corresponding external network card slot 404 is also reserved in node 1 for the container network interface plug-in.

[0079] During the container scheduling process, the device plug-in controller in the network controller daemon container 405 reports the list of working nodes with remaining network card slots to the node agent module 406 through the list observation mechanism when it is started. After the node agent module 406 obtains the list, it adds the remaining number of network card slots in the form of extended resources and reports it to the cluster scheduler 407. Among them, the cluster scheduler 401 establishes a connection with the interface server 407 and is responsible for receiving and processing all requests from users, internal components and external tools.

[0080] When the interface server 407 receives the network card configuration request, it determines the target node corresponding to the target container according to the remaining number of network card slots, and schedules the target container to the target node. After the scheduling is successful, the node agent module 406 starts to create the corresponding container instance. It is found that the target container needs to apply for a network card slot, and one is taken out from the remaining card slot list, and an allocation request is sent to the device plug-in controller 408. At the same time, the node agent module 406 configures the corresponding port for the container instance, realizing the automatic configuration of the elastic network card.

[0081] According to the embodiments of the present disclosure, the automatic access of elastic network cards by container scheduling improves the flexibility of resource allocation and makes resource allocation more efficient.

[0082] Figure 5 The figure schematically shows a schematic diagram of elastic network card allocation in the container scheduling method according to an embodiment of the present disclosure.

[0083] According to an embodiment of the present disclosure, the container scheduling method also includes: applying for load balancing for service resources of a shared container cluster on a service platform; and mounting the elastic network card used by each container in the service resources to the load balancing of the service platform.

[0084] According to the embodiments of the present disclosure, after the elastic network card is configured, load balancing will be applied in the application private network of the service platform, and the elastic network card used by all backend containers in the shared container cluster service resources will be mounted to the load balancing of the application private network to achieve the connection and forwarding of traffic across my network.

[0085] like Figure 5As shown, there are two VPC networks for container scheduling, one is tenant 1's private network 501, and the shared container cluster is under this VPC. The other is tenant 1's application private network 502, which is used to create service instances. These two VPCs are in the same region. After the elastic network card 503 is configured, the corresponding load balancer 505 will be applied under the service instance 504 of the service platform. After the application is completed, the elastic network card 503 is mounted on the load balancer 505 to realize the network connection between the shared container cluster and the service platform.

[0086] Figure 6 The block diagram schematically shows a data processing device according to an embodiment of the present disclosure.

[0087] like Figure 6 As shown, the container scheduling device 600 includes a node determination module 610 , an identity recognition container scheduling module 620 , and a network card connection module 630 .

[0088] The node determination module 610 is used to respond to the network card configuration request of the shared container cluster for the target container, and determine the target node corresponding to the target container according to the remaining number of network card slots of each working node in the shared container cluster, wherein the remaining number of network card slots is obtained by real-time monitoring by the working node using the resource listener during operation, and the service resources of the shared container cluster are marked with exposure annotations for accessing the service platform.

[0089] The container scheduling module 620 is used to schedule the target container to the target node, so as to determine a target card slot matching the target container from a plurality of remaining network card slots of the target node if the scheduling is successful.

[0090] The network card connection module 630 is used to connect the elastic network card corresponding to the target container to the target node based on the target card slot to complete the network card configuration of the target container, wherein the elastic network card is used to establish a network connection between the shared container cluster and the service platform.

[0091] According to an embodiment of the present disclosure, the container scheduling device 600 further includes a list acquisition module, a quantity determination module, a quantity reporting module, and a container marking module.

[0092] The list acquisition module is used to obtain the list of working nodes with remaining network card slots reported by the resource listener.

[0093] The quantity determination module is used to determine the remaining number of network card slots of each working node according to the node name in the working node list.

[0094] The quantity reporting module is used to report the node names with remaining network card slots and the corresponding remaining quantity of network card slots to the cluster scheduler when receiving a network card configuration request.

[0095] The container tag module is used to add a tag for indicating that an elastic network card needs to be configured in the container resource configuration field of the target container, so that the cluster scheduler determines the corresponding target node for the target container based on the tag.

[0096] According to an embodiment of the present disclosure, the container scheduling module 620 includes a quantity deduction submodule, an instance creation submodule, and a slot determination submodule.

[0097] The quantity deduction submodule is used to deduct and update the number of network card slots of the target node when the target node is determined to be obtained, so as to bind the target node to the target container.

[0098] The instance creation submodule is used to create a corresponding container instance in the target node according to the container specification of the target container.

[0099] The slot determination submodule is used to traverse the remaining slot list of the target node to determine the target slot corresponding to the container instance from the multiple remaining network card slots.

[0100] According to an embodiment of the present disclosure, the network card connection module 630 includes a network card creation submodule and a network card configuration submodule.

[0101] The network card creation submodule is used to create an elastic network card corresponding to the target container according to the routing address of the service platform.

[0102] The network card configuration submodule is used to connect the elastic network card to the cloud host of the target node and configure the elastic network card to the namespace of the target container to complete the network card configuration of the target container.

[0103] According to an embodiment of the present disclosure, the container scheduling device 600 further includes a quantity calculation module and a container configuration module.

[0104] The quantity calculation module is used to calculate the number of elastic network cards reserved for the container network interface plug-in of each working node in the shared container cluster when it is determined that the shared container cluster is in the cloud lower layer mode.

[0105] The container configuration module is used to determine the available network card slots in each working node according to the number of elastic network cards, so as to configure the container based on the available network card slots.

[0106] According to an embodiment of the present disclosure, the quantity calculation module includes an estimation determination submodule and a quantity calculation submodule.

[0107] The estimated determination submodule is used to determine the estimated total number of containers corresponding to each working node.

[0108] The quantity calculation submodule is used to calculate the quotient of the estimated total number of containers of the working node and the number of addresses supported by a single elastic network card for each working node, and then obtain the number of elastic network cards by rounding the quotient, where the estimated total number of containers is greater than or equal to the number of external elastic network card devices on the working node.

[0109] According to an embodiment of the present disclosure, the container scheduling device 600 further includes a load application module and a network card mounting module.

[0110] The load application module is used to apply for load balancing for the service resources of the shared container cluster on the service platform.

[0111] The network card mounting module is used to mount the elastic network card used by each container in the service resources to the load balancing of the service platform.

[0112] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging circuits, or can be implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.

[0113] For example, any multiple of the node determination module 610, the identity identification container scheduling module 620, and the network card connection module 630 can be combined in one module / unit / sub-unit for implementation, or any one of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more of these modules / units / sub-units can be combined with at least part of the functions of other modules / units / sub-units and implemented in one module / unit / sub-unit. According to an embodiment of the present disclosure, at least one of the node determination module 610, the identity identification container scheduling module 620, and the network card connection module 630 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware or in an appropriate combination of any of them. Alternatively, at least one of the node determination module 610, the identity identification container scheduling module 620, and the network card connection module 630 may be at least partially implemented as a computer program module, and when the computer program module is executed, the corresponding function may be executed.

[0114] It should be noted that the container scheduling device part in the embodiment of the present disclosure corresponds to the container scheduling method part in the embodiment of the present disclosure. The description of the container scheduling device part specifically refers to the container scheduling method part, which will not be repeated here.

[0115] Figure 7 A block diagram of an electronic device suitable for implementing an item management method according to an embodiment of the present disclosure is schematically shown. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0116] like Figure 7 As shown, the electronic device 700 according to an embodiment of the present disclosure includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 to a random access memory (RAM) 703. The processor 701 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 701 may also include an onboard memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0117] In RAM 703, various programs and data required for the operation of electronic device 700 are stored. Processor 701, ROM 702 and RAM 703 are connected to each other via bus 704. Processor 701 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 702 and / or RAM 703. It should be noted that the program can also be stored in one or more memories other than ROM 702 and RAM 703. Processor 701 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in one or more memories.

[0118] According to an embodiment of the present disclosure, the electronic device 700 may further include an input / output (I / O) interface 705, which is also connected to the bus 704. The electronic device 700 may further include one or more of the following components connected to the input / output (I / O) interface 705: an input portion 706 including a keyboard, a mouse, etc.; an output portion 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 708 including a hard disk, etc.; and a communication portion 709 including a network interface card such as a LAN card, a modem, etc. The communication portion 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the input / output (I / O) interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage portion 708 as needed.

[0119] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the processor 701, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.

[0120] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0121] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include but is not limited to: 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), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.

[0122] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 702 and / or the RAM 703 described above and / or one or more memories other than the ROM 702 and the RAM 703 .

[0123] The embodiments of the present disclosure also include a computer program product, which includes a computer program, and the computer program contains a program code for executing the method provided by the embodiments of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the container scheduling method provided by the embodiments of the present disclosure.

[0124] When the computer program is executed by the processor 701, the above functions defined in the system / device of the embodiment of the present disclosure are executed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0125] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 709, and / or installed from the removable medium 711. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0126] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can 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 can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).

[0127] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments of the present disclosure can be combined and / or combined in a variety of ways, even if such a combination or combination is not explicitly recorded in the present disclosure. In particular, without departing from the spirit and teaching of the present disclosure, the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0128] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A container scheduling method, comprising: In response to a network card configuration request of a shared container cluster for a target container, a target node corresponding to the target container is determined according to the remaining number of network card slots of each working node in the shared container cluster, wherein the remaining number of network card slots is obtained by real-time monitoring by the working node using a resource listener during operation, and the service resources of the shared container cluster are marked with an exposure annotation for accessing a service platform; Scheduling the target container to the target node, so that if the scheduling is successful, a target card slot matching the target container is determined from a plurality of remaining network card slots of the target node; Based on the target card slot, the elastic network card created corresponding to the target container is connected to the target node to complete the network card configuration of the target container, wherein the elastic network card is used to establish a network connection between the shared container cluster and the service platform.

2. The method according to claim 1, further comprising: Obtain a list of working nodes with remaining network card slots reported by the resource listener; Determine the remaining number of network card slots of each working node according to the node name in the working node list; Upon receiving the network card configuration request, the node names of the nodes with remaining network card slots and the corresponding remaining number of network card slots are reported to the cluster scheduler; A tag indicating that an elastic network card needs to be configured is added to the container resource configuration field of the target container, so that the cluster scheduler determines a corresponding target node for the target container based on the tag.

3. The method according to claim 1, wherein: The step of scheduling the target container to the target node, and determining a target card slot matching the target container from a plurality of remaining network card slots of the target node if the scheduling is successful, includes: When it is determined that the target node is obtained, the number of network card slots of the target node is deducted and updated to bind the target node to the target container; Creating a corresponding container instance in the target node according to the container specification of the target container; The remaining card slot list of the target node is traversed to determine a target card slot corresponding to the container instance from the plurality of remaining network card slots.

4. The method according to claim 1, wherein: The step of connecting the created elastic network card corresponding to the target container to the target node based on the target card slot to complete the network card configuration for the target container includes: Creating an elastic network card corresponding to the target container according to the routing address of the service platform; The elastic network card is connected to the cloud host of the target node, and the elastic network card is configured in the namespace of the target container to complete the network card configuration of the target container.

5. The method according to claim 1, further comprising: When it is determined that the shared container cluster is in the cloud lower layer mode, the number of elastic network cards reserved for the container network interface plug-in of each working node in the shared container cluster is calculated; For each of the working nodes, the available network card slots in the working node are determined according to the number of the elastic network cards, so as to configure the container based on the available network card slots.

6. The method according to claim 5, wherein: The calculating the number of elastic network cards reserved for the container network interface plug-in by each of the working nodes in the shared container cluster includes: Determining an estimated total number of containers corresponding to each of the working nodes; For each of the working nodes, the estimated total number of containers of the working node is divided by the number of addresses supported by a single elastic network card and the integer is taken to obtain the number of elastic network cards, wherein the estimated total number of containers is greater than or equal to the number of external elastic network card devices on the working node.

7. The method according to claim 1, further comprising: Applying load balancing for service resources of the shared container cluster on the service platform; The elastic network card used by each container in the service resource is mounted to the load balancing of the service platform.

8. A container scheduling device, comprising: A node determination module, configured to respond to a network card configuration request of a shared container cluster for a target container, and determine a target node corresponding to the target container according to the remaining number of network card slots of each working node in the shared container cluster, wherein the remaining number of network card slots is obtained by real-time monitoring by the working node using a resource listener during operation, and the service resources of the shared container cluster are marked with an exposure annotation for accessing a service platform; A container scheduling module, used to schedule the target container to the target node, so as to determine a target card slot matching the target container from a plurality of remaining network card slots of the target node if the scheduling is successful; A network card connection module is used to connect the elastic network card created corresponding to the target container to the target node based on the target card slot to complete the network card configuration of the target container, wherein the elastic network card is used to establish a network connection between the shared container cluster and the service platform.

9. An electronic device, comprising: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method according to any one of claims 1 to 7.

11. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.