CN114356549A - Method, device and system for scheduling container resources in multi-container cluster - Google Patents

Method, device and system for scheduling container resources in multi-container cluster Download PDF

Info

Publication number
CN114356549A
CN114356549A CN202111491105.8A CN202111491105A CN114356549A CN 114356549 A CN114356549 A CN 114356549A CN 202111491105 A CN202111491105 A CN 202111491105A CN 114356549 A CN114356549 A CN 114356549A
Authority
CN
China
Prior art keywords
container
resource
cluster
resource scheduling
identifier
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
Application number
CN202111491105.8A
Other languages
Chinese (zh)
Inventor
汪劲松
孔宪森
程呈
王聪儿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Pudong Development Bank Co Ltd
Original Assignee
Shanghai Pudong Development Bank Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shanghai Pudong Development Bank Co Ltd filed Critical Shanghai Pudong Development Bank Co Ltd
Priority to CN202111491105.8A priority Critical patent/CN114356549A/en
Publication of CN114356549A publication Critical patent/CN114356549A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to a method, a device, a system, a computer device, a storage medium and a computer program product for scheduling container resources in a multi-container cluster. The method comprises the following steps: responding to the resource scheduling request, and determining a resource scheduling strategy, wherein the resource scheduling strategy comprises a first identifier of a resource sending container cluster, a second identifier of a resource receiving container cluster and a third identifier of a container resource to be scheduled; generating a resource scheduling instruction according to the resource scheduling strategy; and sending the resource scheduling instruction to the resource sending container cluster corresponding to the first identifier to instruct the resource sending container cluster to read the container resource to be scheduled corresponding to the third identifier, and sending the container resource to be scheduled to the resource receiving container cluster corresponding to the second identifier. The method adopts the container management platform to realize the scheduling of the container resources in the multi-container cluster, and can improve the stability of the scheduling of the container resources in the multi-container cluster.

Description

Method, device and system for scheduling container resources in multi-container cluster
Technical Field
The present application relates to the field of resource scheduling technologies, and in particular, to a method, an apparatus, a system, a computer device, a storage medium, and a computer program product for scheduling container resources in a multi-container cluster.
Background
With the popularity of containers and the growing maturity of container clusters (e.g., kubernets), more and more organizations migrate their infrastructure to container clusters. Due to the requirements of network isolation, scalability, cloudiness and other scenes, it is quite common for an enterprise to run multiple container clusters inside. The resource allocation and scheduling of the multi-container cluster can obviously improve the service availability, and the containers can not only cross regions and cross regions, but also can continue to operate in other normal regions when the bottom layer of a certain region fails.
In the conventional technology, a scheduling method of container resources in a multi-container cluster needs to deploy a control component in one container cluster to upgrade into a control cluster, manage other clusters in by a command, and uniformly complete scheduling of the container resources in the multi-container cluster by taking the control cluster as an entrance.
However, when the conventional technology is adopted to convert the container cluster into the control cluster, the original functions in the container cluster may not be completely compatible with the resource scheduling function, and thus adverse effects are generated, and the stability of scheduling the container resources in the multi-container cluster is low.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a method, an apparatus, a system, a computer device, a computer readable storage medium, and a computer program product for scheduling container resources in a multi-container cluster, which can achieve scheduling stability of the container resources in the multi-container cluster.
In a first aspect, the present application provides a method for scheduling container resources in a multi-container cluster. The method is applied to a container management platform and comprises the following steps:
responding to a resource scheduling request, and determining a resource scheduling policy, wherein the resource scheduling policy comprises a first identifier of a resource sending container cluster, a second identifier of a resource receiving container cluster and a third identifier of a container resource to be scheduled;
generating a resource scheduling instruction according to the resource scheduling strategy;
and sending the resource scheduling instruction to a resource sending container cluster corresponding to the first identifier so as to instruct the resource sending container cluster to read the to-be-scheduled container resource corresponding to the third identifier, and sending the to-be-scheduled container resource to a resource receiving container cluster corresponding to the second identifier.
In one embodiment, the generating a resource scheduling instruction according to the resource scheduling policy includes:
acquiring a template YAML configuration file, wherein the template YAML configuration file comprises standard resource scheduling strategy data;
comparing the resource scheduling strategy with standard resource scheduling strategy data in the template YAML configuration file to determine strategy differentiation data;
according to the strategy differentiation data, standard resource scheduling strategy data in the template YAML configuration file are adjusted to obtain a cluster YAML configuration file;
and generating a resource scheduling instruction carrying the cluster YAML configuration file.
In one embodiment, the determining a resource scheduling policy in response to the resource scheduling request includes:
responding to the resource scheduling request, and acquiring resource demand information and container resource use information of the container cluster;
and determining a resource scheduling strategy according to the resource demand information and the container resource use information of the container cluster.
In one embodiment, the method further comprises:
and controlling the container cluster managed by the container management platform through an API Server component in the container cluster.
In one embodiment, the controlling, by an API Server component in a container cluster, the container cluster hosted by the container management platform includes:
sending a state acquisition request to a container cluster managed by the container management platform through an API Server component in the container cluster;
receiving state data returned by the managed container cluster in response to the state acquisition request;
through API Server subassembly in the container cluster, to the container cluster that the container management platform was managed controls, still includes:
distributing an authentication token to a container cluster managed by the container management platform through an API Server component in the container cluster, wherein the authentication token is used for indicating the container cluster and the permission of container resources;
through API Server subassembly in the container cluster, to the container cluster that the container management platform was managed controls, still includes:
and sending a container debugging command to the container cluster managed by the container management platform through an API Server component in the container cluster, wherein the container debugging command is used for debugging the container in the container cluster managed by the container management platform.
In one embodiment, the container cluster managed by the container management platform adopts a Mac VLAN mode for networking;
the method further comprises the following steps:
and responding to the container IP processing instruction, and processing the container IP to be processed through the IPAM Server component.
In a second aspect, the present application further provides a scheduling apparatus for container resources in a multi-container cluster. The apparatus is used in a container management platform, the apparatus comprising:
the resource scheduling system comprises a strategy determining module, a resource scheduling module and a scheduling module, wherein the strategy determining module is used for responding to a resource scheduling request and determining a resource scheduling strategy, and the resource scheduling strategy comprises a first identifier of a resource sending container cluster, a second identifier of a resource receiving container cluster and a third identifier of a container resource to be scheduled;
the instruction generating module is used for generating a resource scheduling instruction according to the resource scheduling strategy;
and the instruction sending module is used for sending the resource scheduling instruction to the resource sending container cluster corresponding to the first identifier so as to instruct the resource sending container cluster to read the to-be-scheduled container resource corresponding to the third identifier and send the to-be-scheduled container resource to the resource receiving container cluster corresponding to the second identifier.
In a third aspect, the present application further provides a scheduling system for container resources in a multi-container cluster. The system comprises a container management platform, a resource sending container cluster and a resource receiving container cluster, wherein,
the container management platform is used for responding to a resource scheduling request and determining a resource scheduling policy, wherein the resource scheduling policy comprises a first identifier of a resource sending container cluster, a second identifier of a resource receiving container cluster and a third identifier of a container resource to be scheduled;
the container management platform is further configured to generate a resource scheduling instruction according to the resource scheduling policy, and send the resource scheduling instruction to the resource sending container cluster corresponding to the first identifier;
and the resource sending container cluster is used for reading the container resource to be scheduled corresponding to the third identifier according to the resource scheduling instruction and sending the container resource to be scheduled to the resource receiving container cluster corresponding to the second identifier.
In a fourth aspect, the present application further provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing the following steps when executing the computer program:
responding to a resource scheduling request, and determining a resource scheduling policy, wherein the resource scheduling policy comprises a first identifier of a resource sending container cluster, a second identifier of a resource receiving container cluster and a third identifier of a container resource to be scheduled;
generating a resource scheduling instruction according to the resource scheduling strategy;
and sending the resource scheduling instruction to a resource sending container cluster corresponding to the first identifier so as to instruct the resource sending container cluster to read the to-be-scheduled container resource corresponding to the third identifier, and sending the to-be-scheduled container resource to a resource receiving container cluster corresponding to the second identifier.
In a fifth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
responding to a resource scheduling request, and determining a resource scheduling policy, wherein the resource scheduling policy comprises a first identifier of a resource sending container cluster, a second identifier of a resource receiving container cluster and a third identifier of a container resource to be scheduled;
generating a resource scheduling instruction according to the resource scheduling strategy;
and sending the resource scheduling instruction to a resource sending container cluster corresponding to the first identifier so as to instruct the resource sending container cluster to read the to-be-scheduled container resource corresponding to the third identifier, and sending the to-be-scheduled container resource to a resource receiving container cluster corresponding to the second identifier.
In a sixth aspect, the present application further provides a computer program product. The computer program product comprising a computer program which when executed by a processor performs the steps of:
responding to a resource scheduling request, and determining a resource scheduling policy, wherein the resource scheduling policy comprises a first identifier of a resource sending container cluster, a second identifier of a resource receiving container cluster and a third identifier of a container resource to be scheduled;
generating a resource scheduling instruction according to the resource scheduling strategy;
and sending the resource scheduling instruction to a resource sending container cluster corresponding to the first identifier so as to instruct the resource sending container cluster to read the to-be-scheduled container resource corresponding to the third identifier, and sending the to-be-scheduled container resource to a resource receiving container cluster corresponding to the second identifier.
According to the scheduling method, device, system, computer equipment, storage medium and computer program product for the container resources in the multi-container cluster, the container management platform is adopted to process the resource scheduling request, determine the resource scheduling strategy, further generate the resource scheduling instruction and send the resource scheduling instruction to the resource sending container cluster so as to instruct the resource sending container cluster to send the container resources to be scheduled to the resource receiving container cluster. It can be understood that the scheduling of the container resources in the multi-container cluster is realized by adopting the container management platform, and the container cluster does not need to be converted into the control cluster, so that adverse effects caused by the fact that original functions and resource scheduling functions in the container cluster cannot be completely compatible do not occur in the container resource scheduling process, and the stability of the scheduling of the container resources in the multi-container cluster is improved.
Drawings
FIG. 1 is a diagram of an embodiment of a method for scheduling container resources in a multi-container cluster;
FIG. 2 is a flow diagram that illustrates a method for scheduling container resources in a multi-container cluster, according to an embodiment;
FIG. 3 is a block diagram of an apparatus for scheduling container resources in a multi-container cluster, according to an embodiment;
FIG. 4 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The scheduling method for container resources in a multi-container cluster provided by the embodiment of the present application can be applied to the application environment shown in fig. 1. The container management platform 102 determines a resource scheduling policy in response to the resource scheduling request, where the resource scheduling policy includes a first identifier of the resource sending container cluster 104, a second identifier of the resource receiving container cluster 106, and a third identifier of a container resource to be scheduled, generates a resource scheduling instruction according to the resource scheduling policy, sends the resource scheduling instruction to the resource sending container cluster 104 corresponding to the first identifier, so as to instruct the resource sending container cluster 104 to read the container resource to be scheduled corresponding to the third identifier, and sends the container resource to be scheduled to the resource receiving container cluster 106 corresponding to the second identifier. Wherein the container management platform 102 may be a cloud platform, a server, or a server cluster.
In one embodiment, as shown in fig. 2, a method for scheduling container resources in a multi-container cluster is provided, which is described by taking the application of the method to the container management platform 102 in fig. 1 as an example, and includes the following steps:
step S202, responding to the resource scheduling request, and determining a resource scheduling strategy.
The resource scheduling policy comprises a first identifier of the resource sending container cluster, a second identifier of the resource receiving container cluster and a third identifier of the container resource to be scheduled. A resource sending container cluster refers to a container cluster used to issue scheduled container resources. A resource receiving container cluster refers to a container cluster for receiving scheduled container resources. Typically, the container resources to be scheduled are deposited in a cluster of resource sending containers.
Specifically, the resource scheduling request may be a request sent by a terminal, or may be a resource scheduling request automatically generated by the container management platform when a preset condition is met. And the container management platform determines a resource scheduling strategy based on the resource scheduling request.
Step S204, according to the resource scheduling strategy, generating a resource scheduling instruction.
Specifically, the container management platform generates a resource scheduling instruction carrying a resource scheduling policy.
Step S206, sending the resource scheduling instruction to the resource sending container cluster corresponding to the first identifier, so as to instruct the resource sending container cluster to read the to-be-scheduled container resource corresponding to the third identifier, and sending the to-be-scheduled container resource to the resource receiving container cluster corresponding to the second identifier.
Specifically, the container management platform sends the resource scheduling instruction to the resource sending container cluster corresponding to the first identifier. And the resource sending container cluster analyzes the resource scheduling instruction to obtain a resource scheduling strategy, so that the container resources to be scheduled are sent to the resource receiving container cluster according to the resource scheduling strategy.
In the method for scheduling container resources in the multi-container cluster, the container management platform is adopted to process the resource scheduling request, determine the resource scheduling strategy, further generate the resource scheduling instruction and send the resource scheduling instruction to the resource sending container cluster so as to instruct the resource sending container cluster to send the container resources to be scheduled to the resource receiving container cluster. It can be understood that the method adopts the container management platform to realize the scheduling of the container resources in the multi-container cluster without converting the container cluster into the control cluster, so that the adverse effect caused by the incomplete compatibility between the original functions and the resource scheduling functions in the container cluster can not occur in the container resource scheduling process, and the stability of the scheduling of the container resources in the multi-container cluster can be improved.
Optionally, in one embodiment, the resource scheduling policy includes an identification of the container clusters deployed by the application and a number of copies of each container cluster.
In one embodiment, one possible implementation manner related to the step S202 "determining the resource scheduling policy in response to the resource scheduling request" is described above. On the basis of the above embodiment, step S202 may be specifically implemented by the following steps:
step S2022, responding to the resource scheduling request, acquiring resource demand information and container resource use information of the container cluster;
step S2024, determining a resource scheduling policy according to the resource requirement information and the container resource usage information of the container cluster.
The resource demand information is provided by a service party, and specifically may be specific high SSD demand information, CPU intensive computation demand information, specific GPU demand information, remote dual-active demand information, and the like. The container resource usage information may be resource usage over a period of time, such as a week average CPU memory usage, a week peak CPU memory usage, and so on.
Specifically, a multi-cluster container scheduling module in the container management platform responds to a resource scheduling request, acquires resource demand information and container resource use information of a container cluster, and then determines a resource scheduling policy according to the resource demand information and the container resource use information of the container cluster. Optionally, the multi-cluster container scheduling module determines the resource scheduling policy according to the resource demand information, the container resource usage information of the container cluster, and the application portrait.
In one embodiment, the application representation construction process is: for different types of service containers, the container management platform firstly acquires resource demand information submitted by a service party and container resource use information of a container cluster in a certain time period, and performs data analysis on the data through a modeling algorithm to obtain an application portrait. In a specific example, the container management platform collects the indexes of the CPU, the memory, and the like of the application program in each time period every day and every week, and the service party information (including system attributes, whether the system is a type system, service information, whether the system is a guest system, disaster recovery information, whether the system is a multi-active architecture in different places, and the like) provided by each system. Corresponding weights are distributed to different condition inputs, iterative calculation is carried out on the multi-dimensional data in a weighting calculation mode, and finally the whole process of obtaining the output layer can be regarded as a set of model. Finally, an application representation, namely transaction characteristics, business trends and the like of the application are obtained.
In one embodiment, a possible implementation manner related to the step S204 "generating the resource scheduling instruction according to the resource scheduling policy" is described. On the basis of the above embodiment, step S204 can be specifically implemented by the following steps:
step S2042, obtaining a template YAML configuration file;
step S2044, comparing the resource scheduling strategy with standard resource scheduling strategy data in a template YAML configuration file, and determining strategy differentiation data;
step S2046, according to the strategy differentiation data, adjusting the standard resource scheduling strategy data in the template YAML configuration file to obtain a cluster YAML configuration file;
step S2048, a resource scheduling instruction carrying the cluster YAML configuration file is generated.
Wherein, the template YAML configuration file comprises standard resource scheduling strategy data. The standard resource scheduling policy data is a data set configured with the same part in different deployment clusters
Specifically, a multi-cluster bisection and surplus scheduling strategy is adopted for the container of the default resource scheduling strategy, and the application is deployed in the multi-container cluster according to the average value of the number of copies, so that each container cluster can provide external services with the same capacity. And the container with the self-defined resource scheduling strategy can support the use of the scheduling strategy based on the cluster CPU and the memory utilization rate and the self-defined resource scheduling strategy based on the application portrait and the cluster portrait. After a user selects a custom resource scheduling strategy, an exclusterConfig file is generated and stored in a database, when actual application is deployed and scaled, strategy differentiation data is determined based on the exclusterConfig file and is covered by the strategy differentiation data (for example, strategy data which is not in the template YAML configuration file but is in the resource scheduling strategy is added, and strategy data which is in the template YAML configuration file but is not in the resource scheduling strategy is deleted) before the template YAML configuration file is converted into the cluster YAML configuration file, so that the custom resource scheduling strategy is enabled to take effect. In addition, the process performs correlation check, so as to ensure that fields which are not allowed to be issued are intercepted, a container mirror path is determined to be available, and the like.
In this embodiment, by performing scheduling development outside the multi-container cluster, the multi-container scheduling module of the container management platform can perform cross-cluster scheduling of container resources more flexibly and with more policies. When a container cluster in a certain area is down, cluster information can be synchronized to the container management platform through the application synchronization module, and the multi-cluster container scheduling module can schedule the down container resources to other normal container clusters, so that the container availability is improved.
In one embodiment, the method further comprises the steps of:
step S212 is executed to control the container cluster managed by the container management platform through an Application Programming Interface (API) Server component in the container cluster.
Specifically, the container management platform comprises a multi-cluster management module. The multi-cluster management module can manage the container clusters of the cloud-over-Overlay environment and the cloud-under-understandlay environment. The container management platform can control the container cluster managed by the container management platform through an API Server component in the container cluster.
In the embodiment, the container management platform uses the API Server component to perform control operation, so that related deployment and scheduling operations can be completed without deploying the corresponding component agent in an intrusive manner, and the complexity of container resource scheduling is reduced. Moreover, by being compatible with the whole API Server component, the container management platform can improve the aggregation and use capabilities of the container cluster interface.
In one embodiment, step S212 "control the container cluster managed by the container management platform through the API Server component in the container cluster" is involved in one possible implementation manner of this step. On the basis of the above embodiment, step S212 may be specifically implemented by the following steps:
step S2122, sending a state acquisition request to a container cluster managed by a container management platform through an API Server component in the container cluster;
step S2124, receiving the state data returned by the managed container cluster in response to the state acquisition request.
The API Server component is used for providing an interface for performing addition, deletion, and modification on various resource objects of the container cluster. I.e., the API Server component provides monitoring of the status of the respective resource object.
Specifically, the container management platform includes an application synchronization module and a database. The application synchronization module is implemented based on an Informer mechanism. The application synchronization module establishes a long TCP connection with the API Server component. The application synchronization module sends a state acquisition request to an API Server component in a container cluster managed by a container management platform. The API Server component in the hosted container cluster returns to the container management platform, in response to the status get request, status data (e.g., an Event that exposes what is happening within the container cluster), such as changing status information for each resource object in the container cluster. The container management platform processes the state data (including adding, updating or discarding Event data and updating or saving all or part of the data in the Event) and stores the processed state data into a database (such as an ETCD database) so as to provide real-time updated state data.
In the embodiment, the ETCD load pressure brought by directly calling the API Server component to inquire under the condition of large concurrency can be effectively reduced, and the usability of the API Server component is improved.
In another embodiment, the step S212 "control the container cluster managed by the container management platform through the API Server component in the container cluster" is involved in one possible implementation manner. On the basis of the above embodiment, step S212 may be specifically implemented by the following steps:
step S2126, distributing the authentication token to the container cluster managed by the container management platform through the API Server component in the container cluster.
Wherein the authentication Token (Token) is used to indicate the rights of the container cluster and the container resource. Optionally, the authentication token is generated by ServiceAccount.
Specifically, the multi-cluster management module in the container management platform generates authentication tokens with different permissions in the container cluster through the API Server component in the container cluster, so as to provide accurate permission control granularity for different container clusters, and achieve the purpose of performing differentiated permission control on different container clusters and different container resources.
In another embodiment, the step S212 "control the container cluster managed by the container management platform through the API Server component in the container cluster" is involved in one possible implementation manner of the present invention. On the basis of the above embodiment, step S212 may be specifically implemented by the following steps:
step S2128, sending a container debugging command to the container cluster managed by the container management platform through the API Server component in the container cluster.
Wherein the container debug command is used to debug a container in the managed container cluster.
In one embodiment, a container cluster managed by a container management platform adopts a Mac VLAN (Virtual Local Area Network) mode for networking. Optionally, the Underlay clusters hosted by the container management platform all adopt Mac VLAN mode networking. By adopting the networking mode, the network accessed by the container and the network accessed by the cluster host machine are in the same plane. Based on this, in one embodiment, the method further comprises the steps of:
step S222, responding to the container IP processing instruction, and processing the container IP to be processed through the IPAM Server component.
The IPAM (IP Address Management) Server component may be installed in the container Management platform, or may be used as a network plug-in for a container cluster, and is mainly used for implementing functions such as allocating and recovering IP of a macvaln mode container.
Specifically, the container management platform includes an IP management module. The container management platform supports the interface operation and can provide functions of adding and deleting available IP addresses in the container cluster address pool, binding the depolyment with the IP address pool and the like. The user operates (for example, clicks) interface elements (for example, a container IP adding control, a container IP deleting button and the like) displayed in the container management platform, the IP management module generates a corresponding container IP processing instruction, and processes the container IP to be processed through the IPAM Server component according to the container IP processing instruction. And a high-availability IPAM Server component is adopted, so that the container management platform has a stable container IP management function. In addition, the IP management module is also provided with a plurality of IP affinity strategies.
An embodiment of the present application is described below with reference to a specific kubernets cluster scene, and specifically, the multi-kubernets cluster container resource scheduling apparatus is centered on a container cloud management platform, where the container cloud management platform includes a multi-cluster management module, a multi-cluster container scheduling module, an application deployment module, an application synchronization module, and an IP management module. Meanwhile, for the convenience of user use and external system integration, a front-end UI portal and an API gateway are provided for external users to use. Wherein:
the multi-cluster management module is a core operation component of the container cloud management platform and is used for realizing abstract management of multi-cluster container resources.
Specifically, the multi-cluster management module may perform a nanotube operation on a kubernets cluster in an Overlay environment on the cloud and an underutilized environment under the cloud. The multi-cluster management module can provide accurate authority control granularity for different clusters by generating the Token with different authorities in the clusters. And because the container cloud management platform completely uses the Kubernets ApiServer component to perform control operation, related deployment and scheduling operation can be completed without invasive deployment and corresponding component agent.
The multi-cluster container scheduling module provides a scheduling mode that containers are scheduled to multiple clusters according to multiple strategies and supports user-defined strategy definition.
Specifically, the multi-cluster container scheduling module is implemented by an external Java program without using a Scheduler of kuubernets from the viewpoint of expansibility and a custom policy, so that more functions are realized. For different types of service containers, data analysis is carried out through a modeling algorithm according to information (such as specific high SSD (solid State disk) requirements, CPU (Central processing Unit) intensive computing requirements, specific GPU (graphics processing Unit) requirements, remote dual-activity requirements and the like) submitted by a service party and resource usage (average CPU memory usage in one week, peak CPU memory usage in one week and the like) in a certain period actually acquired from a cluster, so that an application image is acquired. On the basis, a multi-cluster bisection and surplus scheduling strategy is adopted for a container of a default strategy, and the isomorphic external service of multiple Kubernets is guaranteed to be provided; and the container with the self-defined scheduling policy can support the use of the scheduling policy based on the cluster CPU and the memory utilization rate and the self-defined scheduling policy based on the application portrait and the cluster portrait. And after the user selects the custom strategy, generating an exclusterConfig file and storing the file into a database, and when the actual application is deployed and scaled, covering the custom strategy based on the exclusterConfig file before the template Yaml is converted into the cluster Yaml, so that the custom strategy takes effect. And the process will perform correlation check to ensure that fields which are not allowed to be issued are intercepted, and to determine that a container mirror path is certainly available, etc.
The application deployment module processes the input submitted by the user, processes the request of the user and issues the request to the corresponding Kubernets cluster.
Specifically, the application deployment module is directly provided for users to use, and is butted with each DevOps production line to perform full-life-cycle management on deployment, issue, start-stop and deletion of containers, the users perform resource deployment by uploading YAML files of standardized resource objects, and the platform provides YAML standardized inspection, YAML historical version archiving, YAML configuration transcription templates and the like. After the YAML file is submitted by the application, the container is dispatched to different clusters through the multi-cluster dispatching module to be started. And the platform provides detailed functions of elastic expansion, mirror image updating, application operation calling and the like for application resources.
More specifically, the flexible scaling capability, that is, the container instance is flexibly extended based on some rules, such as CPU, memory, TPS, API interface call, etc., may automatically increase the number of copies of the backend container when the traffic increases. Kubernetes's own elastic expansion capability can only stretch based on CPU, memory. The cloud management platform for the container expands the native capability of Kubenretes, can call an external rule module to transfer related parameters, can use the elastic expansion and contraction capability based on indexes such as TPS (transparent sheet), API (application program interface), JVM (Java virtual machine) parameters and fixed time frequency after improvement, and can support more scenes.
Application jobs are invoked, and debugging of containers has been inconvenient because the containers themselves do not necessarily provide capabilities such as ssh telnet. The container cloud management platform encapsulates commonly used debugging commands externally and allows user-defined commands to be executed in the container. After the user creates the application operation, the platform provides the container operation by calling the corresponding interface of the APIServer component, and the container cloud management platform returns the corresponding execution result to the user.
The application synchronization module synchronizes all the data of the nanotube clusters to the platform database, and provides real-time data information storage and query functions.
Specifically, the application synchronization module is realized based on an Informer mechanism of a Kubernetes bottom layer, and the change state of each resource object in the cluster is acquired by establishing a long chain with an ApiServer. And the Event is sent to the platform side by the cluster party, processed by the platform data and stored in the database so as to provide real-time update state data. The problem of ETCD pressure brought by directly calling the ApiServer to inquire under the condition of large concurrency is effectively solved, and the usability of the ApiServer is improved.
The IP management module provides functions of IP reservation, IP binding and the like for the multi-cluster container, and is convenient for traditional application to carry out containerization migration work.
Specifically, an Underlay cluster hosted by a container cloud management platform adopts a Mac VLAN mode for networking, and the mode enables a network accessed by a container and a network accessed by a cluster host to be in the same plane. The platform IP management platform supports the interface operation and provides functions of adding and deleting available IP addresses in the cluster address pool; and the Delployment binds the IP address pool and other functions. And supports multiple IP affinity strategies. The highly available IPAM Server end enables the platform to have a stable Kubernets IP management function.
In the embodiment of the application, multi-Kubernettes cluster management is taken as a starting point, a multi-Kubernettes cluster container scheduling device (an enterprise-level container cloud management platform) is built by adopting a management plane high-availability scheme and a Kubernettes cluster non-invasive mode, and the platform is designed by adopting a new function distribution design. A multi-Kubernetes cluster container scheduling device (an enterprise-level container cloud management platform) provides a container multi-cluster resource scheduling scheme, and containers can be scheduled to the most idle cluster according to the utilization rates of a cluster CPU and a memory, and a custom container scheduling strategy for supporting special situations is provided. A multi-Kubernetes cluster container scheduling device (an enterprise-level container cloud management platform) provides elastic expansion and contraction capacity of containers, can elastically stretch out and draw back as required, and provides custom indexes based on SQL, MQ, TPS, Metrics and the like on the basis of only supporting container CPU and memory indexes by default. The container scheduling management function of the multi-Kubernetes cluster container scheduling device (enterprise-level container cloud management platform) does not insert the Kubernetes cluster, and does not need to install a separate agent. A multi-Kubernets cluster container scheduling device (an enterprise-level container cloud management platform) adopts a real-time dynamic updating mechanism, and synchronizes data to a management plane in real time based on the Kubernets Informmer mechanism, so that the API of each Kubernets cluster is not abnormally called, and the independent operation of the Kubernets cluster is ensured.
The multi-Kubernetes cluster container scheduling device (enterprise-level container cloud management platform) adopts a high-availability and non-invasive multi-Kubenretes cluster management mode, the availability is more stable than that of a single cluster of a control plane of open source schemes Kubefed and Karmada, and the non-invasive control is adopted, so that component call chains are reduced, and the performance is improved. The platform provides container resource scheduling capability and self-defined elastic expansion capability, and can improve the utilization rate of container resources. Meanwhile, the platform provides a unified container monitoring, alarming, logging and gateway system, can uniformly manage the life cycle of the container on the platform, is convenient to be connected with other associated systems, and has the characteristic of high cohesive loose coupling. And standing at the angle of a user, the multi-Kubernet cluster container scheduling device (enterprise-level container cloud management platform) provides a set of front-end portals which are user-friendly, simple in function and easy to use.
The container cloud management platform abandons the mainstream Kube On Kube mode, adopts a mode of externally arranging a management plane, and retains the traditional different-place multi-activity database, thereby ensuring the availability of the management plane, and any Kubernets cluster downtime can not influence other Kubenretes clusters in different-place multi-activity scenes. The control plane exception of the single place can also ensure that the service is not interrupted by the control plane of the different place. At present, a container cloud management platform provides 7x24 hours of uninterrupted service, and the time availability is 99.95%. The RPO of the platform was 2 hours and the RTO was 2 hours.
It should be understood that, although the steps in the flowcharts related to the embodiments as described above are sequentially displayed as indicated by arrows, the steps are not necessarily performed sequentially as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the embodiments described above may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the execution order of the steps or stages is not necessarily sequential, but may be rotated or alternated with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the present application further provides a scheduling apparatus for container resources in a multi-container cluster, which is used for implementing the above-mentioned scheduling method for container resources in a multi-container cluster. The implementation scheme for solving the problem provided by the apparatus is similar to the implementation scheme described in the above method, so specific limitations in the following embodiments of the scheduling apparatus for container resources in one or more multi-container clusters may refer to the above limitations for the scheduling method for container resources in a multi-container cluster, and are not described herein again.
In one embodiment, as shown in fig. 3, there is provided an apparatus for scheduling container resources in a multi-container cluster, where the apparatus is used in a container management platform, and the apparatus includes: a policy determination module 302, an instruction generation module 304, and an instruction sending module 306, wherein:
a policy determining module 302, configured to determine a resource scheduling policy in response to a resource scheduling request, where the resource scheduling policy includes a first identifier of a resource sending container cluster, a second identifier of a resource receiving container cluster, and a third identifier of a container resource to be scheduled;
an instruction generating module 304, configured to generate a resource scheduling instruction according to the resource scheduling policy;
the instruction sending module 306 is configured to send the resource scheduling instruction to the resource sending container cluster corresponding to the first identifier, so as to instruct the resource sending container cluster to read the to-be-scheduled container resource corresponding to the third identifier, and send the to-be-scheduled container resource to the resource receiving container cluster corresponding to the second identifier.
In the scheduling device for the container resources in the multi-container cluster, the container management platform is adopted to process the resource scheduling request, determine the resource scheduling policy, further generate the resource scheduling instruction and send the resource scheduling instruction to the resource sending container cluster so as to instruct the resource sending container cluster to send the container resources to be scheduled to the resource receiving container cluster. It can be understood that the device adopts the container management platform to realize the scheduling of the container resources in the multi-container cluster, and the container cluster does not need to be converted into a control cluster, so that the adverse effect caused by the fact that the original functions and the resource scheduling functions in the container cluster cannot be completely compatible does not occur in the container resource scheduling process, and the stability of the scheduling of the container resources in the multi-container cluster is favorably improved.
In an embodiment, the instruction generating module 304 is specifically configured to obtain a template YAML configuration file, where the template YAML configuration file includes standard resource scheduling policy data; comparing the resource scheduling strategy with standard resource scheduling strategy data in a template YAML configuration file to determine strategy differentiation data; according to the strategy differentiation data, adjusting standard resource scheduling strategy data in the template YAML configuration file to obtain a cluster YAML configuration file; and generating a resource scheduling instruction carrying the cluster YAML configuration file.
In an embodiment, the policy determining module 302 is specifically configured to, in response to a resource scheduling request, obtain resource requirement information and container resource usage information of a container cluster; and determining a resource scheduling strategy according to the resource demand information and the container resource use information of the container cluster.
In one embodiment, the apparatus further comprises: the cluster control module is used for sending a state acquisition request to a container cluster managed by the container management platform through an API Server component in the container cluster; receiving state data returned by the managed container cluster in response to the state acquisition request; distributing an authentication token to a container cluster managed by a container management platform through an API Server component in the container cluster, wherein the authentication token is used for indicating the container cluster and the authority of container resources; and sending a container debugging command to the container cluster managed by the container management platform through an API Server component in the container cluster, wherein the container debugging command is used for debugging the container in the managed container cluster.
The modules in the scheduling apparatus for container resources in the multi-container cluster may be implemented in whole or in part by software, hardware, or a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 4. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of scheduling container resources in a multi-container cluster.
Those skilled in the art will appreciate that the architecture shown in fig. 4 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
responding to the resource scheduling request, and determining a resource scheduling strategy, wherein the resource scheduling strategy comprises a first identifier of a resource sending container cluster, a second identifier of a resource receiving container cluster and a third identifier of a container resource to be scheduled;
generating a resource scheduling instruction according to the resource scheduling strategy;
and sending the resource scheduling instruction to the resource sending container cluster corresponding to the first identifier to instruct the resource sending container cluster to read the container resource to be scheduled corresponding to the third identifier, and sending the container resource to be scheduled to the resource receiving container cluster corresponding to the second identifier.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring a template YAML configuration file, wherein the template YAML configuration file comprises standard resource scheduling strategy data; comparing the resource scheduling strategy with standard resource scheduling strategy data in a template YAML configuration file to determine strategy differentiation data; according to the strategy differentiation data, adjusting standard resource scheduling strategy data in the template YAML configuration file to obtain a cluster YAML configuration file; and generating a resource scheduling instruction carrying the cluster YAML configuration file.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
responding to the resource scheduling request, and acquiring resource demand information and container resource use information of the container cluster; and determining a resource scheduling strategy according to the resource demand information and the container resource use information of the container cluster.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and controlling the container cluster managed by the container management platform through an API Server component in the container cluster.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and responding to the container IP processing instruction, and processing the container IP to be processed through the IPAM Server component.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
In an embodiment, a computer program product is provided, comprising a computer program which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
It should be noted that, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high-density embedded nonvolatile Memory, resistive Random Access Memory (ReRAM), Magnetic Random Access Memory (MRAM), Ferroelectric Random Access Memory (FRAM), Phase Change Memory (PCM), graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others. The databases referred to in various embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing based data processing logic devices, etc., without limitation.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (11)

1. A scheduling method for container resources in a multi-container cluster is applied to a container management platform, and the method comprises the following steps:
responding to a resource scheduling request, and determining a resource scheduling policy, wherein the resource scheduling policy comprises a first identifier of a resource sending container cluster, a second identifier of a resource receiving container cluster and a third identifier of a container resource to be scheduled;
generating a resource scheduling instruction according to the resource scheduling strategy;
and sending the resource scheduling instruction to a resource sending container cluster corresponding to the first identifier so as to instruct the resource sending container cluster to read the to-be-scheduled container resource corresponding to the third identifier, and sending the to-be-scheduled container resource to a resource receiving container cluster corresponding to the second identifier.
2. The method of claim 1, wherein the generating resource scheduling instructions according to the resource scheduling policy comprises:
acquiring a template YAML configuration file, wherein the template YAML configuration file comprises standard resource scheduling strategy data;
comparing the resource scheduling strategy with standard resource scheduling strategy data in the template YAML configuration file to determine strategy differentiation data;
according to the strategy differentiation data, standard resource scheduling strategy data in the template YAML configuration file are adjusted to obtain a cluster YAML configuration file;
and generating a resource scheduling instruction carrying the cluster YAML configuration file.
3. The method of claim 1, wherein determining a resource scheduling policy in response to the resource scheduling request comprises:
responding to the resource scheduling request, and acquiring resource demand information and container resource use information of the container cluster;
and determining a resource scheduling strategy according to the resource demand information and the container resource use information of the container cluster.
4. The method of claim 1, further comprising:
and controlling the container cluster managed by the container management platform through an API Server component in the container cluster.
5. The method of claim 4, wherein the controlling the container cluster hosted by the container management platform through an API Server component in the container cluster comprises:
sending a state acquisition request to a container cluster managed by the container management platform through an API Server component in the container cluster; receiving state data returned by the managed container cluster in response to the state acquisition request;
or,
distributing an authentication token to a container cluster managed by the container management platform through an API Server component in the container cluster, wherein the authentication token is used for indicating the container cluster and the permission of container resources;
or,
and sending a container debugging command to the container cluster managed by the container management platform through an API Server component in the container cluster, wherein the container debugging command is used for debugging the container in the container cluster managed by the container management platform.
6. The method of claim 1, wherein the container cluster hosted by the container management platform employs Mac VLAN mode networking;
the method further comprises the following steps:
and responding to the container IP processing instruction, and processing the container IP to be processed through the IPAM Server component.
7. An apparatus for scheduling container resources in a multi-container cluster, the apparatus being used in a container management platform, the apparatus comprising:
the resource scheduling system comprises a strategy determining module, a resource scheduling module and a scheduling module, wherein the strategy determining module is used for responding to a resource scheduling request and determining a resource scheduling strategy, and the resource scheduling strategy comprises a first identifier of a resource sending container cluster, a second identifier of a resource receiving container cluster and a third identifier of a container resource to be scheduled;
the instruction generating module is used for generating a resource scheduling instruction according to the resource scheduling strategy;
and the instruction sending module is used for sending the resource scheduling instruction to the resource sending container cluster corresponding to the first identifier so as to instruct the resource sending container cluster to read the to-be-scheduled container resource corresponding to the third identifier and send the to-be-scheduled container resource to the resource receiving container cluster corresponding to the second identifier.
8. A scheduling system of container resources in a multi-container cluster, the system comprising a container management platform, a resource sending container cluster and a resource receiving container cluster, wherein,
the container management platform is used for responding to a resource scheduling request and determining a resource scheduling policy, wherein the resource scheduling policy comprises a first identifier of a resource sending container cluster, a second identifier of a resource receiving container cluster and a third identifier of a container resource to be scheduled;
the container management platform is further configured to generate a resource scheduling instruction according to the resource scheduling policy, and send the resource scheduling instruction to the resource sending container cluster corresponding to the first identifier;
and the resource sending container cluster is used for reading the container resource to be scheduled corresponding to the third identifier according to the resource scheduling instruction and sending the container resource to be scheduled to the resource receiving container cluster corresponding to the second identifier.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 6.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
11. A computer program product comprising a computer program, characterized in that the computer program realizes the steps of the method of any one of claims 1 to 6 when executed by a processor.
CN202111491105.8A 2021-12-08 2021-12-08 Method, device and system for scheduling container resources in multi-container cluster Pending CN114356549A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111491105.8A CN114356549A (en) 2021-12-08 2021-12-08 Method, device and system for scheduling container resources in multi-container cluster

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111491105.8A CN114356549A (en) 2021-12-08 2021-12-08 Method, device and system for scheduling container resources in multi-container cluster

Publications (1)

Publication Number Publication Date
CN114356549A true CN114356549A (en) 2022-04-15

Family

ID=81097535

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111491105.8A Pending CN114356549A (en) 2021-12-08 2021-12-08 Method, device and system for scheduling container resources in multi-container cluster

Country Status (1)

Country Link
CN (1) CN114356549A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115242786A (en) * 2022-05-07 2022-10-25 东云睿连(武汉)计算技术有限公司 Multi-mode big data job scheduling system and method based on container cluster
WO2024169786A1 (en) * 2023-02-14 2024-08-22 华为云计算技术有限公司 Multi-cluster system and elastic scaling method therefor, computing device cluster, and medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115242786A (en) * 2022-05-07 2022-10-25 东云睿连(武汉)计算技术有限公司 Multi-mode big data job scheduling system and method based on container cluster
CN115242786B (en) * 2022-05-07 2024-01-12 东云睿连(武汉)计算技术有限公司 Multi-mode big data job scheduling system and method based on container cluster
WO2024169786A1 (en) * 2023-02-14 2024-08-22 华为云计算技术有限公司 Multi-cluster system and elastic scaling method therefor, computing device cluster, and medium

Similar Documents

Publication Publication Date Title
US11226847B2 (en) Implementing an application manifest in a node-specific manner using an intent-based orchestrator
US10896102B2 (en) Implementing secure communication in a distributed computing system
CN109194506B (en) Block chain network deployment method, platform and computer storage medium
US9971823B2 (en) Dynamic replica failure detection and healing
CN109344000B (en) Block chain network service platform, recovery tool, fault processing method thereof and storage medium
US10608949B2 (en) Simple integration of an on-demand compute environment
CN109189334B (en) Block chain network service platform, capacity expansion method thereof and storage medium
US9703598B2 (en) Managing virtual machine migration
CN108667867B (en) Data storage method and device
US11188561B2 (en) Prioritizing microservices on a container platform for a restore operation
US20190220361A1 (en) Monitoring Containers In A Distributed Computing System
US11119829B2 (en) On-demand provisioning of customized developer environments
US9983945B2 (en) Methods and systems for managing the replication of snapshots on a storage array
US10747620B2 (en) Network storage management at scale using service level objectives
CN114356549A (en) Method, device and system for scheduling container resources in multi-container cluster
CN109992354A (en) Container-treatment, device, principal server, system and storage medium
WO2021143590A1 (en) Distributed container image construction scheduling system and method
CN109739640A (en) A kind of container resource management system based on Shen prestige framework
CN113382077B (en) Micro-service scheduling method, micro-service scheduling device, computer equipment and storage medium
CN113485830A (en) Micro-service automatic capacity expansion method for power grid monitoring system
US11533391B2 (en) State replication, allocation and failover in stream processing
CN117009080A (en) Resource adjustment method, apparatus, device, medium and computer program product
CN115113800A (en) Multi-cluster management method and device, computing equipment and storage medium
CN116032928B (en) Data collaborative computing method, device, system, electronic device and storage medium
CN116661979B (en) Heterogeneous job scheduling system and method

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