Container deployment method and device

By introducing virtual machine objects on physical machines for resource isolation, the problem of insufficient resource isolation capabilities when deploying containers on physical machines is solved, and the container running performance and resource utilization are improved.

CN118555218APending Publication Date: 2024-08-27HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310209859.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-27
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

When deploying containers on physical machines, resource isolation capabilities are insufficient, resulting in performance overhead caused by CPU context switching and affecting container running performance.

Method used

By introducing the virtual machine (vHost) object for resource isolation, the master node determines the vHost object that meets the resource requirements based on the deployment request, and schedules the container to run in the vHost object to avoid context switching on all CPUs on the physical machine.

Benefits of technology

It improves the running performance of containers, avoids the performance overhead caused by context switching of all CPUs on the physical machine, and enhances resource utilization and container isolation capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000
    Figure 00000000_0000
Patent Text Reader

Abstract

The invention discloses a container deployment method and device.The method comprises the steps that when a master node monitors a deployment request for a first pod, a first virtual host vHost object meeting the resource requirement of the first pod is screened out, the first vHost object serves as a logic object for conducting resource isolation on a physical machine on a first work node, and the first vHost object serves as a second vHost object for conducting resource isolation on the physical machine on the first work node; if so, it may be determined that the first pod may be scheduled into the first vHost object as a scheduling event. Wherein the first vHost object does not need to be used as entity software to run on a physical machine, the physical machine is not affected, the first vHost object isolates resources, the use range of a CPU is limited in the running process of the container of the first pod, performance overhead caused by context switching on all CPUs on the physical machine is avoided, and the running performance of the container is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of communication technology, and in particular to a container deployment method and device. Background Art

[0002] Network function virtualization (NFV) technology can be simply understood as migrating the functions of each network element in the network from a dedicated hardware platform to a general commercial off-the-shelf product server. Through NFV technology, each network element can be transformed into an independent application so that it can be flexibly deployed on a unified infrastructure platform built on standard servers, switches and other devices. Through virtualization technology, the infrastructure hardware devices are virtualized to provide virtual resources for upper-layer applications, realize the decoupling of applications and hardware, and enable each application to quickly increase / reduce virtual resources to achieve the purpose of quickly expanding / contracting system capacity, greatly improving the elasticity of the network. As a new type of virtualization technology, container technology provides an isolated operating space for applications; that is, each container contains an exclusive complete user environment space, and changes in one container will not affect the operating environment of other containers. Kubernetes (K8s) is a container-based cluster management platform, including a master node and multiple worker nodes connected to the master node. The master node is used to manage and control multiple worker nodes. The worker nodes are deployed on virtual machines. Each worker node includes multiple container groups (pods). Pod is the basic operating unit of the K8s platform. Each pod encapsulates one or more containers for carrying applications, and containers belonging to the same pod share network resources.

[0003] Currently, physical machines are used as K8s working nodes. When K8s deploys pods, the various components inside K8s work together to complete the selection of working nodes, schedule the pods to the working nodes, and finally pull up the containers in the pods on the working nodes. However, when containers are deployed on physical machines, the resource isolation capability is not guaranteed by virtual machines (VMs). Isolation is only achieved through pods. If the container in the pod only sets the size of the central processing unit (CPU) and memory, and does not fix the CPU number and memory address, when the CPU context is switched during the operation of the container, all CPUs and physical memory blocks on the physical machine may be switched, affecting the performance of the container operation. Summary of the invention

[0004] The present application provides a container deployment method and device for avoiding the performance overhead caused by context switching on all central processing units (CPUs) on a physical machine and improving the container operation performance.

[0005] In a first aspect, the present application provides a container deployment method, the method comprising: obtaining a deployment request, the deployment request including resource requirements for a first container group pod; determining a first virtual machine (virtual host, vHost) object that meets the resource requirements based on the deployment request, the first vHost object being a logical object for resource isolation of a physical machine on a first working node; determining a scheduling event, the scheduling event indicating that the first pod is scheduled to the first vHost object.

[0006] In the above aspects, when the master node monitors the deployment request for the first pod, it selects the first vHost object that meets the resource requirements of the first pod. The first vHost object is used as a logical object for isolating resources of the physical machine on the first working node, and it can be determined that the first pod can be scheduled to the first vHost object as a scheduling event. Among them, the first vHost object does not need to run on the physical machine as entity software, and will not affect the physical machine. The first vHost object isolates resources, and the CPU usage range is limited during the operation of the container of the first pod, avoiding the performance overhead caused by context switching on all CPUs on the physical machine, and improving the container operation performance.

[0007] In one possible implementation, determining the first vHost object that meets the resource requirements based on the deployment request includes: determining the second working node based on the deployment request and the node affinity rule; determining the second vHost object from the second working node based on the deployment request and the vHost affinity rule; determining the third vHost object based on the resource requirements and the resource specifications of the second vHost object; and selecting the vHost object with the largest amount of free resources from the third vHost object as the first vHost object.

[0008] In the above possible implementation manner, a pod label is set on the first pod indicated by the deployment request, and the pod label can be used to divide objects of a specific group (such as version, service type, etc.), or tell us what this pod does, and the node affinity rule indicates that the working node where the selected vHost object is located must have the same label as the pod label, and the vHost affinity rule indicates that the selected vHost object must have the same label as the pod label. To avoid screening vHost objects of all working nodes, the node affinity rule can be used to first select one or more second working nodes that meet the pod label, and then the vHost objects in the one or more second working nodes are screened by the vHost affinity rule, and one or more second vHost objects that meet the vHost affinity rule can be determined, and then it is determined whether the one or more second vHost objects meet the resource requirements of the first pod, and a third vHost object that meets the requirements is screened from the one or more second vHost objects. The third vHost object can be one or more. When there are multiple third vHost objects, the vHost object with the largest amount of idle resources can be selected as the first vHost object to reduce jams.

[0009] In one possible implementation, before determining the first vHost object that meets the resource requirements based on the deployment request, the method also includes: determining the resource specifications of the fourth vHost object; selecting a third working node that meets the resource specifications of the fourth vHost object; and sending a creation instruction to the third working node, the creation instruction including the fourth vHost object and the resource specifications of the fourth vHost object.

[0010] In the above possible implementation, before determining the first vHost object, the master node needs to instruct the working node to create a fourth vHost object, and the fourth vHost object includes the first vHost object. Specifically, the master node can first set the resource specifications of each fourth vHost object, and check whether the resources on the working node meet the specification requirements. If they meet the requirements, continue to create the task, otherwise the creation fails, that is, send a creation instruction to the third working node that meets the requirements, instructing the third working node to create the fourth vHost object according to the resource specifications, thereby improving the feasibility of the solution.

[0011] In a possible implementation, the first vHost object includes one or more pods.

[0012] In a possible implementation, when the first vHost object includes multiple pods, the multiple pods are used in staggered manner.

[0013] In the above possible implementation manner, multiple pods that occupy resources in different peak hours are scheduled to share the resources of the vHost object, thereby avoiding waste caused by a single pod monopolizing the vHost object resources.

[0014] A second aspect of the present application provides a container deployment method, the method comprising: monitoring a scheduling event of a master node, the scheduling event indicating that a first pod is scheduled to a first vHost object, the first vHost object being a logical object for resource isolation of a physical machine; and deploying the first pod in the first vHost object.

[0015] In the above aspect, the first working node deploys the first pod in the first vHost object, which is a logical object for isolating resources for the physical machine. The first vHost object does not need to run as entity software on the physical machine and will not affect the physical machine. The first vHost object isolates resources, and the CPU usage is limited during the operation of the container of the first pod, thereby avoiding the performance overhead caused by context switching on all CPUs on the physical machine and improving the container operation performance.

[0016] In one possible implementation, before deploying the first pod in the first vHost object, the method further includes: receiving a creation instruction from a master node, the creation instruction including a fourth vHost object and resource specifications of the fourth vHost object; and creating a fourth vHost object according to the resource specifications of the fourth vHost object.

[0017] In the above possible implementation manner, before deploying the first pod, the first working node needs to create a vHost object first, that is, according to the creation instruction from the master node, create a fourth vHost object according to the resource specifications of the fourth vHost object carried by the creation instruction, and the fourth vHost object includes the first vHost object, thereby improving the feasibility of the solution.

[0018] The third aspect of the present application provides a container deployment device that can implement the method in the first aspect or any possible implementation of the first aspect. The device includes corresponding units or modules for executing the above method. The units or modules included in the device can be implemented in software and / or hardware. The device can be, for example, a network device, or a chip, a chip system, or a processor that supports the network device to implement the above method, or a logic module or software that can implement all or part of the network device functions.

[0019] In a fourth aspect, the present application provides a container deployment device that can implement the method in the second aspect or any possible implementation of the second aspect. The device includes corresponding units or modules for executing the above method. The units or modules included in the device can be implemented in software and / or hardware. The device can be, for example, a network device, or a chip, a chip system, or a processor that supports the network device to implement the above method, or a logic module or software that can implement all or part of the network device functions.

[0020] In a fifth aspect, the present application provides a computer device, including: a processor, the processor is coupled to a memory, the memory is used to store instructions, and when the instructions are executed by the processor, the computer device implements the method in the first aspect or any possible implementation of the first aspect. The computer device may be, for example, a network device, or a chip or chip system that supports the network device to implement the above method.

[0021] In a sixth aspect, the present application provides a computer device, including: a processor, the processor is coupled to a memory, the memory is used to store instructions, and when the instructions are executed by the processor, the computer device implements the method in the second aspect or any possible implementation of the second aspect. The computer device may be, for example, a network device, or a chip or chip system that supports the network device to implement the above method.

[0022] The seventh aspect of the present application provides a computer-readable storage medium, which stores instructions. When the instructions are executed by a processor, the method provided by the first aspect or any possible implementation method of the first aspect, the second aspect or any possible implementation method of the second aspect is implemented.

[0023] In an eighth aspect, the present application provides a computer program product, which includes a computer program code. When the computer program code is executed on a computer, it implements the method provided by the first aspect or any possible implementation method of the first aspect, or the second aspect or any possible implementation method of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 A system architecture diagram of a NFV system provided in an embodiment of the present application;

[0025] Figure 2 A flowchart of a container deployment method provided in an embodiment of the present application;

[0026] Figure 3 A schematic diagram of the structure of a master node and a working node provided in an embodiment of the present application;

[0027] Figure 4 A schematic diagram of a process for kube-schedule to select a vHost object provided in an embodiment of the present application;

[0028] Figure 5 A schematic diagram of the structure of a container deployment device provided in an embodiment of the present application;

[0029] Figure 6 A schematic diagram of the structure of another container deployment device provided in an embodiment of the present application;

[0030] Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present application;

[0031] Figure 8 A schematic diagram of the structure of another computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] The present application provides a container deployment method and device for avoiding the performance overhead caused by context switching on all CPUs on a physical machine and improving the container operation performance.

[0033] The following describes the embodiments of the present application in conjunction with the accompanying drawings. Obviously, the described embodiments are only embodiments of a part of the present application, rather than all embodiments. It is known to those skilled in the art that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0034] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0035] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0036] In addition, in order to better illustrate the present application, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present application can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present application.

[0037] Network function virtualization (NFV) technology can be simply understood as migrating the functions of each network element in the telecommunications network from the current dedicated hardware platform to a general commercial-off-the-shelf (COTS) server. Through NFV technology, each network element can be transformed into an independent application and flexibly deployed on a unified infrastructure platform built on standard servers, storage devices, switches and other devices; and through virtualization technology, the hardware device resources as the infrastructure can be pooled and virtualized to provide virtual resources for upper-layer applications, realize the decoupling of applications and hardware devices, and enable each application to quickly increase / reduce virtual resources to achieve the purpose of rapidly expanding system capacity, greatly improving the elasticity of the network; at the same time, by using a shared resource pool composed of general COTS servers, newly developed services do not need to deploy hardware devices separately, greatly shortening the time to launch new services.

[0038] The foundation of NFV technology includes cloud computing technology and virtualization technology. Among them, general COTS hardware devices can be decomposed into multiple virtual resources through virtualization technology for use by various upper-layer applications. Virtualization technology realizes the decoupling between applications and hardware, which greatly increases the speed of virtual resource provision. Cloud computing technology can realize elastic scaling of applications and ensure that virtual resources match business loads, which not only improves the utilization efficiency of virtual resources, but also improves the response rate of the system.

[0039] Figure 1 This is a system architecture diagram of a NFV system provided in an embodiment of the present application. The NFV system 100 can be used in various networks, such as a data center network, an operator network, or a local area network. Figure 1As shown, the NFV system 100 includes: NFV management and orchestration system (NFV MANO), NFV infrastructure layer (NFV infrastructure, NFVI), multiple virtual network functions (VNF), multiple element management (EM); business support management system (OSS / BSS).

[0040] NFV MANO also includes NFV orchestrator (NFV orchestrator, NFVO), one or more VNF managers (VNFM) and virtualized infrastructure manager (virtualized infrastructure manager, VIM). Among them, NFV MANO is used to perform monitoring and management of VNF and NFVI. NFVO can provide network services (such as VPN services) for NFVI, and can also execute resource-related requests from one or more VNFMs, and send configuration information to VNFMs, while collecting VNF status information; NFVO communicates with VIM to implement resource allocation and / or reservation and exchange configuration and status information of virtualized hardware resources. Among them, VNFM can manage one or more VNFs, including implementing functions such as instantiation, updating, querying, scaling, and terminating VNFs. VIM can perform resource management functions, such as managing the allocation of infrastructure resources, such as adding resources to virtual containers, or performing operational functions, such as collecting NFVI fault information. At the same time, VNFM and VIM can communicate with each other to allocate resources and exchange configuration and status information of virtualized hardware resources.

[0041] NFVI includes a hardware resource layer, a virtualization layer, and a virtual resource layer. NFVI is a virtualized environment deployment completed using hardware resources or software resources, that is, the hardware resource layer and the virtual resource layer are used to provide virtualized resources, such as virtual machines and other forms of virtual containers for VNF. Among them, the hardware resource layer includes computing hardware, storage hardware, and network hardware. Computing hardware is used to provide processing and computing resources, storage hardware can be storage capacity provided within the network or storage capacity residing in the storage hardware itself, and network hardware can be switches, routers, or any network equipment configured with switching functions.

[0042] The virtualization layer is used to abstract hardware resources from the physical layer and decouple VNFs, providing virtualized resources to VNFs; while the virtual resource layer includes virtual computing, virtual storage, and virtual networks. Among them, virtual computing and virtual storage can be provided to VNFs in the form of virtual machines or other virtual containers. For example, multiple VNFs can be deployed on a virtual machine. The virtualization layer abstracts the network hardware to form a virtual network, which can include a virtual switch to provide connections between multiple virtual machines.

[0043] Among them, VNFM can interact with VNF and EM to manage the life cycle of VNF and exchange configuration and status information. VNF can be configured as a virtualization of at least one network function performed by a physical network device. For example, in one implementation, VNF can be configured to provide the functions of different network elements in the network.

[0044] Virtualization technology, as a widely used way of sharing server resources, also has many problems. Since virtualization technology relies on a complete operating system, that is, each virtual machine needs to run a complete client operating system and a large number of applications installed in the operating system when it is running. Therefore, for a single application, each time an application is developed, it is necessary not only to deploy the application, but also to deploy a complete operating system for the application. In this way, the heavy load generated will affect the work efficiency of developing applications. For this reason, container technology is introduced into the NFV architecture.

[0045] Container technology refers to dividing the resources of a single operating system into isolated containers, deploying applications in each container, and making the resources of multiple containers independent of each other. This ensures that each application is independent of each other, but multiple containers can share and reuse redundant operating systems and environments at the bottom. In this way, when developing applications, since only the applications in each container need to be operated, there is no need to deploy a complete operating system for each application, which greatly reduces the load and improves work efficiency. After the container technology is introduced in the NFV architecture, it ensures that multiple applications are independent of each other and share other virtual resources at the bottom of the virtual machine.

[0046] K8s is an open source container cluster management system used to deploy, scale and manage containerized applications. A cluster refers to a group of working nodes. Specifically, each node can deploy multiple container groups, pods. Pods are the smallest deployment unit for K8s application scheduling. A pod can contain one or more containers.

[0047] Currently, physical machines are used as K8s working nodes. During the pod deployment process, K8s internal components collaborate to complete the deployment. First, the master node selects the working node after listening to the pod deployment request, then schedules the pod to the working node, and finally pulls up the container in the pod on the working node. However, when the container is deployed on a physical machine, the resource isolation capability is not guaranteed by the virtual machine (VM). Isolation is only completed through the pod. If the container in the pod only sets the central processing unit (CPU) and memory size, and does not fix the CPU number and memory address, when the CPU context is switched during the container operation, all CPUs and physical memory blocks on the physical machine may be switched, affecting the performance of the container operation.

[0048] To solve the above problems, an embodiment of the present application provides a container deployment method, which is described as follows.

[0049] See also Figure 2 ,like Figure 2 The figure is a flow chart of a container deployment method provided in an embodiment of the present application, the method comprising:

[0050] Step 201: The master node obtains a deployment request, where the deployment request includes resource requirements for the first container group pod.

[0051] In this embodiment, when there is a deployment requirement for the first pod externally (for example, a user, a network manager or other server or client), a deployment request for deploying the first pod can be initiated to the master node. The deployment request can carry the resource requirements required for the first pod, such as the required CPU and memory size. The master node can monitor in real time whether there is a deployment request.

[0052] Step 202. The master node determines a first virtual machine (virtual host, vHost) object that meets the resource requirements according to the deployment request. The first vHost object is a logical object that isolates resources of the physical machine on the first working node.

[0053] In this embodiment, a vHost object is introduced into the physical machine of the working node. The vHost object is a logical object unit that divides and isolates the hardware and software resources of the physical machine. It does not need to run as entity software on the physical machine, nor does it require the management capabilities of the virtual I layer. At the same time, the CPU, memory, disk, network and kernel resources of the physical machine can be strongly isolated, which is equivalent to the functional characteristics of the virtual machine. Among them, the vHost object definition includes the bound CPU and memory resources, as well as the labels associated with the physical machine and pod. When the master node determines the pod to be deployed and the required resource requirements, it can select a matching vHost object from the working node subordinate to the master node as the first vHost object that meets the resource requirements. Correspondingly, the working node where the first vHost object is located is the first working node.

[0054] Among them, a pod label is set on the first pod indicated by the deployment request, and the pod label can be used to divide objects of a specific group (such as version, service type, etc.), or tell us what this pod does. The node affinity rule indicates that the working node where the selected vHost object is located must have the same label as the pod label. The vHost affinity rule indicates that the selected vHost object must have the same label as the pod label. To avoid screening the vHost objects of all working nodes, the node affinity rule can be used to select one or more second working nodes that meet the pod label, and then the vHost objects in the one or more second working nodes are screened by the vHost affinity rule. One or more second vHost objects that meet the vHost affinity rule can be determined, and then it is determined whether the one or more second vHost objects meet the resource requirements of the first pod. A third vHost object that meets the requirements is screened from the one or more second vHost objects. The third vHost object can be one or more. When there are multiple third vHost objects, the vHost object with the largest amount of idle resources can be selected as the first vHost object to reduce jams.

[0055] Before determining the first vHost object, the master node also needs to instruct the working node to create a fourth vHost object, which includes the first vHost object. Specifically, the master node can first set the resource specifications of each fourth vHost object, such as cpu size, cpu number, memory size and address, etc., to record the correspondence between the vHost object and the physical machine and the resource list of the vHost object. The master node can verify whether the resources on the working node meet the specification requirements. If they meet the requirements, continue to create the task, otherwise the creation fails, that is, send a creation instruction to the third working node that meets the requirements, instructing the third working node to create the fourth vHost object according to the resource specification. The third working node can be one or more, that is, the third working node can include the first working node. After receiving the creation instruction, the first working node can create a fourth vHost object accordingly. The fourth vHost object is one or more, and the fourth vHost object includes the first vHost object.

[0056] Step 203: The master node determines a scheduling event, where the scheduling event indicates that the first pod is scheduled to the first vHost object.

[0057] In this embodiment, after determining the first vHost object, the master node may determine that the first pod may be scheduled to the first vHost object, and the master node may record the scheduling operation as a scheduling event to be performed.

[0058] Step 204: The first working node monitors the scheduling events of the master node.

[0059] In this embodiment, each working node subordinate to the master node monitors the scheduling events of the master node in real time. When it is monitored that the vHost object in the scheduling event is on the working node, it is determined that the scheduling event belongs to the working node, that is, because the scheduling event indicates that the first pod is scheduled to the first vHost object, the first working node can determine that it needs to receive the scheduling event.

[0060] Step 205. The first working node deploys the first pod in the first vHost object.

[0061] In this embodiment, after the first working node monitors the scheduling event, it can specify the CPU number and memory area of ​​the container running in the first pod as the CPU number and memory area defined on the first vHost object, complete the binding relationship between the first pod and the first vHost object, and then pull up the first pod.

[0062] One or more pods can be deployed in the first vHost object in the first working node to meet more deployment requirements. Further, when multiple pods are deployed in the first vHost object, the multiple pods are pods used in staggered hours, and the multiple pods are not used at the same time. For example, assuming there are 2 pods, one pod can be used exclusively during the day, and the other pod can be used only at night to improve resource utilization.

[0063] Compared with the native K8s architecture, the embodiment of the present application introduces vHost objects on the physical machine to isolate the physical machine (worker node) resources, introduces vHostController management objects in the K8s master node to manage vHost objects on all physical machines, and enhances the scheduling capability of the kube-schedule component, that is, increases the ability to schedule pods in vHost. The structural diagram of the master node and the worker node can be as follows: Figure 3 As shown, the master node includes kube-apiserver, kube-manager, kube-scheduler and vHostController, the working node (physical machine) includes Kubelet and one or more vHost objects (two are used as an example in the figure), and one or more pods are deployed in the vHost object (two are used as an example in the figure).

[0064] kube-apiserver: The unified access portal of the K8s cluster, providing interface services in the form of RESTful API. All object resource addition, deletion, modification, query and monitoring operations are handled by this component.

[0065] kube-manager: handles background tasks in the K8s cluster. One resource corresponds to one controller. kube-manager is responsible for managing the execution scheduling of these controllers.

[0066] kube-scheduler: The component in K8s master that schedules pods on worker nodes and can schedule containers on vHosts.

[0067] vHostController: Responsible for managing the life cycle of vHost objects on all physical machines, including the ability to create, delete, and update vHost.

[0068] Kubelet: The agent of the K8s master node on the worker node, which manages the life cycle of the local pod, such as creating and deleting pods.

[0069] Correspondingly, when creating a vHost object, you can save the vHost content to a file, such as vHost.yaml, and then execute the command on the K8s master node to create the vHost object: kubectl apply vHost.yaml

[0070] The vHost content may be as follows:

[0071] apiVersion:vHostgroup / v1

[0072] kind:vHost

[0073] metadata:

[0074] name:example-vHost

[0075] namespace:ns01

[0076] spec:

[0077] hostip:"192.168.0.10" / / IP address of the working node where the vHost is located

[0078] numaid:1 / / Numaid where the vHost is located (vHost cannot cross numa)

[0079] cpuset:[0,1,2,3] / / The cpu set managed by vHost and the number of each cpu memory:0xC0000000-0xC0004000

[0080] / / Memory address managed by vHost

[0081] lables: / / vHost label set (subsequent business POD needs to be affinity to this label)

[0082] -key1:value1

[0083] -key2:value2

[0084] After executing the above command to create a vHost object, kube-apiserver receives the vHost creation request, vHostController listens to the vHost creation event, and creates a vHost object on the specified working node:

[0085] 1. vHostController queries the details of the working node according to the hostip defined in the vHost object, and verifies whether the resources on the working node meet the requirements according to the CPU size, CPU number, memory size and address defined in the vHost. If they meet the requirements, continue to create the task, otherwise the creation fails.

[0086] 2. vHostController queries the labels defined in vHost, calls the Restful interface of kube-apiserver, and sets the labels to the corresponding working nodes at the same time. Each working node can have one or more labels.

[0087] 3. vHostController persists the vHost object in the master node.

[0088] Correspondingly, for the flowchart of kube-schedule selecting vHost objects, please refer to Figure 4 shown.

[0089] Kube-schedule queries all the working nodes in K8s (node1, node2, and node3), and matches the node affinity rules with the working nodes according to the labels set on the pod, that is, the labels on the working nodes contain the labels defined by the pod. The working nodes (node1 and node2) that meet the node affinity rules are selected.

[0090] Kube-schedule further matches the vHost affinity rules on the filtered working nodes (node1 and node2) and filters out the vHost objects that match the pod labels (vHost1 of node1, vHost2 of node1, and vHost2 of node2). That is, the labels on the vHost objects contain the labels defined by the pod.

[0091] After Kube-schedule filters out the vHost objects (vHost1 of node1, vHost2 of node1, and vHost2 of node2), Kube-schedule calculates the resource specifications of the vHost to see whether they meet the resource requirements defined by the pod, that is, the number of CPUs of the vHost is greater than the number of CPUs defined by the pod, and the memory size of the vHost is greater than the memory size defined by the pod;

[0092] After the above three screening conditions are met, if there are vHost objects on multiple working nodes (vHost1 of node1 and vHost2 of node2) that meet the requirements, the resource idleness of the qualified Node nodes is calculated, and the working node with the largest amount of resource idleness (vHost1 of node1) is selected.

[0093] The embodiment of the present application screens the first vHost object that meets the resource requirements of the first pod when monitoring the deployment request for the first pod. The first vHost object is used as a logical object for isolating resources of the physical machine on the first working node, and it can be determined that the first pod can be scheduled to the first vHost object as a scheduling event. Among them, the first vHost object does not need to run on the physical machine as entity software, and will not affect the physical machine. The first vHost object isolates resources, and the CPU usage range is limited during the operation of the container of the first pod, avoiding the performance overhead caused by context switching on all CPUs on the physical machine, and improving the container operation performance.

[0094] The container deployment method is described above, and the device for executing the method is described below.

[0095] See also Figure 5 ,like Figure 5 The figure is a schematic diagram of the structure of a container deployment device provided in an embodiment of the present application, the device 50 includes:

[0096] Processing unit 501 is used to obtain a deployment request, where the deployment request includes resource requirements for a first container group pod; determine a first vHost object that meets the resource requirements based on the deployment request, where the first vHost object is a logical object for isolating resources of a physical machine on a first working node; and determine a scheduling event, where the scheduling event indicates that the first pod is scheduled to the first vHost object.

[0097] The processing unit 501 is used to execute Figure 2 Steps 201 to 203 in the method embodiment.

[0098] Optionally, the processing unit 501 is specifically configured to:

[0099] Determine the second working node according to the deployment request and the node affinity rule;

[0100] Determine a second vHost object from the second working node according to the deployment request and the vHost affinity rule;

[0101] Determine a third vHost object based on the resource requirements and resource specifications of the second vHost object;

[0102] A vHost object with the largest amount of idle resources is selected from the third vHost objects as the first vHost object.

[0103] Optionally, the processing unit 501 is further configured to:

[0104] Determine resource specifications for the fourth vHost object;

[0105] Select a third worker node that meets the resource specifications of the fourth vHost object;

[0106] The device 50 further includes a transceiver unit 502, which is specifically configured to:

[0107] A creation instruction is sent to the third working node, where the creation instruction includes a fourth vHost object and resource specifications of the fourth vHost object.

[0108] Optionally, the first vHost object includes one or more pods.

[0109] Optionally, when the first vHost object includes multiple pods, the multiple pods are used in a staggered manner.

[0110] See also Figure 6 ,like Figure 6 FIG. 6 is a schematic diagram of the structure of another container deployment device provided in an embodiment of the present application. The device 60 includes:

[0111] The processing unit 601 is used to monitor the scheduling event of the master node, where the scheduling event indicates that the first pod is scheduled to the first vHost object, where the first vHost object is a logical object for isolating resources of the physical machine; and deploy the first pod in the first vHost object.

[0112] The processing unit 601 is used to execute Figure 2 Step 204 and step 205 in the method embodiment.

[0113] Optionally, the device 60 further includes a transceiver unit 602, and the transceiver unit 602 is specifically configured to:

[0114] receiving a creation instruction from the master node, the creation instruction including a fourth vHost object and resource specifications of the fourth vHost object;

[0115] The processing unit 601 is further configured to:

[0116] A fourth vHost object is created according to the resource specifications of the fourth vHost object.

[0117] Figure 7, which is a possible logical structure diagram of a computer device 70 provided in an embodiment of the present application. The computer device 70 includes: a processor 701, a communication interface 702, a storage system 703, and a bus 704. The processor 701, the communication interface 702, and the storage system 703 are interconnected via the bus 704. In the embodiment of the present application, the processor 701 is used to control and manage the actions of the computer device 70. For example, the processor 701 is used to execute Figure 2 The steps performed by the master node in the method embodiment. The communication interface 702 is used to support the computer device 70 to communicate. The storage system 703 is used to store the program code and data of the computer device 70.

[0118] Among them, the processor 701 can be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. It can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the contents disclosed in this application. The processor 701 can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and so on. The bus 704 can be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0119] The transceiver unit 502 in the apparatus 50 is equivalent to the communication interface 702 in the computer device 70 , and the processing unit 501 in the apparatus 50 is equivalent to the processor 701 in the computer device 70 .

[0120] The computer device 70 of this embodiment may correspond to the above Figure 2 In the method embodiment, the master node, the communication interface 702 in the computer device 70 can implement the above Figure 2 For the sake of brevity, the functions of the master node and / or the various steps implemented in the method embodiment are not repeated here.

[0121] Figure 880 is another possible logical structure diagram of a computer device 80 provided in an embodiment of the present application. The computer device 80 includes: a processor 801, a communication interface 802, a storage system 803, and a bus 804. The processor 801, the communication interface 802, and the storage system 803 are interconnected via the bus 804. In the embodiment of the present application, the processor 801 is used to control and manage the actions of the computer device 80. For example, the processor 801 is used to execute Figure 2 The steps performed by the first working node in the method embodiment. The communication interface 802 is used to support the computer device 80 to communicate. The storage system 803 is used to store the program code and data of the computer device 80.

[0122] Among them, the processor 801 can be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. It can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the contents disclosed in this application. The processor 801 can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and so on. The bus 804 can be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0123] The transceiver unit 602 in the device 60 is equivalent to the communication interface 802 in the computer device 80 , and the processing unit 601 in the device 60 is equivalent to the processor 801 in the computer device 80 .

[0124] The computer device 80 of this embodiment may correspond to the above Figure 2 In the first working node of the method embodiment, the communication interface 802 in the computer device 80 can implement the above Figure 2 In the method embodiment, the functions of the first working node and / or the various steps implemented are not repeated here for the sake of brevity.

[0125] It should be understood that the division of the units in the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And the units in the device can all be implemented in the form of software calling through processing elements; they can also be all implemented in the form of hardware; some units can also be implemented in the form of software calling through processing elements, and some units can be implemented in the form of hardware. For example, each unit can be a separately established processing element, or it can be integrated in a certain chip of the device. In addition, it can also be stored in the memory in the form of a program, and called and executed by a certain processing element of the device. The function of the unit. In addition, all or part of these units can be integrated together, or they can be implemented independently. The processing element described here can also be a processor, which can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each unit above can be implemented by an integrated logic circuit of hardware in the processor element or in the form of software calling through a processing element.

[0126] In one example, the unit in any of the above devices may be one or more integrated circuits configured to implement the above method, such as: one or more application specific integrated circuits (ASIC), or one or more digital singnal processors (DSP), or one or more field programmable gate arrays (FPGA), or a combination of at least two of these integrated circuit forms. For another example, when the unit in the device can be implemented in the form of a processing element scheduler, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call a program. For another example, these units can be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0127] In another embodiment of the present application, a computer-readable storage medium is provided, in which computer-executable instructions are stored. When the processor of the device executes the computer-executable instructions, the device executes the method executed by the computer system in the above method embodiment.

[0128] In another embodiment of the present application, a computer program product is provided, the computer program product includes computer execution instructions, the computer execution instructions are stored in a computer readable storage medium. When the processor of the device executes the computer execution instructions, the device executes the method executed by the computer system in the above method embodiment.

[0129] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0130] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0131] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0132] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0133] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.

Claims

1. A container deployment method, characterized in that: include: Obtain a deployment request, where the deployment request includes resource requirements for the first container group pod; Determine, according to the deployment request, a first virtual host vHost object that meets the resource requirement, wherein the first vHost object is a logical object for isolating resources of a physical machine on a first working node; A scheduling event is determined, the scheduling event indicating that the first pod is scheduled to the first vHost object.

2. The method according to claim 1, characterized in that Determining the first vHost object that meets the resource requirement according to the deployment request includes: Determine a second working node according to the deployment request and the node affinity rule; Determine a second vHost object from the second working node according to the deployment request and the vHost affinity rule; determining a third vHost object based on the resource requirement and the resource specification of the second vHost object; A vHost object with the largest amount of idle resources is selected from the third vHost objects as the first vHost object.

3. The method according to claim 1 or 2, characterized in that: Before determining, according to the deployment request, a first vHost object that meets the resource requirement, the method further includes: Determine resource specifications for the fourth vHost object; Selecting a third working node that meets the resource specifications of the fourth vHost object; A creation instruction is sent to the third working node, where the creation instruction includes the fourth vHost object and the resource specification.

4. The method according to any one of claims 1 to 3, characterized in that: The first vHost object includes one or more pods.

5. The method according to claim 4, characterized in that When the first vHost object includes multiple pods, the multiple pods are used in staggered periods of time.

6. A container deployment method, characterized in that: include: Monitor a scheduling event of the master node, where the scheduling event indicates that the first pod is scheduled to a first virtual host vHost object, where the first vHost object is a logical object for isolating resources of a physical machine; The first pod is deployed in the first vHost object.

7. The method according to claim 6, characterized in that Before deploying the first pod in the first vHost object, the method further includes: receiving a creation instruction from the master node, the creation instruction including a fourth vHost object and resource specifications of the fourth vHost object; The fourth vHost object is created according to the resource specifications of the fourth vHost object.

8. A container deployment device, characterized in that: include: A processing unit, configured to obtain a deployment request, wherein the deployment request includes a resource requirement of a first container group pod; Determine a first virtual host vHost object that meets the resource requirements according to the deployment request, where the first vHost object is a logical object for isolating resources of a physical machine on a first working node; and determine a scheduling event, where the scheduling event indicates that the first pod is scheduled to the first vHost object.

9. The device according to claim 8, characterized in that The processing unit is specifically used for: Determine a second working node according to the deployment request and the node affinity rule; Determine a second vHost object from the second working node according to the deployment request and the vHost affinity rule; determining a third vHost object based on the resource requirement and the resource specification of the second vHost object; A vHost object with the largest amount of idle resources is selected from the third vHost objects as the first vHost object.

10. The device according to claim 8 or 9, characterized in that The processing unit is also used for: Determine resource specifications for the fourth vHost object; Selecting a third working node that meets the resource specifications of the fourth vHost object; The device further includes a transceiver unit, which is specifically configured to: Send a creation instruction to the third working node, where the creation instruction includes the fourth vHost object and resource specifications of the fourth vHost object.

11. The device according to any one of claims 8 to 10, characterized in that: The first vHost object includes one or more pods.

12. The device according to claim 11, characterized in that When the first vHost object includes multiple pods, the multiple pods are used in staggered periods of time.

13. A container deployment device, characterized in that: include: A processing unit is used to monitor a scheduling event of a master node, where the scheduling event indicates that a first pod is scheduled to a first virtual host vHost object, where the first vHost object is a logical object for isolating resources of a physical machine; and deploy the first pod in the first vHost object.

14. The device according to claim 13, characterized in that The device further includes a transceiver unit, which is specifically configured to: receiving a creation instruction from the master node, the creation instruction including a fourth vHost object and resource specifications of the fourth vHost object; The processing unit is also used for: The fourth vHost object is created according to the resource specifications of the fourth vHost object.

15. A computer device, characterized in that: include: processor and memory, The processor is configured to execute instructions stored in the memory, so that the computer device performs the method according to any one of claims 1 to 5.

16. A computer device, characterized in that: include: processor and memory, The processor is configured to execute instructions stored in the memory, so that the computer device performs the method according to any one of claims 6 to 7.

17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed on the computer, the computer is caused to execute the method according to any one of claims 1 to 7.

18. A computer program product, characterized in that When the computer program product is executed on a computer, the computer performs the method according to any one of claims 1 to 7.