Scheduling method, device and master node
By automatically obtaining the processor architecture type of the work node in the master node and selecting matching target nodes, the low degree of automation and human-caused errors caused by manual configuration in the prior art is solved, and more efficient and reliable scheduling task execution is achieved.
Patent Information
- Application Number
- CN202111066130.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-03-16
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2038-03-16
AI Technical Summary
In the prior art, maintenance personnel need to manually configure work nodes of different processor architecture types to different IP network segments, resulting in low automation and easy introduction of human errors, resulting in failure of scheduling task execution.
The master node receives scheduling tasks, obtains the processor architecture type of the worker node based on the mirror name of the target container, and selects the target node that matches the processor architecture type from the cluster to automatically configure and select worker nodes.
It improves the degree of automation of the master node in performing scheduling tasks, avoids human configuration errors, and enhances the success rate and efficiency of scheduling tasks.
Smart Images

Figure CN113946415B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and more specifically, to a scheduling method, device, and master node in container technology. Background Art
[0002] Virtualization technology has become a widely recognized way to share server resources, which can provide system administrators with great flexibility in the process of building operating system instances on demand. Since virtualization technology still has some performance and resource efficiency issues, a new virtualization technology called container has emerged to help solve these problems.
[0003] Container services provide high-performance and scalable container application management servers. For example, the open source application container engines Docker and Kubernetes can provide multiple application publishing methods and continuous delivery capabilities and support microservice architecture. Docker is mainly a container management architecture for a single working node, while Kubernetes is a container management architecture for a cluster of multiple working nodes. The two are compatible with each other. The Kubernetes architecture can access software modules of the Docker architecture to implement corresponding functions. In the implementation of container technology, there is a container scheduling module (for example, the scheduling module (scheduler) in the Kubernetes system) that is used to schedule the working nodes in the cluster to create and run the target container.
[0004] At present, a cluster usually includes working nodes of multiple processor architecture types, for example, working nodes of processor architecture type X86 and working nodes of processor architecture type advanced reduced instruction set computer machine (ARM). In the traditional scheduling scheme, the maintenance personnel need to manually configure the Internet Protocol (IP) addresses of the networks of the various working nodes in the cluster according to the processor architecture types of the different working nodes in the cluster, and configure different IP network segments for the working nodes of different processor architectures, so that after the working node receives the scheduling task of creating the target container, it can select the target node in the IP network segment matching the image architecture type of the target container to create and run the target container, wherein the processor architecture of the working node contained in the IP network segment corresponding to the image architecture type of the target container is the same as the processor architecture type in the image architecture running the target container.
[0005] However, the above process of configuring working nodes of different processor architecture types in different IP network segments requires manual configuration by maintenance personnel, which has a low degree of automation and is prone to human errors during manual operation, resulting in failure of scheduling task execution. Therefore, how to improve the degree of automation of scheduling task execution has become a technical problem that needs to be solved urgently. Summary of the invention
[0006] The present application provides a scheduling method, device and master node, which are conducive to improving the degree of automation of the master node in executing scheduling tasks.
[0007] In a first aspect, a scheduling method is provided, comprising: a master node (for example, a master node in a Kubernetes system) receives a scheduling task, the scheduling task being used to schedule a working node in a cluster to create a target container, the scheduling task including an image name of an image used to create the target container; the master node obtains a processor architecture type of a working node for creating the target container according to the image name of the image; the master node selects a target node from the cluster for creating the target container, the processor architecture type of the target node being the same as the processor architecture type of the working node for creating the target container.
[0008] Specifically, a container can be understood as a simplified version of an operating system in which one or more specified applications run, for example, a simplified version of a Linux operating system.
[0009] In this application, the master node can obtain the processor architecture type of the working node that creates the target container based on the image name of the image used to create the target container, so as to automatically screen the working nodes in the cluster based on the processor architecture type and determine the target node for creating the target container. It is conducive to improving the degree of automation of the master node in performing scheduling tasks. Avoid the problem of low automation caused by the process in which maintenance personnel need to manually configure working nodes of different processor architecture types in different IP segments in traditional scheduling schemes. Moreover, it avoids the problem of scheduling failure caused by human error.
[0010] Optionally, the processor architecture type includes X86 architecture and ARM architecture.
[0011] In an optional implementation, in the process of the master node scheduling the working nodes in the cluster to create and run the target container, in order to improve the scheduling efficiency, the scheduling can be performed in units of container groups (pods).
[0012] Specifically, a container group may include multiple containers, and the processor architecture type of the images of the multiple containers is the same.
[0013] Optionally, all target containers in a container group are created or run on a target node in the cluster.
[0014] In one possible implementation, the master node includes a daemon of a container engine (e.g., Docker daemon), and the master node obtains the processor architecture type of the working node that creates the target container according to the image name of the image, including: the master node sends the image name of the image to the daemon of the container engine; the master node receives the image architecture type of the image sent by the daemon of the container engine, the image architecture type of the image is determined by the daemon of the container engine according to the correspondence between the image name of the image and the image architecture type of the image, and the image architecture type of the image is used to indicate the processor architecture type of the working node that creates the target container.
[0015] In this application, the type of the image architecture of the target container is obtained through the daemon process of the container engine set in the master node, so that the target node for creating the target container is selected from the working nodes of the cluster. The processor architecture of the target node can execute the instruction set in the target container, which is conducive to improving the automation of the master node in executing scheduling tasks. Avoid the process in which maintenance personnel need to manually configure working nodes of different processor architecture types in different IP network segments in traditional scheduling solutions.
[0016] In a possible implementation, the method further includes: the target node acquiring, from the image node, an image file indicated by the image name of the image; and the target node creating the target container on the target node according to the image file.
[0017] In the present application, by creating a target container on a target node, wherein the processor architecture type of the target node is the same as the processor architecture type of the working node that creates the target container, it is beneficial for the target node to run all instructions in the instruction set of the target container.
[0018] In a possible implementation, the master node selects a target node from the cluster for creating the target container, including: the master node selects at least one working node from the cluster, a processor type of the at least one working node is the same as a processor architecture type of the working node for creating the target container; the master node selects the target node from the at least one working node.
[0019] In one possible implementation, the master node selects the target node from the at least one working node, including: the master node determines the score of each working node in the at least one working node according to a preset scoring rule; the master node selects the working node with the highest score in the at least one working node as the target node.
[0020] In the present application, based on the score of each working node in at least one working node, the working node with the highest score is selected as the target node, which is conducive to balancing the load of creating and running containers by the working nodes in the cluster.
[0021] In one possible implementation, the preset scoring rule includes at least one of the following rules: the higher the resource surplus rate of the processor of the working node, the higher the score of the working node; the higher the storage resource surplus rate of the working node, the higher the score of the working node; and the higher the network resource surplus rate of the working node, the higher the score of the working node.
[0022] In a second aspect, a scheduling device is provided, including: a receiving module, used to receive a scheduling task, the scheduling task is used to schedule a working node in a cluster to create a target container, the scheduling task includes an image name of an image used to create the target container; an acquisition module, used to obtain a processor architecture type of a working node for creating the target container according to the image name of the image; and a processing module, used to select a target node for creating the target container from the cluster, the processor architecture type of the target node being the same as the processor architecture type of the working node for creating the target container.
[0023] In this application, the master node can obtain the processor architecture type of the working node that creates the target container based on the image name of the image used to create the target container, so as to automatically screen the working nodes in the cluster based on the processor architecture type and determine the target node for creating the target container. This is conducive to improving the degree of automation of the master node in executing scheduling tasks. It avoids the process in which maintenance personnel need to manually configure working nodes of different processor architecture types in different IP network segments in traditional scheduling schemes.
[0024] In a possible implementation, the master node includes a daemon process of a container engine, and the acquisition module is specifically used to: send the image name of the image to the daemon process of the container engine; receive the type of the image architecture of the image sent by the daemon process of the container engine, where the image architecture type of the image is determined by the daemon process of the container engine according to the correspondence between the image name of the image and the image architecture type of the image, and the image architecture type of the image is used to indicate the processor architecture type of the working node that creates the target container.
[0025] In a possible implementation, the processor architecture types include X86 and Advanced Reduced Instruction Set Machine ARM.
[0026] In a possible implementation, the processing module is specifically used to: select at least one working node from the cluster, the processor type of the at least one working node is the same as the processor architecture type of the working node for creating the target container; and select the target node from the at least one working node.
[0027] In a possible implementation, the processing module is further specifically used to: determine the score of each working node in the at least one working node according to a preset scoring rule; and select the working node with the highest score in the at least one working node as the target node.
[0028] In one possible implementation, the scoring rule includes at least one of the following items: the higher the resource surplus rate of the processor of the working node, the higher the score of the working node; the higher the storage resource surplus rate of the working node, the higher the score of the working node; and the higher the network resource surplus rate of the working node, the higher the score of the working node.
[0029] In a third aspect, a master node is provided, comprising an input / output interface, a processor and a memory. The processor is used to control the input / output interface to send and receive information, the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the master node executes the above method.
[0030] According to a fourth aspect, a computer program product is provided, the computer program product comprising: a computer program code, when the computer program code is run on a computer, the computer executes the methods in the above aspects.
[0031] According to a fifth aspect, a computer-readable medium is provided, wherein the computer-readable medium stores a program code, and when the computer program code is executed on a computer, the computer executes the methods in the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a schematic block diagram of a cluster to which the embodiments of the present application are applicable.
[0033] Figure 2 It is a schematic flowchart of the scheduling method of an embodiment of the present application.
[0034] Figure 3 It is a schematic flowchart of a scheduling method according to another embodiment of the present application.
[0035] Figure 4 It is a schematic block diagram of a scheduling device according to an embodiment of the present application.
[0036] Figure 5 It is a schematic block diagram of the master node of an embodiment of the present application. DETAILED DESCRIPTION
[0037] To facilitate understanding, first combine Figure 1 The applicable scenarios of the embodiments of the present application are briefly introduced.
[0038] Figure 1 It is a schematic block diagram of a cluster to which the embodiments of the present application are applicable. Figure 2 The cluster shown includes a master node 110 , a mirror node 120 and at least one worker node 130 .
[0039] The master node 110 is used to manage the workload of each working node in the cluster, for example, scheduling the working nodes in the cluster to create and run the target container.
[0040] Specifically, a cluster is a collection of one or more working nodes, and different working nodes are interconnected through a high-speed network.
[0041] A container can be understood as a simplified operating system that runs one or more specified applications, for example, a simplified Linux operating system. The target container is the container to be created in this scheduling task.
[0042] In an optional implementation, the main node is provided with a client proxy module 111 of the container engine, a service module 112 of the container engine, and a scheduler module 113. The client proxy module is used to establish communication between the service module and the scheduler module; the service module can access the mirror node 120.
[0043] Specifically, the client proxy module and the service module can communicate through the REST application programming interface (API); the scheduling module is used to schedule the working nodes in the cluster to create and run the target container according to the scheduling policy. For the container architecture, the client proxy module 111 of the container engine can be used to achieve compatibility of modules of different container architectures. For example, when Figure 1 The scheduling module shown is implemented using the scheduling module in Kubernetes, and when the server module of the container engine is implemented using the daemon module in the Docker architecture, the client proxy module of the client engine can complete the mutual conversion of interfaces in the two different architectures, thereby achieving compatibility of the two architectures.
[0044] In an optional implementation, the service module of the container engine can be a daemon of the container engine. For example, when the container engine is Docker, the service module of the container engine can be a Docker daemon, and the client proxy module of the container engine can be a Docker client. That is to say, with the Kubernetes cluster as the infrastructure, a Docker Daemon module is added to the master node, so that the container scheduling module can communicate with the container engine to obtain information about the target container to be created.
[0045] It should be noted that, during the process of initializing the scheduling module, a client proxy module can be created.
[0046] It should also be noted that the startup time of the above service module can be determined by the master node. That is to say, when the scheduling module in the master node needs to schedule the working node to create and run the target container, the master node can be notified to start the service module; or the service module can be directly started during the process of the master node initializing the scheduling module.
[0047] Optionally, in the process of the master node scheduling the working nodes in the cluster to create and run the target container, in order to improve the scheduling efficiency, scheduling can be performed in units of container groups (pods).
[0048] Specifically, a container group may include multiple containers, and the image architecture type of the images of the multiple containers is the same.
[0049] The above target container is created based on the image, and the image can be understood as the file that loads the target container. The architecture type of the image can be used to indicate the type of instruction set contained in the container generated based on the image. For example, when the architecture type of the image is ARM, the instruction set contained in the container created based on the image is the ARM instruction set; when the image architecture type of the image is X86, the instruction set contained in the container created based on the image is the X86 instruction set.
[0050] The image node 120 is used to store the image for creating the container.
[0051] Optionally, a warehouse is provided in the image node, and the warehouse stores images for creating containers, including images for creating target containers. Here, the target container is the container to be created indicated by the scheduling task.
[0052] It should be noted that the above-mentioned mirror node can be the main node, that is, the warehouse can be deployed in the main node; or the mirror node is other nodes in the cluster except the main node; or the warehouse in the mirror node can also be deployed in multiple nodes in the cluster in the form of a distributed database. For example, the warehouse in the mirror node can be deployed in the main node and other nodes in the form of a distributed database.
[0053] The working node 130 is used to create a target container based on the image obtained from the image node 120 and run the target container.
[0054] Specifically, the processor architecture types of the multiple working nodes included in the cluster may be different. For example, the multiple working nodes include at least one working node with an ARM processor architecture type and at least one working node with an X86 processor architecture type.
[0055] It should be noted that the above-mentioned working node can be a physical machine, such as a server; the above-mentioned working node can also be a virtual machine, which is not limited in the embodiments of the present application.
[0056] Optionally, all target containers in a container group are created or run on a target node in the cluster.
[0057] It should be noted that a working node in a cluster can create and run containers in at least one container group.
[0058] In order to improve the degree of automation of the master node in executing scheduling tasks, an embodiment of the present application provides a scheduling method, which avoids the configuration process in the traditional scheduling method that relies on maintenance personnel to manually configure the IP addresses of each working node in the cluster according to the processor architecture type of different working nodes in the cluster.
[0059] The following is based on Figure 1 The architecture shown, combined with Figure 2 The scheduling method of the embodiment of the present application is described in detail. Figure 2 is a schematic flow chart of a scheduling method according to an embodiment of the present application. Figure 2 The method shown includes: step 210 to step 230.
[0060] 210. The master node receives a scheduling task, where the scheduling task is used to schedule a working node in the cluster to create a target container. The scheduling task includes an image name of an image used to create the target container.
[0061] 220. The master node obtains a processor architecture type of a working node for creating the target container according to the image name of the image.
[0062] Specifically, the processor architecture type of the working node for creating the target container may mean that the working node of the processor architecture type can execute all instructions in the instruction set of the target container, that is, the type of the instruction set of the target container matches the processor architecture type.
[0063] Optionally, the processor architecture type includes ARM architecture and X86 architecture.
[0064] In a possible implementation, the master node includes a daemon process of a container engine, and step 220 includes: the master node sends the image name of the image to the daemon process of the container engine; the master node receives the image architecture type of the image sent by the daemon process of the container engine, the image architecture type of the image is determined by the daemon process of the container engine according to the correspondence between the image name of the image and the image architecture type of the image, and the image architecture type of the image is used to indicate the processor architecture type of the working node that creates the target container.
[0065] Specifically, the image architecture type of the above-mentioned image is determined by the daemon of the container engine according to the correspondence between the image name of the image and the image architecture type of the image. It can be understood that the daemon of the container engine calls an interface to access the warehouse for storing images, and determines the image architecture type of the image used to create the target container according to the image name of the image used to create the target container, and the correspondence between the image name of the image stored in the warehouse and the image architecture type of the image.
[0066] Since worker nodes of different processor architecture types can execute different types of instruction sets, the image architecture type of the above image is used to indicate the processor architecture type of the worker node that creates the target container. It can be understood that the image architecture type of the image indicates the processor architecture type of the worker node that creates the target container by indicating the type of instruction set in the target container created based on the image.
[0067] In an embodiment of the present application, the type of the image architecture of the target container is obtained through the daemon process of the container engine set in the master node, so as to select the target node for creating the target container from the working nodes of the cluster, and the processor architecture of the target node can execute the instruction set in the target container, which is conducive to improving the automation of the master node in executing the scheduling task. Avoid the process in which the maintenance personnel need to manually configure the working nodes of different processor architecture types in different IP network segments in the traditional scheduling scheme.
[0068] 230. The master node selects a target node from the cluster for creating the target container, wherein the processor architecture type of the target node is the same as the processor architecture type of the working node for creating the target container.
[0069] In other words, the master node selects the target node based on the processor architecture type of the worker node that creates the target container and the processor architecture type of the worker nodes in the cluster.
[0070] It should be understood that the processor architecture type of the working nodes in the cluster may be sent by each working node to the master node when each working node registers with the master node in the cluster during the process of forming the cluster.
[0071] In an embodiment of the present application, the master node can obtain the processor architecture type of the working node that creates the target container based on the image name of the image used to create the target container, so as to automatically screen the working nodes in the cluster based on the processor architecture type and determine the target node for creating the target container. This is conducive to improving the degree of automation of the master node in executing scheduling tasks. It avoids the process in which maintenance personnel need to manually configure working nodes of different processor architecture types in different IP network segments in traditional scheduling schemes.
[0072] In a possible implementation, the above step 230 also includes: the master node selects at least one working node from the cluster, the processor type of the at least one working node is the same as the processor architecture type of the working node for creating the target container; the master node selects the target node from the at least one working node.
[0073] Specifically, the at least one working node may be understood as a set of candidate working nodes that may create a target container.
[0074] Optionally, when the at least one working node is one working node, the target node may be the working node; and when the at least one working node is multiple working nodes, the master node may determine one working node from the multiple working nodes as the target node.
[0075] The master node may randomly select a target node from a plurality of working nodes, or may select a target node from a plurality of working nodes according to a preset scoring rule. That is, the master node determines the score of each working node in the at least one working node according to a preset scoring rule; the master node selects the working node with the highest score in the at least one working node as the target node.
[0076] Specifically, the integration rule is used to indicate the current performance of each working node in the at least one working node.
[0077] Optionally, the scoring rules include at least one of the following rules: the higher the resource surplus rate of the processor of the working node, the higher the score of the working node; the higher the storage resource surplus rate of the working node, the higher the score of the working node; and the higher the network resource surplus rate of the working node, the higher the score of the working node.
[0078] In a possible implementation, the method further includes: step 240 to step 250.
[0079] 240. The target node obtains the image file indicated by the image name of the image from the image node.
[0080] Specifically, the image node stores an image file for creating a target container. The target node obtains the image file stored in the image node through the network according to the image name in the scheduling task. The image file can be stored in the storage space of the target node, which can be a memory or other storage medium.
[0081] 250. The target node creates the target container on the target node according to the image file.
[0082] The following example uses the architecture where the Docker client runs on the master node in the Kubernetes cluster, and the scheduling module in the master node communicates with the Docker Daemon through the client proxy module of the Docker container engine. Figure 3 The scheduling method of the embodiment of the present application is introduced, wherein the client proxy module of the client engine can complete the mutual conversion of interfaces in two different architectures, thereby achieving the compatibility of the two architectures.
[0083] Figure 3 It is a schematic flowchart of a scheduling method according to another embodiment of the present application. Figure 3 The method shown includes steps 310 to 370 .
[0084] 310. The container scheduling module receives a scheduling task.
[0085] Specifically, the scheduling task is used to schedule the working nodes in the cluster to create a target container. The scheduling task includes the image name of the image used to create the target container.
[0086] 320, the container scheduling module sends the image name of the image used to create the target container to the Docker Daemon through the Docker client.
[0087] Specifically, the target container group can be understood as a "logical host" in a container environment, including one or more target containers for running multiple closely connected applications. For example, in the Docker architecture, a target container group can be composed of multiple related containers that share a disk.
[0088] 330, Docker Daemon obtains the image architecture type of the image according to the image name of the image used to create the target container and the correspondence between the image name and the type of the image architecture, where the image architecture type indicates the processor architecture type of the working node that creates the target container.
[0089] Specifically, the above-mentioned image architecture type can be used to indicate the type of instruction set contained in the container generated by the image based on the image architecture. For example, the instruction set contained in the container created by the image whose image architecture type is ARM architecture is the ARM instruction set, and it needs to be executed by a working node with a processor architecture of ARM architecture; the instruction set contained in the container created by the image whose image architecture type is X86 architecture is the X86 instruction set, and it needs to be executed by a working node with a processor architecture of X86 architecture.
[0090] Optionally, the above-mentioned image architecture types may include ARM architecture and X86 architecture.
[0091] It should be noted that the correspondence between the above image name and the image architecture type can be stored in the container engine's warehouse, which can be deployed separately on the master node, or separately deployed on other nodes in the cluster, or deployed in the master node and other nodes of the cluster in the form of a distributed database. The master node can call the container engine's daemon interface to access the warehouse and determine the node architecture type corresponding to the image name.
[0092] It should also be understood that the daemon process of the container engine in the master node can obtain permission to access the repository of the container engine that creates the container in the container group through a pre-configured authentication method, so that the scheduling module in the master node can obtain the image architecture type of the target container through the daemon process of the container engine.
[0093] Specifically, the above authentication method can be a method in which the daemon process of the container engine in the master node uses a user name and password, or a method in which the daemon process of the container engine in the master node uses an authentication file. The embodiments of the present application do not specifically limit this.
[0094] 340, the scheduling module receives, through the Docker client, the image architecture type of the image used to create the target container sent by the Docker Daemon, to determine the processor architecture type of the working node for creating the target container.
[0095] 350. The container scheduling module selects at least some working nodes from the working nodes of the cluster according to the processor architecture type of the working node that creates the target container and the processor architecture type of the working nodes in the cluster, and the architecture type of at least some of the working nodes is the same as the processor architecture type of the working node that creates the target container.
[0096] It should be noted that the processor architecture type of the working nodes in the cluster may be sent by each working node to the master node when each working node registers with the master node in the cluster during the process of forming the cluster.
[0097] 360. The container scheduling module determines a target node from at least part of the working nodes according to an integration rule, and the target node is used to create a target container.
[0098] Specifically, at least some of the working nodes mentioned above can be understood as candidate nodes that can create the target container, and the target node mentioned above can be understood as a working node that ultimately creates the target container.
[0099] It should be understood that the at least some of the working nodes mentioned above may be all the working nodes or a part of the working nodes in the cluster.
[0100] 370. The target node obtains the image file required to create the target container from the image node, and creates and runs the target container based on the image file.
[0101] Through the above description, in the scheduling method provided by the embodiment of the present application, the master node can obtain the processor architecture type of the working node that creates the target container according to the image name, and select a target node in the working node of the cluster according to the processor architecture type, and create the target container by the target node to complete the scheduling task. Compared with the traditional technical solution, the above process does not require maintenance personnel to plan and configure the IP address of the working node in advance to avoid introducing human errors. Moreover, the processing process does not require human intervention, which improves the degree of automation of the task scheduling process. At the same time, it also improves the efficiency of scheduling task processing and reduces the scheduling task processing time.
[0102] Combination of the above Figures 1 to 3 The scheduling method of the embodiment of the present application is described in detail. Figures 4 to 5 The scheduling device and the master node of the embodiment of the present application are described in detail. It should be noted that: Figures 4 to 5 The device and the master node shown can implement each step in the above method, and for the sake of brevity, they will not be repeated here.
[0103] Figure 4 is a schematic block diagram of a scheduling device according to an embodiment of the present application. Figure 4 The device 400 shown includes: a receiving module 410 , an acquiring module 420 and a processing module 430 .
[0104] A receiving module 410 is used to receive a scheduling task, where the scheduling task is used to schedule a working node in a cluster to create a target container, and the scheduling task includes an image name of an image used to create the target container;
[0105] An acquisition module 420 is used to acquire a processor architecture type of a working node for creating the target container according to the image name of the image;
[0106] The processing module 430 is configured to select a target node for creating the target container from the cluster, wherein the processor architecture type of the target node is the same as the processor architecture type of the working node for creating the target container.
[0107] Optionally, the master node includes a daemon process of a container engine, and the acquisition module is specifically used to: send the image name of the image to the daemon process of the container engine; receive the type of the image architecture of the image sent by the daemon process of the container engine, the image architecture type of the image is determined by the daemon process of the container engine according to the correspondence between the image name of the image and the image architecture type of the image, and the image architecture type of the image is used to indicate the processor architecture type of the working node for creating the target container.
[0108] Optionally, the processor architecture types include X86 and Advanced Reduced Instruction Set Machine ARM.
[0109] Optionally, the processing module is specifically used to: select at least one working node from the cluster, the processor type of the at least one working node is the same as the processor architecture type of the working node for creating the target container; and select the target node from the at least one working node.
[0110] Optionally, the processing module is further specifically used to: determine the score of each working node in the at least one working node according to a preset score rule; and select the working node with the highest score in the at least one working node as the target node.
[0111] Optionally, the scoring rule includes at least one of the following items: the higher the resource surplus rate of the processor of the working node, the higher the score of the working node; the higher the storage resource surplus rate of the working node, the higher the score of the working node; and the higher the network resource surplus rate of the working node, the higher the score of the working node.
[0112] In an optional embodiment, the apparatus 400 may also be a master node 500. Specifically, the receiving module 410 and the acquiring module 420 may be an input / output interface 530, and the processing module 430 may be a processor 520. The master node 500 may also include a memory 510. Specifically, Figure 5 shown.
[0113] It should be understood that the device 400 of the embodiment of the present invention can be implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), and the PLD can be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. It can also be implemented by software. Figure 3 When implementing the VRRP backup group shown in the figure, the device 400 and its various modules may also be software modules.
[0114] The apparatus 400 according to the embodiment of the present invention may correspond to executing the method described in the embodiment of the present invention, and the above and other operations and / or functions of each unit in the apparatus 400 are respectively to implement Figure 2 and Figure 3 For the sake of brevity, the corresponding processes of each method are not repeated here.
[0115] Through the above description, the device 400 provided in the embodiment of the present application can obtain the processor architecture type of the working node for creating the target container according to the image name, and select a target node in the working node of the cluster according to the processor architecture type, and create the target container by the target node to complete the scheduling task. Compared with the traditional technical solution, the above process does not require maintenance personnel to plan and configure the IP address of the working node in advance to avoid introducing human errors. Moreover, the processing process does not require human intervention, which improves the automation of the task scheduling process. At the same time, it also improves the efficiency of scheduling task processing and reduces the scheduling task processing time.
[0116] Figure 5 It is a schematic block diagram of the master node of an embodiment of the present application. Figure 5 The master node 500 shown may include: a memory 510, a processor 520 and an input / output interface 530. The memory 510, the processor 520 and the input / output interface 530 are connected via an internal connection path, the memory 510 is used to store program instructions, and the processor 520 is used to execute the program instructions stored in the memory 520 to control the input / output interface 530 to receive input data and information and output data such as operation results.
[0117] It should be understood that in the embodiment of the present application, the processor 520 may adopt a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Alternatively, the processor 520 may adopt one or more integrated circuits to execute relevant programs to implement the technical solutions provided in the embodiment of the present application.
[0118] The memory 510 may include a read-only memory and a random access memory, and provides instructions and data to the processor 520. A portion of the processor 520 may also include a nonvolatile random access memory. For example, the processor 520 may also store information on the device type.
[0119] In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 520 or an instruction in the form of software. The method disclosed in conjunction with the embodiment of the present application can be directly embodied as a hardware processor for execution, or a combination of hardware and software modules in the processor for execution. The software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 510, and the processor 520 reads the information in the memory 510 and completes the steps of the above method in conjunction with its hardware. To avoid repetition, it is not described in detail here.
[0120] It should be understood that the master node 500 according to the embodiment of the present invention may correspond to the device 400 in the embodiment of the present invention, and may correspond to executing the method according to the embodiment of the present invention. Figure 2 and Figure 3 The corresponding subject in the method for implementing the scheduling task, and the above and other operations and / or functions of each module in the master node 500 are respectively to implement Figures 2 to 3 For the sake of brevity, the corresponding processes of each method in are not repeated here.
[0121] Through the above description, the master node 500 provided in the embodiment of the present application can obtain the processor architecture type of the working node that creates the target container according to the image name, and select a target node in the working node of the cluster according to the processor architecture type, and create the target container by the target node to complete the scheduling task. Compared with the traditional technical solution, the above process does not require maintenance personnel to plan and configure the IP address of the working node in advance to avoid introducing human errors. Moreover, the processing process does not require human intervention, which improves the automation of the task scheduling process. At the same time, it also improves the scheduling task processing efficiency and reduces the scheduling task processing time.
[0122] It should be understood that in the embodiment of the present application, "B corresponding to A" means that B is associated with A, and B can be determined according to A. However, it should also be understood that determining B according to A does not mean determining B only according to A, and B can also be determined according to A and / or other information.
[0123] It should be understood that the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0124] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0125] 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 through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0126] 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.
[0127] 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.
[0128] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any other combination. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium may be a solid state drive (SSD).
[0129] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A scheduling method, characterized in that: include: Receive a scheduling task, where the scheduling task is used to schedule a working node in a cluster to create a target container, and the scheduling task includes an image name of an image used to create the target container; Selecting a target node from the cluster for creating the target container; An image file matching the processor architecture type of the target node is acquired using the image name, and the target container is created on the target node using the image file.
2. The method according to claim 1, characterized in that: The method comprises: The image architecture type of the image is obtained, where the image architecture type of the image is used to indicate the processor architecture type of the working node that creates the target container.
3. The method according to claim 1 or 2, characterized in that: The processor architecture type is X86 architecture or Advanced RISC Machine ARM architecture.
4. The method according to claim 1 or 2, characterized in that: The using the image name to obtain an image file matching the processor architecture type of the target node and using the image file to create the target container on the target node includes: The target node obtains the image file indicated by the image name of the image from the image node; The target node creates the target container on the target node according to the image file.
5. The method according to claim 2, characterized in that: The image architecture type of the image is X86 architecture, and the processor architecture type of the target node is X86 architecture; or, The image architecture type of the image is an Advanced Reduced Instruction Set Machine (ARM) architecture, and the processor architecture type of the target node is an ARM architecture.
6. The method according to claim 1 or 2, characterized in that: The working node is a virtual machine or a server.
7. The method according to claim 1 or 2, characterized in that: The cluster is a Kubernetes cluster.
8. The method according to claim 1 or 2, characterized in that: The target container is a container in the container group.
9. A scheduling device, characterized in that: include: A receiving module, used to receive a scheduling task, where the scheduling task is used to schedule a working node in a cluster to create a target container, where the scheduling task includes an image name of an image used to create the target container; A processing module, configured to select a target node from the cluster for creating the target container; A creation module is used to use the image name to obtain an image file that matches the processor architecture type of the target node, and use the image file to create the target container on the target node.
10. The device according to claim 9, characterized in that: The device also includes an acquisition module, which is used to acquire an image architecture type of the image, where the image architecture type of the image is used to indicate a processor architecture type of a working node that creates the target container.
11. The device according to claim 9 or 10, characterized in that: The processor architecture type is X86 architecture or Advanced RISC Machine ARM architecture.
12. The device according to claim 9 or 10, characterized in that The image architecture type of the image is X86 architecture, and the processor architecture type of the target node is X86 architecture; or, The image architecture type of the image is an Advanced Reduced Instruction Set Machine (ARM) architecture, and the processor architecture type of the target node is an ARM architecture.
13. The device according to claim 9, characterized in that The working node is a virtual machine or a server.
14. The device according to claim 9 or 10, characterized in that The cluster is a Kubernetes cluster.
15. The device according to claim 9 or 10, characterized in that The target container is a container in the container group.
16. The device according to claim 9 or 10, characterized in that The device is a master node included in the cluster.
17. A server, characterized in that: The server comprises a processor and a memory; when the processor executes the instructions stored in the memory, the server executes the method described in any one of claims 1 to 8.
18. A computer program product, characterized in that The computer program product comprises instructions for instructing a computing device to execute the steps of the method according to any one of claims 1 to 8.
19. A non-volatile storage medium, characterized in that: The non-volatile storage medium comprises instructions, wherein the instructions instruct a computing device to execute the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
System and method for configuring cloud computing systems
CN104520814A
Container service-based scheduling method and device
CN107391239A