CN115145691A - Container scheduling system and method based on kubernets multiple clusters - Google Patents
Container scheduling system and method based on kubernets multiple clusters Download PDFInfo
- Publication number
- CN115145691A CN115145691A CN202210797835.9A CN202210797835A CN115145691A CN 115145691 A CN115145691 A CN 115145691A CN 202210797835 A CN202210797835 A CN 202210797835A CN 115145691 A CN115145691 A CN 115145691A
- Authority
- CN
- China
- Prior art keywords
- cluster
- container
- list
- clusters
- deployment
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/5044—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering hardware capabilities
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/4557—Distribution of virtual machine instances; Migration and load balancing
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a container scheduling system and method based on kubernets multi-cluster, belonging to the technical field of cloud computing, aiming at solving the technical problem of realizing the automatic deployment and scheduling of containers of a kubernets multi-cluster operation and management platform in multi-cluster, and adopting the technical scheme that: the system comprises a cluster receiving and managing unit, a cluster information detection unit, a cluster container scheduling unit and a storage unit. The method comprises the following specific steps: acquiring one or more schedulable clusters according to the cluster information detection unit to obtain a schedulable cluster list; screening the schedulable cluster list through a cluster preselection algorithm to obtain a cluster list capable of deploying a container as an available cluster list; performing integral calculation on clusters in the available cluster list through a cluster optimization algorithm, and sequencing the clusters according to the integral obtained by the clusters to obtain a cluster deployment list; and sequentially selecting the clusters from the cluster deployment list to deploy the containers according to the cluster deployment list and the needs of the clusters in the cluster deployment strategy.
Description
Technical Field
The invention relates to the technical field of cloud computing, in particular to a container scheduling system and method based on kubernets.
Background
Kubernets is an important ring of current cloud computing basic technology, and the use scene is very wide. Developers can use Kubernets to realize the bottom layer of the cloud computing platform, more and more cloud platforms are generated along with the development of the cloud computing and internet times, and meanwhile, the generation of the kubernets multi-cluster transportation and management platform is promoted. However, the current kubernets multi-cluster transport management platform generally can only provide deployment of containers in a single cluster and unified deployment of containers under multiple clusters, and cannot realize automatic scheduling deployment of containers under multiple kubernets, multiple redundant operations exist in single cluster container deployment, multiple cluster unified deployment requires workers to manually judge adaptation degree of the containers and the clusters, and technical difficulty and working cost of the workers are increased.
Therefore, how to realize the automatic deployment and scheduling of the kubernets multi-cluster transportation management platform container in multiple clusters and reduce the technical difficulty and the working cost of workers is a technical problem to be solved urgently at present.
Disclosure of Invention
The technical task of the invention is to provide a container scheduling system and method based on a kubernets multi-cluster, so as to solve the problem that the existing kubernets multi-cluster transportation and management platform cannot realize automatic scheduling and deployment of containers under multiple kubernets clusters.
The technical task of the invention is realized in the following way, a container scheduling system based on kubernets multiple clusters comprises a cluster nano-tube unit, a cluster information detection unit, a cluster container scheduling unit and a storage unit;
the cluster admission management unit is used for carrying out unified admission management on the kubernets in different environments and storing the state information of the clusters in the storage unit;
the cluster information detection unit is used for detecting and collecting the state information of the kubernets cluster managed by the cluster management unit in real time;
the cluster container scheduling unit is used for analyzing the deployment information of the cluster container deployment strategy, and respectively using a cluster preselection algorithm and a cluster priority algorithm to screen and calculate the integral of the cluster; carrying out automatic dispatching deployment of the containers in the multiple clusters according to the cluster container deployment strategy;
the storage unit is used for storing relevant information needing to be stored, such as a cluster container deployment strategy, a cluster state and the like.
Preferably, the working process of the cluster container scheduling unit is as follows:
(1) Analyzing the deployment strategy of the cluster container;
(2) Judging whether various cluster preselection information exists:
(1) if so, screening the cluster according to the preselected information by the cluster optimization algorithm, and skipping to the step (4);
(2) if not, executing the step (3);
(3) Judging whether a priority field is set:
(1) if so, screening the cluster by using the set priority, and skipping to the step (4);
(2) if not, screening the cluster by using default priority and information, and skipping to the step (4);
(4) Acquiring an available cluster list;
(5) And performing integral calculation on the clusters in the available cluster list, wherein the formula is as follows:
cluster final score = preferred algorithm one score + preferred algorithm two weight;
calculating a score according to the number of deployment copies of the container in the cluster container deployment strategy and the number of nodes of the cluster in the available list cluster; the method comprises the following specific steps:
when the number of the nodes of the cluster is larger than the number of the copies of the cluster container, the more the number of the nodes of the cluster is, the lower the score of the cluster is;
when the number of the nodes of the cluster is less than the number of the copies of the cluster container, the smaller the number of the nodes of the cluster is, the lower the cluster score is;
the cluster scores of the cluster with the node number smaller than the container copy number of the cluster are smaller than the cluster scores with the node number larger than the container copy number of the cluster;
the nodes with the cluster node number closest to the copy number of the cluster container are selected through a first optimization algorithm, so that the screening efficiency of the cluster on the nodes when the container is deployed is improved;
the second preferred algorithm is to perform integral calculation on the cluster according to the average values of the rest CPUs and the memories of the cluster;
wherein, the larger the average value of the residual CPU and the memory of the cluster is, the higher the obtained integral of the cluster is; conversely, the smaller the average value of the remaining CPUs and memories of the cluster is, the lower the obtained integral of the cluster is;
(6) Calculating the final score of the cluster through a cluster integral calculation formula, a preferred algorithm first score and a preferred algorithm second score;
(7) And sorting the clusters in the available cluster list according to the final score of each cluster to obtain a cluster deployment list.
A container scheduling method based on a kubernets multi-cluster is specifically as follows:
acquiring one or more schedulable clusters according to the cluster information detection unit to obtain a schedulable cluster list;
screening the schedulable cluster list through a cluster preselection algorithm to obtain a cluster list capable of deploying containers as an available cluster list;
performing integral calculation on clusters in the available cluster list through a cluster optimization algorithm, and sequencing the clusters according to the integral obtained by the clusters to obtain a cluster deployment list;
and sequentially selecting the clusters from the cluster deployment list to deploy the containers according to the cluster deployment list and the requirements on the clusters in the cluster deployment strategy.
Preferably, the obtaining process of the schedulable cluster list is as follows:
monitoring the state information of the cluster which is managed by the cluster managing unit in real time; the method comprises the following specific steps:
if the state information of the cluster is a healthy state, the cluster is a schedulable cluster;
and if the state information of the cluster is in the unhealthy state, the cluster is not dispatchable.
Preferably, the schedulable cluster list is screened by a cluster preselection algorithm, and the cluster list capable of deploying the container is obtained as an available cluster list as follows:
analyzing a deployment strategy of the cluster container through a cluster container scheduling unit, and selecting a proper cluster preselection algorithm according to the cluster container deployment strategy to screen a schedulable cluster list to obtain an available cluster list;
the cluster preselection algorithm screens the schedulable cluster list according to the cluster name, the cluster label and the cluster grouping information set in the cluster container deployment strategy;
the cluster name, the cluster label and the cluster grouping information set in the cluster container deployment strategy are all set to be multiple, for example: two cluster names may be set; meanwhile, the cluster name, the cluster label and the cluster grouping information set in the cluster container deployment strategy are used independently or in combination; when the cluster preselection algorithm is combined for use, the clusters which accord with all conditions are screened, the execution priority of the cluster names, the cluster labels and the cluster grouping information in the cluster preselection algorithm is set through the algorithm priority field, and the execution efficiency of the cluster preselection algorithm is effectively improved through reasonably setting the algorithm priority;
all clusters that pass the cluster pre-selection algorithm form a list of available clusters.
Preferably, the integral calculation is performed on the clusters in the available cluster list through a cluster optimization algorithm, and the clusters are sorted according to the integral obtained by the clusters, so as to obtain a cluster deployment list as follows:
performing integral calculation on the clusters in the available cluster list, wherein the formula is as follows:
cluster end score = preferred algorithm one score + preferred algorithm two weight;
and calculating the final scores of the clusters through a cluster integral calculation formula, the first preferred algorithm score and the second preferred algorithm score, and sequencing the clusters in the available cluster list according to the final scores of all the clusters to obtain a cluster deployment list.
Preferably, the preferred algorithm is to calculate the score according to the number of deployment copies of the container in the cluster container deployment strategy and the number of nodes of the cluster in the available list cluster; the method comprises the following specific steps:
when the number of the nodes of the cluster is larger than the number of the copies of the cluster container, the more the number of the nodes of the cluster is, the lower the score of the cluster is;
when the number of the nodes of the cluster is less than the number of the copies of the cluster container, the smaller the number of the nodes of the cluster is, the lower the cluster score is;
the cluster scores of the cluster with the node number smaller than the container copy number of the cluster are smaller than the cluster scores with the node number larger than the container copy number of the cluster;
selecting the nodes with the cluster node number which is most similar to the copy number of the cluster container through a preferred algorithm, so that the screening efficiency of the cluster on the nodes when the cluster deploys the container is improved;
the second preferred algorithm is to perform integral calculation on the cluster according to the average values of the rest CPUs and the memories of the cluster;
wherein, the larger the average value of the remaining CPU and memory of the cluster is, the higher the obtained integral of the cluster is; conversely, the smaller the average of the remaining CPU and memory of the cluster, the lower the resulting integral of the cluster.
Preferably, according to the cluster deployment list and the requirement for the cluster in the cluster deployment strategy, sequentially selecting the cluster from the cluster deployment list to deploy the container specifically as follows:
and analyzing the deployment strategy of the cluster container through the cluster container scheduling unit, analyzing cluster deployment information required by container deployment, and sequentially acquiring the cluster from the cluster deployment list through the deployment information of the cluster to deploy the container.
An electronic device, comprising: a memory and at least one processor;
wherein the memory has stored thereon a computer program;
the at least one processor executes the memory-stored computer program to cause the at least one processor to perform the kubernets multi-cluster based container scheduling method as described above.
A computer-readable storage medium having stored therein a computer program executable by a processor to implement a kubernets multi-cluster based container scheduling method as described above.
The container scheduling system and method based on the kubernets multi-cluster have the following advantages:
the invention can automatically select the cluster list suitable for container deployment through the cluster budget algorithm and the cluster optimization algorithm, solves the problem of automatic deployment and scheduling of the prior Kubernets multi-cluster transportation and management platform container in multiple clusters, and reduces the technical difficulty and the working cost of workers;
by reasonably setting the algorithm priority in the budget algorithm, the invention can greatly improve the screening speed of the clusters and improve the deployment efficiency of the containers under multiple clusters.
Drawings
The invention is further described below with reference to the accompanying drawings.
FIG. 1 is a flow chart of a method for container scheduling based on kubernets multi-cluster;
fig. 2 is a flow chart of the working process of the cluster container scheduling unit.
Detailed Description
The system and method for dispatching containers based on kubernets multi-cluster according to the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
Example 1:
the embodiment provides a container scheduling system based on a kubernets multi-cluster, which comprises a cluster admission management unit, a cluster information detection unit, a cluster container scheduling unit and a storage unit;
the cluster admission management unit is used for carrying out unified admission management on the kubernets in different environments and storing the state information of the clusters in the storage unit;
the cluster information detection unit is used for detecting and collecting the state information of the kubernets cluster managed by the cluster management unit in real time;
the cluster container scheduling unit is used for analyzing the deployment information of the cluster container deployment strategy, and respectively using a cluster preselection algorithm and a cluster priority algorithm to screen and calculate the integral of the cluster; carrying out automatic dispatching deployment of the containers in the multiple clusters according to the cluster container deployment strategy;
the storage unit is used for storing relevant information needing to be stored, such as a cluster container deployment strategy, a cluster state and the like.
As shown in fig. 2, the working process of the cluster container scheduling unit in this embodiment is as follows:
(1) Analyzing the deployment strategy of the cluster container;
(2) Judging whether various cluster preselection information exists:
(1) if so, screening the cluster according to the preselected information by the cluster optimization algorithm, and skipping to the step (4);
(2) if not, executing the step (3);
(3) Judging whether a priority field is set:
(1) if so, screening the cluster by using the set priority, and skipping to the step (4);
(2) if not, using the default priority and the information screening cluster, and skipping to the step (4);
(4) Acquiring an available cluster list;
(5) And carrying out integral calculation on the clusters in the available cluster list, wherein the formula is as follows:
cluster end score = preferred algorithm one score + preferred algorithm two weight;
calculating a score according to the number of deployment copies of the container in the cluster container deployment strategy and the number of nodes of the cluster in the available list cluster; the method comprises the following specific steps:
when the number of the nodes of the cluster is larger than the number of the copies of the cluster container, the more the number of the nodes of the cluster is, the lower the score of the cluster is;
when the number of the nodes of the cluster is smaller than the number of the copies of the cluster container, the smaller the number of the nodes of the cluster is, the lower the cluster score is;
the cluster scores of the cluster with the number of nodes smaller than the number of the container copies of the cluster are smaller than the cluster scores with the number of the nodes larger than the number of the container copies of the cluster;
selecting the nodes with the cluster node number which is most similar to the copy number of the cluster container through a preferred algorithm, so that the screening efficiency of the cluster on the nodes when the cluster deploys the container is improved;
the second preferred algorithm is to perform integral calculation on the cluster according to the average values of the rest CPUs and the memories of the cluster;
wherein, the larger the average value of the residual CPU and the memory of the cluster is, the higher the obtained integral of the cluster is; conversely, the smaller the average value of the remaining CPUs and memories of the cluster is, the lower the obtained integral of the cluster is;
(6) Calculating the final score of the cluster through a cluster integral calculation formula, a preferred algorithm first score and a preferred algorithm second score;
(7) And sorting the clusters in the available cluster list according to the final score of each cluster to obtain a cluster deployment list.
Example 2:
as shown in fig. 1, the present invention provides a container scheduling method based on kubernets multiple clusters, which specifically includes the following steps:
s1, acquiring one or more schedulable clusters according to a cluster information detection unit to obtain a schedulable cluster list;
s2, screening the schedulable cluster list through a cluster preselection algorithm to obtain a cluster list capable of deploying the container as an available cluster list;
s3, performing integral calculation on the clusters in the available cluster list through a cluster optimization algorithm, and sequencing the clusters according to the integral obtained by the clusters to obtain a cluster deployment list;
and S4, sequentially selecting the clusters from the cluster deployment list to deploy the containers according to the cluster deployment list and the requirements of the clusters in the cluster deployment strategy.
The process of acquiring the schedulable cluster list in step S1 in this embodiment is specifically as follows:
monitoring the state information of the cluster which is managed by the cluster managing unit in real time; the method comprises the following specific steps:
(1) if the state information of the cluster is in a healthy state, the cluster is a schedulable cluster;
(2) and if the state information of the cluster is in the unhealthy state, the cluster is not dispatchable.
In this embodiment, the step S2 of screening the schedulable cluster list through the cluster preselection algorithm, and obtaining the cluster list capable of deploying the container as the available cluster list specifically includes:
s201, analyzing a deployment strategy of a cluster container through a cluster container scheduling unit, and selecting a proper cluster preselection algorithm according to the cluster container deployment strategy to screen a schedulable cluster list to obtain an available cluster list;
s202, a cluster preselection algorithm screens schedulable cluster lists according to cluster names, cluster labels and cluster grouping information set in a cluster container deployment strategy;
s203, multiple cluster names, cluster labels, and cluster grouping information set in the cluster container deployment policy are set, for example: two cluster names may be set; meanwhile, the cluster name, the cluster label and the cluster grouping information set in the cluster container deployment strategy are used independently or in combination; when the cluster preselection algorithm is combined for use, the clusters which accord with all conditions are screened, the execution priority of the cluster names, the cluster labels and the cluster grouping information in the cluster preselection algorithm is set through the algorithm priority field, and the execution efficiency of the cluster preselection algorithm is effectively improved through reasonably setting the algorithm priority;
and S204, forming an available cluster list by all clusters passing through a cluster preselection algorithm.
In this embodiment, in step S3, the integral calculation is performed on the clusters in the available cluster list through a cluster optimization algorithm, and the clusters are sorted according to the integral obtained by the clusters, so as to obtain a cluster deployment list as follows:
s301, integral calculation is carried out on the clusters in the available cluster list, and the formula is as follows:
cluster end score = preferred algorithm one score + preferred algorithm two weight;
s302, calculating the final scores of the clusters through a cluster integral calculation formula, the first preferred algorithm score and the second preferred algorithm score, and sequencing the clusters in the available cluster list according to the final scores of all the clusters to obtain a cluster deployment list.
In the preferred algorithm in this embodiment, a score is calculated according to the number of deployment copies of a container in a cluster container deployment strategy and the number of nodes of the cluster in an available list cluster; the method comprises the following specific steps:
when the number of the nodes of the cluster is larger than the number of the copies of the cluster container, the more the number of the nodes of the cluster is, the lower the score of the cluster is;
when the number of the nodes of the cluster is smaller than the number of the copies of the cluster container, the smaller the number of the nodes of the cluster is, the lower the cluster score is;
the cluster scores of the cluster with the number of nodes smaller than the number of the container copies of the cluster are smaller than the cluster scores with the number of the nodes larger than the number of the container copies of the cluster;
selecting the nodes with the cluster node number which is most similar to the copy number of the cluster container through a preferred algorithm, so that the screening efficiency of the cluster on the nodes when the cluster deploys the container is improved;
the second preferred algorithm in this embodiment is to perform integral calculation on the cluster according to the average values of the remaining CPUs and memories of the cluster;
wherein, the larger the average value of the residual CPU and the memory of the cluster is, the higher the obtained integral of the cluster is; conversely, the smaller the average of the remaining CPU and memory of the cluster, the lower the resulting integral of the cluster.
In this embodiment, according to the cluster deployment list and the requirement for the cluster in the cluster deployment policy in step S4, sequentially selecting the cluster from the cluster deployment list to perform container deployment specifically as follows:
and analyzing the deployment strategy of the cluster container through the cluster container scheduling unit, analyzing cluster deployment information required by container deployment, and sequentially acquiring the cluster from the cluster deployment list through the deployment information of the cluster to deploy the container.
Example 3:
the present embodiment further provides an electronic device, including: a memory and a processor;
wherein the memory stores computer execution instructions;
the processor executes the computer-executable instructions stored by the memory to cause the processor to perform the method for kubernets multi-cluster based container scheduling in any embodiment of the present invention.
The processor may be a Central Processing Unit (CPU), but may also be other general purpose processors, digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), array of off-the-shelf programmable gates (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. The processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory may be used to store computer programs and/or modules, and the processor may implement various functions of the electronic device by executing or performing the computer programs and/or modules stored in the memory and invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the terminal, and the like. The memory may also include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a memory only card (SMC), a Secure Digital (SD) card, a flash memory card, at least one disk storage period, a flash memory device, or other volatile solid state memory device.
Example 4:
the present embodiment also provides a computer-readable storage medium, in which a plurality of instructions are stored, where the instructions are loaded by a processor, and cause the processor to execute the method for container scheduling based on kubernets multi-cluster in any embodiment of the present invention. Specifically, a system or an apparatus equipped with a storage medium on which software program codes that realize the functions of any of the above-described embodiments are stored may be provided, and a computer (or a CPU or MPU) of the system or the apparatus is caused to read out and execute the program codes stored in the storage medium.
In this case, the program code itself read from the storage medium can realize the functions of any of the above-described embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.
Examples of the storage medium for supplying the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (e.g., CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RYM, DVD-RW, DVD + RW), a magnetic tape, a nonvolatile memory card, and a ROM. Alternatively, the program code may be downloaded from a server computer via a communications network.
Further, it should be clear that the functions of any one of the above-described embodiments may be implemented not only by executing the program code read out by the computer, but also by causing an operating system or the like operating on the computer to perform a part or all of the actual operations based on instructions of the program code.
Further, it is to be understood that the program code read out from the storage medium is written to a memory provided in an expansion board inserted into the computer or to a memory provided in an expansion unit connected to the computer, and then causes a CPU or the like mounted on the expansion board or the expansion unit to perform part or all of the actual operations based on instructions of the program code, thereby realizing the functions of any of the above-described embodiments.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.
Claims (10)
1. A container scheduling system based on kubernets multi-cluster is characterized by comprising a cluster receiving and managing unit, a cluster information detection unit, a cluster container scheduling unit and a storage unit;
the cluster admission management unit is used for carrying out unified admission management on the kubernets in different environments and storing the state information of the clusters in the storage unit;
the cluster information detection unit is used for detecting and collecting the state information of the kubernets cluster managed by the cluster management unit in real time;
the cluster container scheduling unit is used for analyzing the deployment information of the cluster container deployment strategy, and respectively using a cluster preselection algorithm and a cluster priority algorithm to screen and calculate the integral of the cluster; carrying out automatic dispatching deployment of the containers in the multiple clusters according to the cluster container deployment strategy;
the storage unit is used for storing relevant information needing to be stored, such as a cluster container deployment strategy, a cluster state and the like.
2. The system according to claim 1, wherein the cluster container scheduling unit is configured to perform the following operations:
(1) Analyzing the deployment strategy of the cluster container;
(2) Judging whether various cluster preselection information exists:
(1) if so, screening the cluster according to the preselected information by the cluster optimization algorithm, and skipping to the step (4);
(2) if not, executing the step (3);
(3) Judging whether a priority field is set:
(1) if so, screening the cluster by using the set priority, and skipping to the step (4);
(2) if not, using the default priority and the information screening cluster, and skipping to the step (4);
(4) Acquiring an available cluster list;
(5) And carrying out integral calculation on the clusters in the available cluster list, wherein the formula is as follows:
cluster end score = preferred algorithm one score + preferred algorithm two weight;
calculating a score according to the number of deployment copies of the container in the cluster container deployment strategy and the number of nodes of the cluster in the available list cluster; the method comprises the following specific steps:
when the number of the nodes of the cluster is larger than the number of the copies of the cluster container, the more the number of the nodes of the cluster is, the lower the score of the cluster is;
when the number of the nodes of the cluster is smaller than the number of the copies of the cluster container, the smaller the number of the nodes of the cluster is, the lower the cluster score is;
the cluster scores of the cluster with the node number smaller than the container copy number of the cluster are smaller than the cluster scores with the node number larger than the container copy number of the cluster;
selecting a node with the cluster node number closest to the copy number of the cluster container through a first preferred algorithm;
the second preferred algorithm is to perform integral calculation on the cluster according to the average values of the rest CPUs and the memories of the cluster;
wherein, the larger the average value of the residual CPU and the memory of the cluster is, the higher the obtained integral of the cluster is; conversely, the smaller the average value of the remaining CPUs and memories of the cluster is, the lower the obtained integral of the cluster is;
(6) Calculating the final score of the cluster through a cluster integral calculation formula, the score of the preferred algorithm I and the score of the preferred algorithm II;
(7) And sorting the clusters in the available cluster list according to the final score of each cluster to obtain a cluster deployment list.
3. A container scheduling method based on a kubernets multi-cluster is characterized by comprising the following steps:
acquiring one or more schedulable clusters according to the cluster information detection unit to obtain a schedulable cluster list;
screening the schedulable cluster list through a cluster preselection algorithm to obtain a cluster list capable of deploying a container as an available cluster list;
performing integral calculation on the clusters in the available cluster list through a cluster optimization algorithm, and sequencing the clusters according to the integral obtained by the clusters to obtain a cluster deployment list;
and sequentially selecting the clusters from the cluster deployment list to deploy the containers according to the cluster deployment list and the needs of the clusters in the cluster deployment strategy.
4. The method for container scheduling based on kubernets multi-cluster according to claim 3, wherein the obtaining process of the schedulable cluster list is specifically as follows:
monitoring the state information of the cluster which is managed by the cluster managing unit in real time; the method comprises the following specific steps:
if the state information of the cluster is a healthy state, the cluster is a schedulable cluster;
and if the state information of the cluster is in the unhealthy state, the cluster is not dispatchable.
5. The method for container scheduling based on kubernets multiple clusters according to claim 3, wherein the cluster list that can be scheduled is obtained by screening the schedulable cluster list through a cluster preselection algorithm, and the cluster list that can deploy the containers is the available cluster list as follows:
analyzing a deployment strategy of the cluster container through a cluster container scheduling unit, and selecting a proper cluster preselection algorithm according to the cluster container deployment strategy to screen a schedulable cluster list to obtain an available cluster list;
the cluster preselection algorithm screens the schedulable cluster list according to the cluster name, the cluster label and the cluster grouping information set in the cluster container deployment strategy;
a plurality of cluster names, cluster labels and cluster grouping information set in the cluster container deployment strategy are set; meanwhile, the cluster name, the cluster label and the cluster grouping information set in the cluster container deployment strategy are used independently or in combination; when the cluster pre-selection algorithm is used in a combined mode, the clusters which accord with all conditions are screened, and the execution priority of the cluster names, the cluster labels and the cluster grouping information in the cluster pre-selection algorithm is set through the algorithm priority field;
all clusters that pass the cluster pre-selection algorithm form a list of available clusters.
6. The method for container scheduling based on kubernets multiple clusters according to any one of claims 3-5, wherein the clusters in the available cluster list are subjected to integral calculation through a cluster preference algorithm, and the clusters are sorted according to the integral obtained by the clusters, so as to obtain a cluster deployment list as follows:
performing integral calculation on the clusters in the available cluster list, wherein the formula is as follows:
cluster end score = preferred algorithm one score + preferred algorithm two weight;
and calculating the final scores of the clusters through a cluster integral calculation formula, the first preferred algorithm score and the second preferred algorithm score, and sequencing the clusters in the available cluster list according to the final scores of all the clusters to obtain a cluster deployment list.
7. The method for container scheduling based on kubernets multi-cluster according to claim 6, wherein the preferred algorithm is to calculate scores according to the deployment copy number of the container in the cluster container deployment strategy and the node number of the cluster in the available list cluster; the method comprises the following specific steps:
when the number of the nodes of the cluster is larger than the number of the copies of the cluster container, the more the number of the nodes of the cluster is, the lower the score of the cluster is;
when the number of the nodes of the cluster is smaller than the number of the copies of the cluster container, the smaller the number of the nodes of the cluster is, the lower the cluster score is;
the cluster scores of the cluster with the node number smaller than the container copy number of the cluster are smaller than the cluster scores with the node number larger than the container copy number of the cluster;
selecting the nodes with the cluster node number which is most similar to the copy number of the cluster container through a preferred algorithm I;
the second preferred algorithm is to perform integral calculation on the cluster according to the average values of the rest CPUs and the memories of the cluster;
wherein, the larger the average value of the remaining CPU and memory of the cluster is, the higher the obtained integral of the cluster is; conversely, the smaller the average of the remaining CPU and memory of the cluster, the lower the resulting integral of the cluster.
8. The method for container scheduling based on kubernets multiple clusters according to claim 3, wherein the method for container deployment sequentially selects clusters from the cluster deployment list according to the cluster deployment list and the cluster deployment policy for the needs of the clusters specifically comprises the following steps:
and analyzing the deployment strategy of the cluster container through the cluster container scheduling unit, analyzing cluster deployment information required by container deployment, and sequentially acquiring the cluster from the cluster deployment list through the deployment information of the cluster to deploy the container.
9. An electronic device, comprising: a memory and at least one processor;
wherein the memory has stored thereon a computer program;
the at least one processor executing the memory-stored computer program to cause the at least one processor to perform the method of kubernets multi-cluster based container scheduling of any of claims 3-8.
10. A computer-readable storage medium, having stored thereon a computer program executable by a processor for implementing the method for kubernets multi-cluster based container scheduling according to any of claims 3 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210797835.9A CN115145691A (en) | 2022-07-08 | 2022-07-08 | Container scheduling system and method based on kubernets multiple clusters |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210797835.9A CN115145691A (en) | 2022-07-08 | 2022-07-08 | Container scheduling system and method based on kubernets multiple clusters |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115145691A true CN115145691A (en) | 2022-10-04 |
Family
ID=83411376
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210797835.9A Pending CN115145691A (en) | 2022-07-08 | 2022-07-08 | Container scheduling system and method based on kubernets multiple clusters |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115145691A (en) |
-
2022
- 2022-07-08 CN CN202210797835.9A patent/CN115145691A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8850393B2 (en) | Method and apparatus for testing software | |
US10579370B2 (en) | Method to disintegrate a monolith service to microservices | |
CN110519365B (en) | Method for changing equipment service and service changing system | |
CN113377348B (en) | Task adjusting method applied to task engine, related device and storage medium | |
WO2018072408A1 (en) | Memory analysis method, device, system and computing device | |
US20090138117A1 (en) | Tuning order configurator performance by dynamic integration of manufacturing and field feedback | |
CN114840304B (en) | Container scheduling method, electronic equipment and storage medium | |
CN110765615B (en) | Logistics simulation method, device and equipment | |
CN111880939A (en) | Container dynamic migration method and device and electronic equipment | |
CN111104676A (en) | Security detection method, system, device and readable storage medium for third-party component | |
CN112650478A (en) | Dynamic construction method, system and equipment for embedded software development platform | |
CN116431193A (en) | Program patch package packaging method and device, storage medium and electronic equipment | |
CN111625338B (en) | Affinity rule scheduling method and device and related equipment | |
CN114968581A (en) | Pod scheduling method of Kubernetes cluster and related components | |
CN115145691A (en) | Container scheduling system and method based on kubernets multiple clusters | |
US20220076102A1 (en) | Method and apparatus for managing neural network models | |
CN112732358A (en) | Method and device for compiling spacecraft control script | |
CN112000539A (en) | Inspection method and device | |
CN114727100B (en) | Joint debugging method and device for monitoring equipment | |
CN114697328A (en) | Method and system for realizing NiFi high-availability cluster mode | |
CN115964061A (en) | Plug-in updating method and device, electronic equipment and computer readable storage medium | |
CN114546793A (en) | Log generation method and device and computer readable storage medium | |
JP5621914B2 (en) | Information processing apparatus, correction application determination program, and correction application determination method | |
US8359456B2 (en) | Generating random addresses for verification of distributed computerized devices | |
CN117707587B (en) | Method, device, server and storage medium for concurrent upgrade of distributed storage clusters |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |