CN116954878A - Method, apparatus, device, storage medium and program product for managing container clusters - Google Patents

Method, apparatus, device, storage medium and program product for managing container clusters Download PDF

Info

Publication number
CN116954878A
CN116954878A CN202210399829.8A CN202210399829A CN116954878A CN 116954878 A CN116954878 A CN 116954878A CN 202210399829 A CN202210399829 A CN 202210399829A CN 116954878 A CN116954878 A CN 116954878A
Authority
CN
China
Prior art keywords
virtual
node
container
workload
related information
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
CN202210399829.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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202210399829.8A priority Critical patent/CN116954878A/en
Publication of CN116954878A publication Critical patent/CN116954878A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

The embodiment of the application provides a method, a device, equipment, a storage medium and a program product for managing a container cluster, which relate to the fields of artificial intelligence, cloud technology, map and the like, and application scenes comprise but are not limited to scenes such as container cluster expansion and the like. The method comprises the following steps: acquiring relevant information of at least one virtual workload, relevant information of each node of a container cluster to be tested and relevant information of a container group included by each node; constructing at least one virtual container group included in each virtual workload in the at least one virtual workload based on the related information of the at least one virtual workload; determining first cache data based on the related information of each node and the related information of the container group included by each node; if any one of the at least one virtual container group cannot be scheduled to each node based on the first cache data, adjusting the node number of the container cluster to be measured; the accuracy of determining whether the container cluster to be tested can deploy the newly added service is improved.

Description

Method, apparatus, device, storage medium and program product for managing container clusters
Technical Field
The present application relates to the field of computer technology, and in particular, to a method, apparatus, device, storage medium, and program product for managing a container cluster.
Background
A Kubernetes cluster in the prior art is a container cluster, and the Kubernetes cluster may include a plurality of nodes (nodes), each Node may include a plurality of Pod (container group), and each Pod may include a plurality of containers. Because before the new service is deployed in the Kubernetes cluster, the prior art cannot accurately estimate whether the remaining available resources of each Node in the Kubernetes cluster can meet the requirement of the new service, and cannot accurately determine whether the Kubernetes cluster needs to be expanded, that is, the number of nodes of the Kubernetes cluster is increased, so that the operation of the new service after deployment cannot be performed and the operation of the new service fails.
Disclosure of Invention
The application aims at the defects of the existing mode, and provides a container cluster management method, device, equipment, a computer readable storage medium and a computer program product, which are used for solving the problem of improving the accuracy of determining whether a Kubernetes cluster can deploy a newly added service.
In a first aspect, the present application provides a method for managing a container cluster, including:
Acquiring relevant information of at least one virtual workload, relevant information of each node of a container cluster to be tested and relevant information of a container group included by each node;
constructing at least one virtual container group included in each virtual workload in the at least one virtual workload based on the related information of the at least one virtual workload;
determining first cache data based on the related information of each node and the related information of the container group included by each node;
and if any one of the at least one virtual container group is determined to be unable to be dispatched to each node based on the first cache data, adjusting the node number of the container cluster to be tested.
In one embodiment, obtaining information about at least one virtual node, the information about the at least one virtual node including a number of the at least one virtual node;
constructing each virtual node corresponding to at least one virtual node based on the related information of the at least one virtual node;
determining second cache data based on the number of at least one virtual node, the related information of each node, and the related information of the container group included by each node;
if any one of the at least one virtual container group cannot be scheduled to each node and each virtual node based on the second cache data, accumulating the number of the at least one virtual node, and updating the number of the at least one virtual node;
And repeatedly executing the second cache data based on the number of the at least one virtual node, the related information of each node and the related information of the container group included by each node, if any one of the at least one virtual container group is determined to be incapable of being scheduled to each node and each virtual node based on the second cache data, accumulating the number of the at least one virtual node, updating the number of the at least one virtual node until the updated number of the at least one virtual node and the newly increased virtual node corresponding to the at least one virtual node are obtained, and if any one of the virtual container group is capable of being scheduled to the newly increased virtual node, determining the updated number of the at least one virtual node as the newly increased node number of the container cluster to be tested.
In one embodiment, obtaining information about at least one virtual node;
constructing each virtual node corresponding to at least one virtual node based on the related information of the at least one virtual node, and determining third cache data;
if any one of the at least one virtual container group can be scheduled to each virtual node based on the third cache data, a new container cluster is constructed based on the related information of the at least one virtual node and the related information of the at least one virtual workload.
In one embodiment, the information about the at least one virtual workload includes a name of each virtual workload in the at least one virtual workload, a number of virtual container groups in each virtual workload, information about virtual container groups in each virtual workload; constructing at least one virtual container group included in each virtual workload in the at least one virtual workload based on the related information of the at least one virtual workload, including:
and constructing at least one virtual container group in each virtual workload based on the name of each virtual workload, the number of virtual container groups in each virtual workload and related information of the virtual container groups in each virtual workload, wherein the related information of the virtual container groups in each virtual workload comprises at least one of required resource amount and scheduling constraint.
In one embodiment, the relevant information of each node includes a label of each node and a resource amount of each node, and the relevant information of the container group included in each node includes a label of the container group in each node and a resource amount of the container group in each node; determining first cache data based on the related information of each node and the related information of the container group included in each node, including:
The first cache data is determined based on the labels of the nodes, the resource amounts of the nodes, the labels of the container groups in the nodes, and the resource amounts of the container groups in the nodes.
In one embodiment, if it is determined, based on the first cache data, that any one of the at least one virtual container group cannot be dispatched to the nodes, adjusting the number of nodes of the container cluster to be tested includes:
through a preset scheduling algorithm, if the required resource amount of any one of the at least one virtual container group is determined to be larger than the resource amount of each node based on the first cache data, the label of each node does not meet any one of the scheduling constraint of any one of the virtual container groups, and the label of the container group in each node does not meet any one of the scheduling constraint of any one of the virtual container groups, determining that any one of the at least one virtual container group cannot be scheduled to each node, and increasing the node number of the container cluster to be tested.
In one embodiment, the container cluster to be tested is a Kubernetes cluster, and the first cache data is scheduler cache data.
In a second aspect, the present application provides a device for managing a container cluster, including:
the first processing module is used for acquiring the related information of at least one virtual workload, the related information of each node of the container cluster to be tested and the related information of the container group included by each node;
A second processing module, configured to construct at least one virtual container group included in each virtual workload in the at least one virtual workload based on information related to the at least one virtual workload;
the third processing module is used for determining first cache data based on the related information of each node and the related information of the container group included by each node;
and the fourth processing module is used for adjusting the node number of the container cluster to be tested if any one of the at least one virtual container group is determined to be unable to be dispatched to each node based on the first cache data.
In a third aspect, the present application provides an electronic device, comprising: a processor, a memory, and a bus;
a bus for connecting the processor and the memory;
a memory for storing operation instructions;
and the processor is used for executing the container cluster management method according to the first aspect of the application by calling the operation instruction.
In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program for executing the method of managing container clusters according to the first aspect of the present application.
In a fifth aspect, the present application provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the method for managing clusters of containers in the first aspect of the application.
The technical scheme provided by the embodiment of the application has at least the following beneficial effects:
acquiring relevant information of at least one virtual workload, relevant information of each node of a container cluster to be tested and relevant information of a container group included by each node; constructing at least one virtual container group included in each virtual workload in the at least one virtual workload based on the related information of the at least one virtual workload; determining first cache data based on the related information of each node and the related information of the container group included by each node; if any one of the at least one virtual container group cannot be scheduled to each node based on the first cache data, adjusting the node number of the container cluster to be measured; therefore, the container cluster to be tested (such as a Kubernetes cluster) can be accurately determined to be incapable of accommodating the virtual workload, if any one of the at least one virtual container group is determined to be incapable of being scheduled to each node based on the first cache data, the remaining available resources of each node in the container cluster to be tested are accurately determined to be incapable of meeting the virtual workload (newly added service) requirement, and accordingly the container cluster to be tested is accurately determined to be expanded, and the accuracy of determining whether the container cluster to be tested can deploy the newly added service is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings that are required to be used in the description of the embodiments of the present application will be briefly described below.
FIG. 1 is a schematic diagram of a management system architecture of a container cluster according to an embodiment of the present application;
fig. 2 is a flow chart of a method for managing a container cluster according to an embodiment of the present application;
FIG. 3 is a schematic diagram illustrating management of a container cluster according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating another method for managing a container cluster according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a management device for container clusters according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described below with reference to the drawings in the present application. It should be understood that the embodiments described below with reference to the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application, and the technical solutions of the embodiments of the present application are not limited.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless expressly stated otherwise, as understood by those skilled in the art. It will be further understood that the terms "comprises" and "comprising," when used in this specification, specify the presence of stated features, information, data, steps, operations, elements, and/or components, but do not preclude the presence or addition of other features, information, data, steps, operations, elements, components, and/or groups thereof, all of which may be included in the present specification. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. The term "and/or" as used herein indicates at least one of the items defined by the term, e.g. "a and/or B" indicates implementation as "a", or as "B", or as "a and B".
It will be appreciated that in particular embodiments of the present application, where management data relating to a cluster of containers is used in particular products or technologies, user approval or consent is required and the collection, use and processing of relevant data is required to comply with relevant laws and regulations and standards in the relevant countries and regions.
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings.
The embodiment of the application provides a management method of a container cluster, which relates to the fields of artificial intelligence, cloud technology, map field and the like. Illustratively, the Kubernetes cluster referred to in the embodiments of the present application is a cloud computing technology in the cloud technology. The management application scene of the container cluster comprises but is not limited to a scene such as container cluster capacity expansion, and a container cluster capacity expansion scene such as a Kubernetes cluster capacity expansion scene.
Artificial intelligence (Artificial Intelligence, AI) is the theory, method, technique and application system that uses a digital computer or a machine controlled by a digital computer to simulate, extend and extend human intelligence, sense the environment, acquire knowledge and use the knowledge to obtain optimal results. In other words, artificial intelligence is an integrated technology of computer science that attempts to understand the essence of intelligence and to produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence, i.e. research on design principles and implementation methods of various intelligent machines, enables the machines to have functions of sensing, reasoning and decision.
The artificial intelligence technology is a comprehensive subject, and relates to the technology with wide fields, namely the technology with a hardware level and the technology with a software level. Artificial intelligence infrastructure technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning/deep learning, automatic driving, intelligent traffic and other directions.
The intelligent transportation system (Intelligent Traffic System, ITS), also called intelligent transportation system (Intelligent Transportation System), is a comprehensive transportation system which uses advanced scientific technology (information technology, computer technology, data communication technology, sensor technology, electronic control technology, automatic control theory, operation study, artificial intelligence, etc.) effectively and comprehensively for transportation, service control and vehicle manufacturing, and enhances the connection among vehicles, roads and users, thereby forming a comprehensive transportation system for guaranteeing safety, improving efficiency, improving environment and saving energy.
In order to better understand and describe the schemes of the embodiments of the present application, some technical terms related to the embodiments of the present application are briefly described below.
Kubernetes cluster: the Kubernetes cluster is a container scheduling management system designed for a production environment, and has primary support for the functional requirements of a container cloud platform such as load balancing, service discovery, high availability, rolling upgrading, automatic telescoping and the like; a Kubernetes cluster is composed of distributed storage (etcd), service nodes (nodes) and control nodes (Master), all cluster states are stored in etcd, the Master runs a cluster management control module, and the Node is a host Node truly running an application container.
Workload: a container cluster, such as a Kubernetes cluster, in which the workload is commonly referred to as Deployment, statefulset, etc., is a collection of a set of Pod, and in the workload description, the number of copies specifies how many identically described pods need to be created. The workload may be a workload resource.
A scheduler: the native scheduler in the Kubernetes cluster is called kube-scheduler.
And (3) simulation scheduling: the behavior of kube-scheduler is simulated, but real workload and Pod are not created in the container cluster to schedule operation, and the scheduling algorithm of virtual Pod is executed on the input workload according to the current state of the container cluster.
Pod: pod (container group) is a scheduling unit of a container cluster, for example, a scheduling unit of a Kubernetes cluster; in general, the description file of Pod will declare the amount of resources such as CPU, memory, temporary storage, etc. of the central processing unit required by Pod, and advanced scheduling constraints such as node selection, affinity and anti-affinity, topology break-up, etc.
The scheme provided by the embodiment of the application relates to an artificial intelligence technology, and the technical scheme of the application is described in detail by a specific embodiment. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
In order to better understand the scheme provided by the embodiment of the present application, the scheme is described below in connection with a specific application scenario.
In an embodiment, fig. 1 shows a schematic architecture diagram of a management system for a container cluster, where the embodiment of the present application is applicable, and it can be understood that the method for managing a container cluster provided by the embodiment of the present application may be applicable, but not limited to, to an application scenario as shown in fig. 1.
In this example, as shown in fig. 1, the architecture of the management system of the container cluster in this example may include, but is not limited to, a terminal 10, a server 20, a network 30, and a database 40. Interactions between the terminal 10, the server 20 and the database 40 may be through the network 30. The terminal 10 sends the newly added service requirement to the server 20, wherein the newly added service described in the newly added service requirement corresponds to at least one virtual workload; the server 20 obtains relevant information of at least one virtual workload, relevant information of each node of the container cluster to be tested, and relevant information of a container group included by each node; server 20 constructs at least one virtual container group included in each of the at least one virtual workload based on the related information of the at least one virtual workload; the server 20 determines first cache data based on the related information of each node and the related information of the container group included in each node; if the server 20 determines that any one of the at least one virtual container group cannot be scheduled to each node based on the first cache data, the number of nodes of the container cluster to be measured is adjusted, and the adjusted result is sent to the terminal 10 and the database 40, where the adjusted result includes increasing the number of nodes of the container cluster to be measured.
It will be appreciated that the above is only an example, and the present embodiment is not limited thereto.
The terminal may be a smart phone (such as an Android phone, an iOS phone, etc.), a phone simulator, a tablet computer, a notebook computer, a digital broadcast receiver, a MID (Mobile Internet Devices, mobile internet device), a PDA (personal digital assistant), etc. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server or a server cluster for providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Network, content delivery networks), basic cloud computing services such as big data and artificial intelligent platforms, and the like.
Cloud computing (clouding) is a computing model that distributes computing tasks across a large pool of computers, enabling various application systems to acquire computing power, storage space, and information services as needed. The network that provides the resources is referred to as the "cloud". Resources in the cloud are infinitely expandable in the sense of users, and can be acquired at any time, used as needed, expanded at any time and paid for use as needed.
As a basic capability provider of cloud computing, a cloud computing resource pool (cloud platform for short, generally referred to as IaaS (Infrastructure as a Service, infrastructure as a service) platform) is established, in which multiple types of virtual resources are deployed for external clients to select for use.
According to the logic function division, a PaaS (Platform as a Service ) layer can be deployed on an IaaS (Infrastructure as a Service ) layer, and a SaaS (Software as a Service, software as a service) layer can be deployed above the PaaS layer, or the SaaS can be directly deployed on the IaaS. PaaS is a platform on which software runs, such as a database, web container, etc. SaaS is a wide variety of business software such as web portals, sms mass senders, etc. Generally, saaS and PaaS are upper layers relative to IaaS.
The artificial intelligence cloud Service is also commonly referred to as AIaaS (AIas a Service, chinese is "AI as Service"). The service mode of the artificial intelligent platform is the mainstream at present, and particularly, the AIaaS platform can split several common AI services and provide independent or packaged services at the cloud. This service mode is similar to an AI theme mall: all developers can access one or more artificial intelligence services provided by the use platform through an API interface, and partial deep developers can also use an AI framework and AI infrastructure provided by the platform to deploy and operate and maintain self-proprietary cloud artificial intelligence services.
The network may include, but is not limited to: a wired network, a wireless network, wherein the wired network comprises: local area networks, metropolitan area networks, and wide area networks, the wireless network comprising: bluetooth, wi-Fi, and other networks implementing wireless communications. And in particular, the method can be determined based on actual application scene requirements, and is not limited herein.
Referring to fig. 2, fig. 2 is a schematic flow chart of a method for managing a container cluster according to an embodiment of the present application, where the method may be performed by any electronic device, for example, a server, and as an optional implementation manner, the method may be performed by the server, and for convenience of description, in the following description of some optional embodiments, a server will be taken as an example of a method execution body. As shown in fig. 2, the method for managing a container cluster provided by the embodiment of the application includes the following steps:
s201, obtaining relevant information of at least one virtual workload, relevant information of each node of a container cluster to be tested and relevant information of a container group included by each node.
Specifically, the information about the at least one virtual workload includes a name of each virtual workload in the at least one virtual workload, a number of virtual container groups in each virtual workload, and information about the virtual container groups in each virtual workload. The relevant information of each node of the container cluster to be tested comprises the label of each node and the resource quantity of each node, and the relevant information of the container group of each node of the container cluster to be tested comprises the label of the container group in each node and the resource quantity of the container group in each node. The virtual workload may be a virtual workload resource.
In one embodiment, the relevant information of at least one virtual workload, the relevant information of each node of the container cluster to be tested and the relevant information of the container group included by each node are obtained through the simulation scheduling controller; wherein the emulated schedule controller is an additional controller distinct from the native scheduler kube-scheduler in the Kubernetes cluster, the emulated schedule controller may be provided in the Kubernetes cluster.
It should be noted that, the newly added service may correspond to a virtual workload, where the virtual workload is not a real workload, the virtual workload is a virtual resource, and the emulation scheduling controller performs emulation through the virtual workload, so as to determine whether the container cluster to be tested (for example, the container cluster is a Kubernetes cluster) can accommodate the virtual workload, that is, determine whether the remaining available resources of each node in the container cluster to be tested can meet the requirement of the virtual workload (newly added service).
In one embodiment, as shown in fig. 3, the related information of the multiple virtual workloads may be presented in a virtual workload description list, where the virtual workload 1, the virtual workload 2, and the virtual workload x are different virtual workloads; wherein the related information of each virtual workload includes the name of the virtual workload (such as virtual workload 1), the number of copies (the number of virtual container groups) and the virtual Pod template description (the related information of the virtual container groups), and the number of copies is a mandatory item.
S202, constructing at least one virtual container group included in each virtual workload in at least one virtual workload based on the related information of the at least one virtual workload.
In particular, each virtual workload may include multiple virtual container groups, i.e., virtual Pods. Since the virtual workload is not a real workload, the virtual Pod is also not a real Pod, which is a virtual resource.
The related information of the virtual container group (virtual Pod) may include a virtual Pod description file. The virtual Pod description file is a yaml file with a specified format, and the virtual Pod description file declares the amount of resources such as a Central Processing Unit (CPU), a memory, temporary storage and the like required by virtual Pod operation and scheduling constraint conditions. If the amount of resources remaining on a node in the container cluster to be tested meets the amount of resources required by a virtual Pod statement, the node can be used as a candidate node for the virtual Pod scheduling, and whether the node meets the scheduling constraint condition of the virtual Pod is determined.
The scheduling constraints declared in the virtual Pod description file include: the specific selection must schedule the virtual Pod to which type of node (node selection), the virtual Pod has affinity to which type of node (affinity between virtual Pod and node), the virtual Pod and which type of Pod have affinity to the same node (affinity between virtual Pod and Pod), the virtual Pod and which type of Pod have no need to schedule to the same node as much as possible (anti-affinity between virtual Pod and Pod), there are only several types of Pod (topology break up) in a certain topology area, other custom scheduling constraint conditions implemented according to Kubernetes scheduling plug-in specification, etc.
In one embodiment, virtual Pod is typically tagged (e.g., app=wechat), and virtual Pod with some tags may be designated as a virtual Pod of the same type, and creation of virtual Pod is typically not directly committed within the container cluster, and N virtual pods of the same type may be created by a higher level virtual workload (e.g., deployment, statefulset, etc.) than virtual Pod, N being the number of copies of a virtual Pod, i.e., each copy of a virtual workload is a virtual Pod.
In one embodiment, a node may be tagged (e.g., region=solution, zone=sharehhen, hostname=node 1), a virtual Pod may specify that the selection must be on a node with a certain tag (e.g., a virtual Pod may specify that the virtual Pod must be scheduled to a node with zone=sharehhen), or be as affinity as possible to a node with a certain tag. The labels of the nodes may be different in value, for example, the label zone may be a shenzhen, a guangzhou, or a donguan.
Topology scattering is to scatter distribution on labels of designated nodes aiming at the same type of Pod, so that the quantity deviation of the Pod obtained by scheduling does not exceed a designated value under the condition of different values of the labels; for example, when the number of the Pod labels of the designated node is equal to or less than 1, if the number of the Pod labels of all nodes in the container cluster is equal to shenzhen, guangzhou or donguan, the 3 pods can only be obtained by 1 Pod on the zone=sharzen node and 1 Pod on the zone=guangzhou node after the 3 pods are scheduled, and the situation that 2 pods or 3 pods are obtained on the zone=sharzhen node is avoided, because the topology scattering in the scheduling constraint condition is not satisfied due to the fact that the deviation of 2:1:0 or 3:0:0 and the deviation of 2-0=2 and 3-0=3 is not satisfied.
In one embodiment, after a node in the container cluster is divided into a virtual Pod, the amount of resources declared by the virtual Pod is subtracted from the node state (information about the node); for example, a node may have 8-core CPU and 32G memory, a virtual Pod declares 1-core 2G, and after assigning to the node by the emulated dispatch controller, the node updates its node state, subtracts 1-core 2G declared by the virtual Pod, and leaves 7-cores 30G available for use by other virtual pods.
S203, determining first cache data based on the relevant information of each node and the relevant information of the container group included by each node.
Specifically, the first cache data may be scheduler cache data, which may be the same as a SchedulerCache of a scheduler kube-scheduler in the container cluster.
S204, if any one of the at least one virtual container group is determined to be unable to be dispatched to each node based on the first cache data, the node number of the container cluster to be tested is adjusted.
Specifically, if it is determined that any one of the at least one virtual container group can be scheduled to each node based on the first cache data, the number of nodes of the container cluster to be tested does not need to be adjusted, so that it is accurately determined that the remaining available resources of each node in the container cluster to be tested can meet the virtual workload demand, and it is accurately determined that the container cluster to be tested does not need to be expanded.
If any one of the at least one virtual container group cannot be scheduled to each node based on the first cache data, the number of nodes of the container cluster to be tested is adjusted, so that the fact that the remaining available resources of each node in the container cluster to be tested cannot meet virtual workload requirements is accurately determined, and the fact that the container cluster to be tested needs to be expanded is accurately determined.
In the embodiment of the application, the related information of at least one virtual workload, the related information of each node of the container cluster to be tested and the related information of the container group included by each node are obtained; constructing at least one virtual container group included in each virtual workload in the at least one virtual workload based on the related information of the at least one virtual workload; determining first cache data based on the related information of each node and the related information of the container group included by each node; if any one of the at least one virtual container group cannot be scheduled to each node based on the first cache data, adjusting the node number of the container cluster to be measured; therefore, the container cluster to be tested (such as a Kubernetes cluster) can be accurately determined to be incapable of accommodating the virtual workload, if any one of the at least one virtual container group is determined to be incapable of being scheduled to each node based on the first cache data, the remaining available resources of each node in the container cluster to be tested are accurately determined to be incapable of meeting the virtual workload (newly added service) requirement, and accordingly the container cluster to be tested is accurately determined to be expanded, and the accuracy of determining whether the container cluster to be tested can deploy the newly added service is improved.
In one embodiment, the method of managing a cluster of containers includes the steps A1-A4 of:
and A1, acquiring relevant information of at least one virtual node, wherein the relevant information of the at least one virtual node comprises the number of the at least one virtual node.
Specifically, by simulating the scheduling controller, obtaining relevant information of at least one virtual node, wherein the relevant information of the at least one virtual node comprises the number of the at least one virtual node.
It should be noted that, the virtual workload is not a real workload, the virtual node is not a real virtual node, and the virtual node is a virtual resource. The simulation scheduling controller simulates through the virtual workload and the virtual nodes to determine whether the residual available resources of each node and the available resources of each virtual node in the container cluster to be tested can meet the virtual workload requirement; if the residual available resources of all the nodes in the container cluster to be tested and the available resources of all the virtual nodes can meet the virtual workload demands, the container cluster to be tested is expanded based on the types and the numbers of all the virtual nodes, and then the nodes which are the same as the virtual nodes in type and the number of the virtual nodes can be newly added in the container cluster to be tested.
And A2, constructing each virtual node corresponding to at least one virtual node based on the related information of the at least one virtual node.
In one embodiment, as shown in fig. 3, the related information of multiple virtual nodes may be presented by means of a virtual node description list, where the virtual node description 1, the virtual node description 2, and the virtual node description y in the virtual node description list are related information of different types of virtual nodes. The related information for each virtual node includes the number of such virtual nodes and such virtual node template description. The number of the virtual nodes is an option, and if the number is input, the number of certain virtual nodes is specified, and the specified number of virtual nodes is constructed; if the number is not input and the number of certain virtual nodes is not specified, the initial number of the virtual nodes is automatically set to 0, and the simulation scheduling controller can automatically increase the number of the virtual nodes to meet the scheduling requirement of the virtual workload. The virtual node template description may include labels of virtual nodes, amounts of resources of virtual nodes, and the like; for example, virtual node templates are described as 16 cores 36G, 32 cores 64G, etc.
And A3, determining second cache data based on the number of at least one virtual node, the related information of each node and the related information of a container group included by each node.
Specifically, the second cache data may be scheduler cache data, and the scheduler cache data is structured data. The scheduler cache data comprises node information (at least one of the number of virtual nodes and related information of each node) and information of an existing Pod (related information of a container group included by each node), and a scheduling algorithm reads the data in the scheduler cache data to calculate that the virtual Pod can not be scheduled on the virtual node or each node; the scheduling algorithm is originally provided by the kubernetes cluster, and is used for calculating whether resources of the virtual nodes or residual resources of each node can not meet the scheduling constraint of the virtual Pod, the labels on the virtual nodes or the labels on each node can not meet the scheduling constraint of the virtual Pod, which Pod exists on each node, and whether the existing Pod and the virtual Pod ready to be scheduled meet the scheduling constraint conditions of affinity, anti-affinity and the like. The scheduling algorithm traverses the virtual nodes and each node, finds out which resources and scheduling constraint conditions required by the virtual Pod are met in the virtual nodes or each node, and selects one virtual node or one node from the virtual nodes or each node as a final scheduling result of the virtual Pod. And if the virtual node or each node is not satisfied, indicating that the virtual Pod scheduling fails.
And step A4, if any one of the at least one virtual container group is determined to be unable to be scheduled to each node and each virtual node based on the second cache data, accumulating the number of the at least one virtual node, and updating the number of the at least one virtual node.
Step A3 (determining second cache data based on the number of at least one virtual node, the related information of each node, and the related information of container groups included in each node) and step A4 (if it is determined that any one of the at least one virtual container groups cannot be scheduled to each node and each virtual node based on the second cache data, accumulating the number of the at least one virtual node and updating the number of the at least one virtual node) are repeatedly performed until the updated number of the at least one virtual node and the newly increased virtual node corresponding to the at least one virtual node are obtained, and if any one of the at least one virtual container group can be scheduled to the newly increased virtual node, determining the updated number of the at least one virtual node as the newly increased node number of the container cluster to be measured.
Specifically, the accumulation processing, for example, adds 1 to the number of virtual nodes, i.e., adds one virtual node. For another example, the number of virtual nodes is 1, after 3 times of accumulation processing, the number of newly added virtual nodes is 3, and the updated number of virtual nodes is 1+3=4, so that the number of newly added nodes of the container cluster to be tested is 4, that is, the container cluster to be tested is expanded, and 4 nodes are added in the container cluster to be tested.
In the embodiment of the application, the container cluster to be tested (such as a Kubernetes cluster) and the virtual nodes can be accurately determined to be incapable of accommodating the virtual workload, and if the residual available resources of each node in the container cluster to be tested and the available resources of each virtual node can meet the virtual workload demand, the container cluster to be tested is expanded based on the types and the numbers of each virtual node, so that the accuracy of expanding the container cluster to be tested is improved.
In one embodiment, the method of managing a cluster of containers includes the steps B1-B3 of:
and B1, acquiring relevant information of at least one virtual node.
Specifically, as shown in fig. 3, the related information of various virtual nodes can be presented by means of a virtual node description list.
And B2, constructing each virtual node corresponding to at least one virtual node based on the related information of the at least one virtual node, and determining third cache data.
Specifically, the third buffered data may be scheduler buffered data, and the scheduler buffered data is structured data. The scheduler cache data comprises at least one kind of relevant information of the virtual nodes, and a scheduling algorithm reads the data in the scheduler cache data to calculate that the virtual Pod can not be scheduled on the virtual nodes; the scheduling algorithm is originally possessed by the kubernetes cluster, and is used for calculating that the resources of the virtual nodes can not meet the virtual Pod ready to be scheduled, and the labels on the virtual nodes can not meet the scheduling constraint of the virtual Pod. The scheduling algorithm traverses the virtual nodes to find out which resources and scheduling constraint conditions required by the virtual Pod are met in the virtual nodes, and selects one virtual node from the virtual nodes as a final scheduling result of the virtual Pod. And if the virtual nodes are not satisfied, indicating that the virtual Pod scheduling fails.
And B3, if any one of the at least one virtual container group can be scheduled to each virtual node based on the third cache data, constructing a new container cluster based on the related information of the at least one virtual node and the related information of the at least one virtual workload.
In one embodiment, if a container cluster needs to be newly built, the simulation scheduling controller simulates through the virtual workload and the virtual nodes to determine whether available resources of the virtual nodes can meet the virtual workload requirement; if the available resources of the virtual nodes can meet the virtual workload demands, based on the types and the number of the virtual nodes, machine (such as a server) purchasing is performed, a container cluster is newly built, and the available resources of the nodes in the newly built container cluster can accommodate the traffic corresponding to the virtual workload.
In the embodiment of the application, the virtual node can be accurately determined to be incapable of accommodating the virtual workload, and if the available resources of the virtual node are determined to meet the virtual workload demand, a new container cluster is constructed based on the types and the numbers of the virtual nodes, so that the accuracy of constructing the new container cluster is improved.
In one embodiment, the information about the at least one virtual workload includes a name of each virtual workload in the at least one virtual workload, a number of virtual container groups in each virtual workload, information about virtual container groups in each virtual workload; constructing at least one virtual container group included in each virtual workload in the at least one virtual workload based on the related information of the at least one virtual workload, including:
and constructing at least one virtual container group in each virtual workload based on the name of each virtual workload, the number of virtual container groups in each virtual workload and related information of the virtual container groups in each virtual workload, wherein the related information of the virtual container groups in each virtual workload comprises at least one of required resource amount and scheduling constraint.
In particular, the related information of the virtual container group (virtual Pod) may include a virtual Pod description file. The virtual Pod description file is a yaml file with a specified format, and the virtual Pod description file declares the amount of resources such as a Central Processing Unit (CPU), a memory, temporary storage, etc. required for virtual Pod operation, and scheduling constraint conditions (scheduling constraint). If the amount of resources remaining on a node in the container cluster to be tested meets the amount of resources required by a virtual Pod statement, the node can be used as a candidate node for the virtual Pod scheduling, and whether the node meets the scheduling constraint condition of the virtual Pod is determined.
The scheduling constraints declared in the virtual Pod description file include: the specific choice must schedule the virtual Pod to at least one of which class of nodes (node selection), the virtual Pod is as affinity as possible to which class of nodes (affinity between virtual Pod and nodes), the virtual Pod and which class of Pod are as good as possible to schedule to the same node (affinity between virtual Pod and Pod), the virtual Pod and which class of Pod are as little as possible to schedule to the same node (counter-affinity between virtual Pod and Pod), there can only be at least one of several types of Pod (topology break up) within a certain topology area.
In one embodiment, the relevant information of each node includes a label of each node and a resource amount of each node, and the relevant information of the container group included in each node includes a label of the container group in each node and a resource amount of the container group in each node; determining first cache data based on the related information of each node and the related information of the container group included in each node, including:
the first cache data is determined based on the labels of the nodes, the resource amounts of the nodes, the labels of the container groups in the nodes, and the resource amounts of the container groups in the nodes.
Specifically, the first cache data may be scheduler cache data, and the scheduler cache data is structured data. The scheduler cache data comprises node information (related information of each node) and information of an existing Pod (related information of a container group included by each node), and a scheduling algorithm reads the data in the scheduler cache data to calculate that the virtual Pod can not be scheduled on each node; the scheduling algorithm is originally possessed by the kubernetes cluster, and is used for calculating whether the residual resources of each node can not meet the scheduling constraint of the virtual Pod which is ready to be scheduled, the labels on each node can not meet the scheduling constraint of the virtual Pod, which Pod exists on each node, and whether the existing Pod and the virtual Pod which is ready to be scheduled meet the scheduling constraint conditions of affinity, anti-affinity and the like. The scheduling algorithm traverses each node to find out which of the nodes meets the resources and scheduling constraint conditions required by the virtual Pod, and selects one node from the nodes as a final scheduling result of the virtual Pod. And if all the nodes are not satisfied, indicating that the virtual Pod scheduling fails.
In one embodiment, if it is determined, based on the first cache data, that any one of the at least one virtual container group cannot be dispatched to the nodes, adjusting the number of nodes of the container cluster to be tested includes:
through a preset scheduling algorithm, if the required resource amount of any one of the at least one virtual container group is determined to be larger than the resource amount of each node based on the first cache data, the label of each node does not meet any one of the scheduling constraint of any one of the virtual container groups, and the label of the container group in each node does not meet any one of the scheduling constraint of any one of the virtual container groups, determining that any one of the at least one virtual container group cannot be scheduled to each node, and increasing the node number of the container cluster to be tested.
Specifically, the amount of resources of a node represents the remaining resources of the node, i.e., the available resources of the node.
If it is determined, based on the first cache data, that the required amount of resources of a virtual container group is greater than the amount of resources of a node, or that the label of the node does not satisfy the scheduling constraint of the virtual container group, it is determined that the virtual container group cannot be scheduled to the node.
If the required resource amount of a virtual container group is determined to be less than or equal to the resource amount of a node based on the first cache data, and the label of the node meets the scheduling constraint of the virtual container group, determining that the virtual container group can be scheduled to the node.
In one embodiment, the container cluster to be tested is a Kubernetes cluster, and the first cache data is scheduler cache data.
In order to better understand the method provided by the embodiment of the present application, the scheme of the embodiment of the present application is further described below with reference to examples of specific application scenarios.
The method provided by the embodiment of the application can be applied to a container cluster capacity expansion scene, a new container cluster scene and the like, wherein the container cluster capacity expansion scene is for example a Kubernetes cluster capacity expansion scene, and the new container cluster scene is for example a new Kubernetes cluster scene.
In a specific application scenario embodiment, for example, a container cluster expansion scenario, referring to fig. 4, a process flow of a method for managing a container cluster is shown, where the method may be performed by any electronic device, for example, a server, and as an alternative implementation, the method may be performed by the server, and for convenience of description, in the following description of some alternative embodiments, a description will be given taking the server as an implementation body of the method as an example. As shown in fig. 4, the processing flow of the method for managing a container cluster provided by the embodiment of the application includes the following steps:
S401, the server acquires a simulation scheduling task.
Specifically, the simulation scheduling task includes a virtual workload description list, a simulation policy, and a virtual node description list, or the simulation scheduling task includes a virtual workload description list and a simulation policy. As shown in fig. 3, the related information of multiple virtual workloads may be presented by way of a virtual workload description list, and the related information of multiple virtual nodes may be presented by way of a virtual Node description list, where the virtual Node template description may be consistent with the Kubernetes Node definition. The simulation strategy comprises the following steps: any of completely based on container clusters (e.g., S201-S204), completely based on virtual nodes (e.g., steps B1-B3), and simultaneously based on container clusters and virtual nodes (e.g., steps A1-A4).
S402, the server inputs the simulation scheduling task to a virtual resource preparation module of the simulation scheduling controller to obtain a virtual resource.
In particular, the virtual resource may be a virtual Pod, a virtual node, or the like. The simulation scheduling controller operates in a Kubernetes cluster, a simulation scheduling task is input to a virtual resource preparation module of the simulation scheduling controller, and the virtual resource preparation module creates a virtual Pod list, namely a plurality of virtual pods, of specified quantity, specified resource specification and specified scheduling constraint conditions according to a virtual workload description list in the simulation scheduling task. And the virtual resource preparation module can be used for selectively inputting a virtual node description list in the simulation scheduling task into the simulation scheduling controller, and if the virtual node description list contains virtual nodes and has a specified number, creating a specified number of virtual node lists, namely a plurality of virtual nodes.
Wherein the emulated schedule controller may be a single run binary tool.
S403, obtaining the Cache data of the scheduler through a local Cache preparation module of the simulation scheduling controller.
Specifically, the local Cache preparation module of the emulation scheduler collects state information of a container cluster through a container cluster API (Application Programming Interface ), wherein the state information of the container cluster comprises related information of each node of the container cluster, related information of a container group included by each node, related information of a virtual node and the like. The state information of the container clusters can be used to construct the scheduler cache data needed when the simulated scheduler runs the scheduling algorithm. For different simulation strategies:
(1) If the method is based on the container cluster (S201-S204, for example), a schedulercalcche consistent with the container scheduler kube-scheduler, namely the first cache data, is constructed based on the related information of each node of the container cluster and the related information of the container group included by each node.
(2) If the virtual nodes are completely based (for example, steps B1-B3), constructing an empty Cache (a scheduler caches data), and adding the virtual nodes into the Cache one by one according to the number of the virtual nodes used; if the number of virtual nodes is 0, the Cache is empty.
S404, based on the virtual resources and the data cached by the scheduler, a scheduling result of each virtual Pod in the virtual resources is obtained through a scheduling algorithm execution module of the simulation scheduling controller.
Specifically, the simulation scheduling controller transmits the simulation strategy, the virtual Pod list and the scheduler cache data to a scheduling algorithm execution module of the simulation scheduling controller, and the scheduling algorithm execution module sequentially executes a scheduling algorithm on each virtual Pod in the virtual Pod list and records a scheduling result of each virtual Pod.
S405, if a certain virtual Pod meets a preset first condition, accumulating the number of virtual nodes in the virtual resource through a circulation control module of the simulation scheduling controller, and converting to step S403 for processing; if it is determined that a certain virtual Pod satisfies the preset second condition, the process proceeds to step S406.
Specifically, the preset first condition includes that if a scheduling result of a certain virtual Pod is scheduling failure, a virtual node is included in a simulation scheduling task, a simulation strategy uses virtual nodes, and the number of virtual nodes is not specified in a virtual node template description. The second condition is preset to include that all virtual Pods of the virtual workload are successfully scheduled, the simulation scheduling task does not include virtual nodes, and the simulation scheduling policy is based on at least one of container cluster and virtual node template description.
If a batch of virtual workload has virtual Pod with failed dispatching, the simulation dispatching task comprises virtual nodes, the simulation strategy uses virtual nodes, and the number of virtual nodes is not specified in the description of the virtual node template, the number of virtual nodes is added with 1 from 0 through a circulation control module of the simulation dispatching controller, the virtual nodes are assigned to the number of currently used virtual nodes, and then the simulation dispatching controller is executed again from step S403, and the dispatcher cache data is reconstructed and the dispatching algorithm is executed. The circulation control module realizes the estimation of the number of the capacity expansion nodes required by meeting the input of the batch of virtual workload, thereby guiding the capacity expansion of the container cluster and the purchase of the machine; if all virtual Pods of the virtual workload are successfully scheduled, the simulation scheduling task does not comprise virtual nodes, the simulation scheduling policy is based on a container cluster completely, or the number of virtual nodes is specified in the description of a virtual node template, the loop control is finished, and the scheduling result of each virtual workload is counted.
S406, the simulation scheduling controller outputs a simulation scheduling task result.
Specifically, for each virtual workload, the simulation scheduling task results include: the name of the virtual workload, the number of all virtual Pod successfully scheduled in the virtual workload, the number of all virtual Pod failed to be scheduled in the virtual workload, the node distribution of the virtual Pod successfully scheduled, the reason for the failure to be scheduled, and the like.
The application of the embodiment of the application has at least the following beneficial effects:
through the simulation scheduling controller, the capacity expansion of the container cluster or the newly-built container cluster is realized, and the accuracy of determining whether the container cluster can deploy a new service or a newly-built container cluster is improved. By the simulation scheduling controller, whether the container cluster can meet the requirement of the newly added service or not can be accurately estimated before the newly added service is deployed, and whether the container cluster needs to be expanded or not is achieved, so that the problem that operation failure is caused by incapability of running the newly added service after the newly added service is deployed is effectively avoided, the container cluster can be guided to be expanded, and blind machine (server in the container cluster) purchasing is avoided.
The embodiment of the application also provides a device for managing the container cluster, and a schematic structural diagram of the device for managing the container cluster is shown in fig. 5, and the device for managing the container cluster 50 comprises a first processing module 501, a second processing module 502, a third processing module 503 and a fourth processing module 504.
A first processing module 501, configured to obtain related information of at least one virtual workload, related information of each node of a container cluster to be tested, and related information of a container group included in each node;
A second processing module 502, configured to construct at least one virtual container group included in each virtual workload in the at least one virtual workload based on the related information of the at least one virtual workload;
a third processing module 503, configured to determine first cache data based on the relevant information of each node and the relevant information of the container group included in each node;
a fourth processing module 504 is configured to adjust the number of nodes of the container cluster to be tested if it is determined that any one of the at least one virtual container group cannot be scheduled to each node based on the first cache data.
In one embodiment, the first processing module 501 is further configured to:
acquiring relevant information of at least one virtual node, wherein the relevant information of the at least one virtual node comprises the number of the at least one virtual node;
constructing each virtual node corresponding to at least one virtual node based on the related information of the at least one virtual node;
determining second cache data based on the number of at least one virtual node, the related information of each node, and the related information of the container group included by each node;
if any one of the at least one virtual container group cannot be scheduled to each node and each virtual node based on the second cache data, accumulating the number of the at least one virtual node, and updating the number of the at least one virtual node;
And repeatedly executing the second cache data based on the number of the at least one virtual node, the related information of each node and the related information of the container group included by each node, if any one of the at least one virtual container group is determined to be incapable of being scheduled to each node and each virtual node based on the second cache data, accumulating the number of the at least one virtual node, updating the number of the at least one virtual node until the updated number of the at least one virtual node and the newly increased virtual node corresponding to the at least one virtual node are obtained, and if any one of the virtual container group is capable of being scheduled to the newly increased virtual node, determining the updated number of the at least one virtual node as the newly increased node number of the container cluster to be tested.
In one embodiment, the first processing module 501 is further configured to:
acquiring relevant information of at least one virtual node;
constructing each virtual node corresponding to at least one virtual node based on the related information of the at least one virtual node, and determining third cache data;
if any one of the at least one virtual container group can be scheduled to each virtual node based on the third cache data, a new container cluster is constructed based on the related information of the at least one virtual node and the related information of the at least one virtual workload.
In one embodiment, the information about the at least one virtual workload includes a name of each virtual workload in the at least one virtual workload, a number of virtual container groups in each virtual workload, information about virtual container groups in each virtual workload; the second processing module 502 is specifically configured to:
and constructing at least one virtual container group in each virtual workload based on the name of each virtual workload, the number of virtual container groups in each virtual workload and related information of the virtual container groups in each virtual workload, wherein the related information of the virtual container groups in each virtual workload comprises at least one of required resource amount and scheduling constraint.
In one embodiment, the relevant information of each node includes a label of each node and a resource amount of each node, and the relevant information of the container group included in each node includes a label of the container group in each node and a resource amount of the container group in each node; the third processing module 503 is specifically configured to:
the first cache data is determined based on the labels of the nodes, the resource amounts of the nodes, the labels of the container groups in the nodes, and the resource amounts of the container groups in the nodes.
In one embodiment, the fourth processing module 504 is specifically configured to:
through a preset scheduling algorithm, if the required resource amount of any one of the at least one virtual container group is determined to be larger than the resource amount of each node based on the first cache data, the label of each node does not meet any one of the scheduling constraint of any one of the virtual container groups, and the label of the container group in each node does not meet any one of the scheduling constraint of any one of the virtual container groups, determining that any one of the at least one virtual container group cannot be scheduled to each node, and increasing the node number of the container cluster to be tested.
In one embodiment, the container cluster to be tested is a Kubernetes cluster, and the first cache data is scheduler cache data.
The application of the embodiment of the application has at least the following beneficial effects:
acquiring relevant information of at least one virtual workload, relevant information of each node of a container cluster to be tested and relevant information of a container group included by each node; constructing at least one virtual container group included in each virtual workload in the at least one virtual workload based on the related information of the at least one virtual workload; determining first cache data based on the related information of each node and the related information of the container group included by each node; if any one of the at least one virtual container group cannot be scheduled to each node based on the first cache data, adjusting the node number of the container cluster to be measured; therefore, the container cluster to be tested (such as a Kubernetes cluster) can be accurately determined to be incapable of accommodating the virtual workload, if any one of the at least one virtual container group is determined to be incapable of being scheduled to each node based on the first cache data, the remaining available resources of each node in the container cluster to be tested are accurately determined to be incapable of meeting the virtual workload (newly added service) requirement, and accordingly the container cluster to be tested is accurately determined to be expanded, and the accuracy of determining whether the container cluster to be tested can deploy the newly added service is improved.
The embodiment of the application also provides an electronic device, a schematic structural diagram of which is shown in fig. 6, and an electronic device 4000 shown in fig. 6 includes: a processor 4001 and a memory 4003. Wherein the processor 4001 is coupled to the memory 4003, such as via a bus 4002. Optionally, the electronic device 4000 may further comprise a transceiver 4004, the transceiver 4004 may be used for data interaction between the electronic device and other electronic devices, such as transmission of data and/or reception of data, etc. It should be noted that, in practical applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 is not limited to the embodiment of the present application.
The processor 4001 may be a CPU (Central Processing Unit ), general purpose processor, DSP (Digital Signal Processor, data signal processor), ASIC (Application Specific Integrated Circuit ), FPGA (Field Programmable Gate Array, field programmable gate array) or other programmable logic device, transistor logic device, hardware components, or any combination thereof. Which may implement or perform the various exemplary logic blocks, modules and circuits described in connection with this disclosure. The processor 4001 may also be a combination that implements computing functionality, e.g., comprising one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
Bus 4002 may include a path to transfer information between the aforementioned components. Bus 4002 may be a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus or an EISA (Extended Industry Standard Architecture ) bus, or the like. The bus 4002 can be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in fig. 6, but not only one bus or one type of bus.
Memory 4003 may be, but is not limited to, ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, RAM (Random Access Memory ) or other type of dynamic storage device that can store information and instructions, EEPROM (Electrically Erasable Programmable Read Only Memory ), CD-ROM (Compact Disc Read Only Memory, compact disc Read Only Memory) or other optical disk storage, optical disk storage (including compact discs, laser discs, optical discs, digital versatile discs, blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium that can be used to carry or store a computer program and that can be Read by a computer.
The memory 4003 is used for storing a computer program for executing an embodiment of the present application, and is controlled to be executed by the processor 4001. The processor 4001 is configured to execute a computer program stored in the memory 4003 to realize the steps shown in the foregoing method embodiment.
Among them, electronic devices include, but are not limited to: a server, etc.
The application of the embodiment of the application has at least the following beneficial effects:
acquiring relevant information of at least one virtual workload, relevant information of each node of a container cluster to be tested and relevant information of a container group included by each node; constructing at least one virtual container group included in each virtual workload in the at least one virtual workload based on the related information of the at least one virtual workload; determining first cache data based on the related information of each node and the related information of the container group included by each node; if any one of the at least one virtual container group cannot be scheduled to each node based on the first cache data, adjusting the node number of the container cluster to be measured; therefore, the container cluster to be tested (such as a Kubernetes cluster) can be accurately determined to be incapable of accommodating the virtual workload, if any one of the at least one virtual container group is determined to be incapable of being scheduled to each node based on the first cache data, the remaining available resources of each node in the container cluster to be tested are accurately determined to be incapable of meeting the virtual workload (newly added service) requirement, and accordingly the container cluster to be tested is accurately determined to be expanded, and the accuracy of determining whether the container cluster to be tested can deploy the newly added service is improved.
Embodiments of the present application provide a computer readable storage medium having a computer program stored thereon, which when executed by a processor, implements the steps of the foregoing method embodiments and corresponding content.
The embodiment of the application also provides a computer program product, which comprises a computer program, wherein the computer program can realize the steps and corresponding contents of the embodiment of the method when being executed by a processor.
Based on the same principle as the method provided by the embodiments of the present application, the embodiments of the present application also provide a computer program product or a computer program, which comprises computer instructions stored in a computer-readable storage medium. The computer instructions are read from a computer-readable storage medium by a processor of a computer device, and executed by the processor, cause the computer device to perform the method provided in any of the alternative embodiments of the application described above.
It should be understood that, although various operation steps are indicated by arrows in the flowcharts of the embodiments of the present application, the order in which these steps are implemented is not limited to the order indicated by the arrows. In some implementations of embodiments of the application, the implementation steps in the flowcharts may be performed in other orders as desired, unless explicitly stated herein. Furthermore, some or all of the steps in the flowcharts may include multiple sub-steps or multiple stages based on the actual implementation scenario. Some or all of these sub-steps or phases may be performed at the same time, or each of these sub-steps or phases may be performed at different times, respectively. In the case of different execution time, the execution sequence of the sub-steps or stages can be flexibly configured according to the requirement, which is not limited by the embodiment of the present application.
The foregoing is merely an optional implementation manner of some of the implementation scenarios of the present application, and it should be noted that, for those skilled in the art, other similar implementation manners based on the technical ideas of the present application are adopted without departing from the technical ideas of the scheme of the present application, and the implementation manner is also within the protection scope of the embodiments of the present application.

Claims (11)

1. A method for managing a cluster of containers, comprising:
acquiring relevant information of at least one virtual workload, relevant information of each node of a container cluster to be tested and relevant information of a container group included by each node;
constructing at least one virtual container group included in each virtual workload in the at least one virtual workload based on the related information of the at least one virtual workload;
determining first cache data based on the related information of each node and the related information of the container group included by each node;
and if any virtual container group in the at least one virtual container group can not be scheduled to each node based on the first cache data, adjusting the node number of the container cluster to be tested.
2. The method as recited in claim 1, further comprising:
Acquiring relevant information of at least one virtual node, wherein the relevant information of the at least one virtual node comprises the number of the at least one virtual node;
constructing each virtual node corresponding to the at least one virtual node based on the related information of the at least one virtual node;
determining second cache data based on the number of the at least one virtual node, the related information of each node and the related information of the container group included by each node;
if any one of the at least one virtual container group is determined to be unable to be scheduled to each node and each virtual node based on the second cache data, accumulating the number of the at least one virtual node, and updating the number of the at least one virtual node;
and repeatedly executing second cache data based on the number of the at least one virtual node, the related information of each node and the related information of container groups included by each node, if any virtual container group in the at least one virtual container group cannot be scheduled to each node and each virtual node based on the second cache data, accumulating the number of the at least one virtual node, and updating the number of the at least one virtual node until the updated number of the at least one virtual node and the newly increased virtual node corresponding to the at least one virtual node are obtained, and determining the updated number of the at least one virtual node as the newly increased node number of the container cluster to be tested if the second cache data is used for determining that any virtual container group in the at least one virtual container group cannot be scheduled to the nodes and the virtual nodes.
3. The method as recited in claim 1, further comprising:
acquiring relevant information of at least one virtual node;
constructing each virtual node corresponding to the at least one virtual node based on the related information of the at least one virtual node, and determining third cache data;
if any one of the at least one virtual container group can be scheduled to each virtual node based on the third cache data, a new container cluster is constructed based on the relevant information of the at least one virtual node and the relevant information of at least one virtual workload.
4. The method of claim 1, wherein the information about the at least one virtual workload includes a name of each virtual workload in the at least one virtual workload, a number of virtual container groups in each virtual workload, and information about virtual container groups in each virtual workload; the constructing at least one virtual container group included in each virtual workload in the at least one virtual workload based on the related information of the at least one virtual workload includes:
And constructing at least one virtual container group in each virtual workload based on the name of each virtual workload, the number of the virtual container groups in each virtual workload and the related information of the virtual container groups in each virtual workload, wherein the related information of the virtual container groups in each virtual workload comprises at least one of required resource amount and scheduling constraint.
5. The method of claim 1, wherein the information about each node includes a label of each node and an amount of resources of each node, and wherein the information about each node includes a label of each container group and an amount of resources of each container group; the determining the first cache data based on the related information of each node and the related information of the container group included by each node includes:
and determining first cache data based on the labels of the nodes, the resource amounts of the nodes, the labels of the container groups in the nodes and the resource amounts of the container groups in the nodes.
6. The method of claim 1, wherein adjusting the number of nodes of the container cluster under test if it is determined that any one of the at least one virtual container group cannot be dispatched to the nodes based on the first cache data comprises:
And if the required resource amount of any virtual container group in the at least one virtual container group is determined to be larger than the resource amount of each node based on the first cache data, the label of each node does not meet any one of the scheduling constraint of any virtual container group, and the label of the container group in each node does not meet any one of the scheduling constraint of any virtual container group through a preset scheduling algorithm, determining that any virtual container group in the at least one virtual container group cannot be scheduled to each node, and increasing the node number of the container cluster to be tested.
7. The method of any of claims 1-6, wherein the container cluster to be tested is a Kubernetes cluster and the first cache data is scheduler cache data.
8. A device for managing a cluster of containers, comprising:
the first processing module is used for acquiring the related information of at least one virtual workload, the related information of each node of the container cluster to be tested and the related information of the container group included by each node;
a second processing module, configured to construct at least one virtual container group included in each virtual workload in the at least one virtual workload based on the related information of the at least one virtual workload;
The third processing module is used for determining first cache data based on the related information of each node and the related information of the container group included by each node;
and the fourth processing module is used for adjusting the node number of the container cluster to be tested if any one of the at least one virtual container group is determined to be unable to be scheduled to each node based on the first cache data.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory, characterized in that the processor executes the computer program to carry out the steps of the method of any one of claims 1-7.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any of claims 1-7.
11. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any of claims 1-7.
CN202210399829.8A 2022-04-15 2022-04-15 Method, apparatus, device, storage medium and program product for managing container clusters Pending CN116954878A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210399829.8A CN116954878A (en) 2022-04-15 2022-04-15 Method, apparatus, device, storage medium and program product for managing container clusters

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210399829.8A CN116954878A (en) 2022-04-15 2022-04-15 Method, apparatus, device, storage medium and program product for managing container clusters

Publications (1)

Publication Number Publication Date
CN116954878A true CN116954878A (en) 2023-10-27

Family

ID=88441402

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210399829.8A Pending CN116954878A (en) 2022-04-15 2022-04-15 Method, apparatus, device, storage medium and program product for managing container clusters

Country Status (1)

Country Link
CN (1) CN116954878A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117806815A (en) * 2023-11-27 2024-04-02 本原数据(北京)信息技术有限公司 Data processing method, system, electronic device and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117806815A (en) * 2023-11-27 2024-04-02 本原数据(北京)信息技术有限公司 Data processing method, system, electronic device and storage medium

Similar Documents

Publication Publication Date Title
CN108614726B (en) Virtual machine creation method and device
CN108958796B (en) Service request processing method and device and service request processing system
US20180027061A1 (en) Method and apparatus for elastically scaling virtual machine cluster
CN115328663A (en) Method, device, equipment and storage medium for scheduling resources based on PaaS platform
KR102298766B1 (en) Apparatus and method for converting deep learning model for target device
CN114818446B (en) Power service decomposition method and system facing 5G cloud edge terminal cooperation
TW201818239A (en) Application link expansion method, apparatus and system
CN113553140B (en) Resource scheduling method, equipment and system
CN110740194A (en) Micro-service combination method based on cloud edge fusion and application
CN113553178A (en) Task processing method and device and electronic equipment
CN113094028A (en) Windows desktop program development framework, method and related components
CN114296933A (en) Implementation method of lightweight container under terminal edge cloud architecture and data processing system
CN112579319A (en) Service calling method and device based on LRU Cache optimization
CN109343970B (en) Application program-based operation method and device, electronic equipment and computer medium
CN117435324B (en) Task scheduling method based on containerization
CN112860412B (en) Service data processing method and device, electronic equipment and storage medium
CN111858050B (en) Server cluster hybrid deployment method, cluster management node and related system
CN114327846A (en) Cluster capacity expansion method and device, electronic equipment and computer readable storage medium
CN114006815A (en) Automatic deployment method and device for cloud platform nodes, nodes and storage medium
CN116954878A (en) Method, apparatus, device, storage medium and program product for managing container clusters
CN115686811A (en) Process management method, device, computer equipment and storage medium
CN113132445A (en) Resource scheduling method, device, network system and storage medium
CN105824712A (en) Method and device for executing business logic
CN111796801B (en) Automatic construction method and system for application version based on container
CN116760885B (en) Method, device, equipment, medium and program product for managing computing power network business

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