CN115113975A - Cluster management method and device, electronic equipment and storage medium - Google Patents

Cluster management method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115113975A
CN115113975A CN202210661922.1A CN202210661922A CN115113975A CN 115113975 A CN115113975 A CN 115113975A CN 202210661922 A CN202210661922 A CN 202210661922A CN 115113975 A CN115113975 A CN 115113975A
Authority
CN
China
Prior art keywords
cluster
application instance
virtual machine
key parameter
creation application
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
CN202210661922.1A
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.)
Inspur Communication Technology Co Ltd
Original Assignee
Inspur Communication Technology 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 Inspur Communication Technology Co Ltd filed Critical Inspur Communication Technology Co Ltd
Priority to CN202210661922.1A priority Critical patent/CN115113975A/en
Publication of CN115113975A publication Critical patent/CN115113975A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45575Starting, stopping, suspending or resuming virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a cluster management method, a cluster management device, electronic equipment and a storage medium, wherein the method comprises the following steps: creating a first virtual machine, wherein the first virtual machine is used as an installation node of a cluster; acquiring a first key parameter for cluster creation, wherein the first key parameter is used as an initialization environment variable for starting a cluster creation application instance, the cluster creation application instance is used for executing cluster creation operation on a first virtual machine, and a container mirror image corresponding to the cluster creation application instance is solidified with an anslebeserver dependent component and a task script for cluster management; and starting a cluster creation application instance based on the first key parameter, wherein the cluster creation application instance runs on a container arrangement engine in a working container form. According to the method and the device, the cluster creation application instance is started based on the first key parameter, the cluster creation application instance can execute cluster creation operation on the first virtual machine, automation of cluster creation management can be achieved, and cluster management efficiency can be improved.

Description

Cluster management method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of cloud computing technologies, and in particular, to a method and an apparatus for cluster management, an electronic device, and a storage medium.
Background
In the related art, a container arrangement engine (for example, kubernets) deployment manner is often performed through an allowed tool, that is, in a selected group of Virtual Machines (VMs), a certain VM is configured as an allowed server. The ansable server contains the necessary dependency packages for cluster installation, as well as ansable scripts. The ansable server is mainly responsible for executing ansable scripts, establishing Secure Shell (SSH) connection with other virtual machines, copying a dependency package to a target virtual machine, and performing installation operation.
However, in the whole cluster deployment work, both the configuration and preparation work of the idle server need to be performed manually, and the efficiency is low.
Disclosure of Invention
The invention provides a cluster management method, a cluster management device, electronic equipment and a storage medium, which are used for overcoming the defect of low working efficiency of cluster deployment in the prior art and realizing automation of cluster creation management.
In a first aspect, the present invention provides a method for cluster management, including:
creating a first virtual machine, wherein the first virtual machine is used as an installation node of a cluster;
acquiring a first key parameter for cluster creation, wherein the first key parameter is used as an initialization environment variable for starting a cluster creation application instance, the cluster creation application instance is used for executing cluster creation operation on the first virtual machine, and a container mirror image corresponding to the cluster creation application instance is solidified with a dependent component of an idle server and a task script of cluster management;
and starting the cluster creation application instance based on the first key parameter, wherein the cluster creation application instance runs on a container arrangement engine in a working class container form.
Optionally, according to a method for cluster management provided by the present invention, the first key parameter includes: the method comprises the steps that an IP address of a first virtual machine, a root password of the first virtual machine, a cluster version and a cluster-dependent container runtime type are set; the container arrangement engine is Kubernetes; the starting the cluster creation application instance based on the first key parameter comprises:
and starting the cluster creation application instance based on the first key parameter through communication with a service interface of Kubernetes.
Optionally, according to a method for cluster management provided by the present invention, after the starting of the cluster creation application instance based on the first key parameter, the method further includes:
determining a cluster management task, wherein the cluster management task is any one of the following items: a cluster capacity expansion task, a cluster capacity reduction task or a cluster deletion task;
acquiring a second key parameter for cluster management based on the cluster management task, wherein the second key parameter is used as an initialization environment variable for starting a target application instance, the target application instance is used for executing cluster management operation, and a dependent component of an idle server and a task script of the cluster management are solidified in a container mirror image corresponding to the target application instance;
and starting the target application instance based on the second key parameter, wherein the target application instance runs on the container arrangement engine in a work class container form.
Optionally, according to a method for cluster management provided by the present invention, before the obtaining, based on the cluster management task, a second key parameter for cluster management, the method further includes:
and under the condition that the cluster management task is the cluster expansion task, creating a second virtual machine for expansion.
Optionally, according to the method for cluster management provided by the present invention, in a case that the cluster management task is the cluster extension task, the second key parameter includes: the method comprises the steps of setting a cluster version and a cluster-dependent container runtime type, wherein the cluster version comprises an IP address of a first virtual machine, a root password of the first virtual machine, an IP address of a second virtual machine, a root password of the second virtual machine, and the cluster runtime type.
Optionally, according to a method for cluster management provided by the present invention, after the starting the cluster creation application instance based on the first key parameter, the method further includes:
displaying first information for indicating that a cluster is ready in case that the execution of the cluster creation application instance is determined to be completed;
or, in case that the execution of the target application instance is determined to be completed, displaying second information for indicating that the cluster is ready.
In a second aspect, the present invention further provides an apparatus for cluster management, including:
the system comprises a creating module, a sending module and a processing module, wherein the creating module is used for creating a first virtual machine which is used as an installation node of a cluster;
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a first key parameter for cluster creation, the first key parameter is used as an initialization environment variable for starting a cluster creation application instance, the cluster creation application instance is used for executing cluster creation operation on a first virtual machine, and a container mirror image corresponding to the cluster creation application instance is solidified with a dependent component of an idle server and a task script of cluster management;
and the starting module is used for starting the cluster creation application instance based on the first key parameter, and the cluster creation application instance runs on the container arrangement engine in a working class container form.
In a third aspect, the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the processor implements the cluster management method as described in any one of the above.
In a fourth aspect, the present invention also provides a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of cluster management as described in any one of the above.
In a fifth aspect, the present invention also provides a computer program product comprising a computer program which, when executed by a processor, implements a method of cluster management as described in any one of the above.
According to the cluster management method, the cluster creation application instance, the container mirror image corresponding to the cluster creation application instance is solidified with the dependent component of the idle server and the task script of the cluster management, so that the cluster creation application instance can execute cluster creation operation on the first virtual machine, the cluster creation application instance runs on the container arrangement engine in a working container form, the life cycle of the cluster creation application instance is the execution time length of one-time management command, the container corresponding to the cluster creation application instance exits after the cluster creation operation is completed, automation of the cluster creation management can be achieved, and efficiency of the cluster management can be improved.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a schematic diagram of an openstack deployment modality provided by the related art;
FIG. 2 is a diagram of a top-level K8S cluster deployment scenario provided by the related art;
FIG. 3 is a flow chart of a method for cluster management according to the present invention;
FIG. 4 is a schematic diagram of the deployment of components provided by the present invention;
FIG. 5 is a second flowchart of a cluster management method provided by the present invention;
FIG. 6 is a third schematic flowchart of a cluster management method provided in the present invention;
FIG. 7 is a schematic structural diagram of a device for cluster management provided in the present invention;
fig. 8 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
To facilitate a clearer understanding of embodiments of the present invention, some relevant background information is first presented below.
Openstack is a combination of technologies that encompasses a number of services. Kolla in the related art has a final goal of creating a corresponding Docker Image (Image) for each OpenStack service, and Kolla has a small Docker Image granularity, which is specific to each OpenStack service. After combining Kolla deployment modality with kubernets (abbreviated as K8S), the Openstack core components all run in Pod form on a K8S base (K8S carries Openstack components in Pod form). The Openstack inter-component communication becomes an inter-Pod communication. Each service of Openstack can be called through the Rest interface.
Fig. 1 is a schematic diagram of an Openstack deployment configuration provided in the related art, as shown in fig. 1, a core component Pod of Openstack is in a Pod network plane, and the core component of Openstack may include a Nova component, a Neutron component, a circle component, or a Glance component; at the K8S, a Pod can be pulled up, and the Pod and the Openstack core component Pod are in the same network plane, so that the Pod has the capability of calling the Openstack interface, and the Pod can be mainly responsible for the creation of the virtual machine.
Fig. 2 is a schematic diagram of a top-level K8S cluster deployment form provided by the related art, and as shown in fig. 2, container virtualization is implemented to simulate a plurality of resource groups to share hardware resources on a single operating system, and is a resource allocation manner with smaller granularity, and K8S may be deployed in a group of virtual machines to provide container services to the outside as a cluster.
In order to overcome the above defects, the present invention provides a method, an apparatus, an electronic device, and a storage medium for cluster management, which can implement automation of cluster creation management by starting a cluster creation application instance based on a first key parameter.
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 3 is a flowchart of one of the methods for Cluster management provided by the present invention, and as shown in fig. 3, an execution subject of the method for Cluster management may be a Container Cluster Manager (CCM), and the CCM may be a Pod in the same network plane as the Pod of the Openstack. The method comprises the following steps:
step 301, creating a first virtual machine, wherein the first virtual machine is used as an installation node of a cluster;
in particular, to create a cluster on a virtual machine, a first virtual machine may be created, which may serve as an installation node of the cluster.
Step 302, acquiring a first key parameter for cluster creation, wherein the first key parameter is used as an initialization environment variable for starting a cluster creation application instance, the cluster creation application instance is used for executing cluster creation operation on the first virtual machine, and a container mirror image corresponding to the cluster creation application instance is solidified with a dependent component of an idle server and a task script of cluster management;
step 303, based on the first key parameter, starting the cluster creation application instance, where the cluster creation application instance runs on a container arrangement engine in a work class container form.
Specifically, after the first virtual machine is created, a first key parameter may be obtained, where the first key parameter may be used as an initialization environment variable for starting a cluster creation application instance, and then the cluster creation application instance may be started based on the first key parameter, a container mirror image corresponding to the cluster creation application instance is solidified with a dependent component of an allowed server and a task script of cluster management, and the cluster creation application instance may execute a cluster creation operation.
Optionally, the cluster management method provided by the present invention may be applied to a containerization platform, and the containerization platform may use Openstack as an infrastructure layer. The main role of Openstack is to decouple the physical and logical topology of the IT system. By running a plurality of operating systems (namely virtual machines) on one machine at the same time, the problem of improving the resource utilization rate of a physical machine under the condition of ensuring the independence and isolation of service instances can be solved.
Optionally, the containerization platform may construct a container arrangement engine based on K8S on the infrastructure layer, so as to achieve finer-grained resource utilization, and achieve dynamic lateral expansion of physical resources according to a service load by means of the container arrangement capability of K8S.
Optionally, for the containerization platform described above, the infrastructure layer may implement Openstack component containerization deployment by Kolla. On this basis, the containerization platform may further incorporate K8S as an Openstack base. By combining the component containerization technology and the container arrangement technology, the containerization platform can realize multiple copies, high availability and dynamic expansion and contraction of Openstack service granularity, and can simplify the deployment of Openstack. The core components of Openstack all run in Pod on the K8S base. Openstack inter-component communication can be converted into inter-Pod communication.
Optionally, for the containerization platform, Openstack may create a virtual machine on the managed physical machine, and deploy the K8S cluster in the virtual machine. The container capability used by the user is provided by the K8S cluster in the virtual machine.
Optionally, fig. 4 is a schematic diagram of a deployment form of each component provided by the present invention, and as shown in fig. 4, the CCM may include a CCM front end and a CCM back end, where the CCM front end, the CCM back end, and an application instance (jobb) of cluster management operation are all in a base K8S of Openstack, and are at the same level as a container of an Openstack control plane. The CCM front end, the CCM back end, the Job of cluster management operation and the containers of the Openstack control plane can be communicated with each other through a K8S two-layer network.
Optionally, the CCM back end may be a micro service developed based on Client go, and may implement communication with a K8S message bus and an Openstack core component, and the CCM front end may be a user operation interface. The interface of the CCM rear end can be directly called by the front end interface, and then the CCM rear end is responsible for operating the Openstack and K8S interfaces, so that the virtual machine can be created, and Job can be started.
Alternatively, Job's container mirror may have all of the underlying dependent components of the ansable server fixed, such as python, open-ssh, etc. While task (task) scripts for cluster management may also be solidified into the Job container image. Job's entrypoint (entrypoint specifies the mirror's default entry command) is set to receive the participating Shell script. The parameters of the Shell script are all obtained from the environment variable env of the container. Different management processes can be performed depending on the acquired parameters: such as creating clusters, deleting clusters, scaling clusters, upgrading nodes in clusters, etc. Job may interact with the virtual machine via the SSH protocol.
Optionally, the virtual machine needs to be started according to a preset virtual machine image, and all software packages that the K8S cluster depends on when deployed may be solidified in the preset virtual machine image.
It can be understood that communication of a CCM, an Openstack container and a K8S message bus can be realized based on the Pod Network, and communication of a cluster deployment Job b and a Virtual machine in the K8S base can be realized based on a Virtual Local Area Network (vlan) technology, thereby completing creation of a container cluster.
It can be understood that the CCM can concurrently process requests, create multiple virtual machine clusters at the same time, and respectively pull up corresponding jobs, thereby ensuring the simultaneous management of multiple clusters. In a large-scale use scenario, the CCM can perform multi-copy deployment and elastic expansion and contraction. Job is a lightweight container, and is flexible to deploy and quick to start and stop. The method has important significance for enhancing Platform as a Service (PaaS) Platform user experience and ensuring the stability of the PaaS Platform.
According to the cluster management method provided by the invention, the cluster creation application instance can be started based on the first key parameter by acquiring the first key parameter for cluster creation, the dependent component of the idle server and the task script of the cluster management are solidified in the container mirror image corresponding to the cluster creation application instance, so that the cluster creation application instance can execute the cluster creation operation on the first virtual machine, the cluster creation application instance runs on the container arrangement engine in a working container form, the life cycle of the cluster creation application instance is the execution time length of one-time management command, the container corresponding to the cluster creation application instance can quit after the cluster creation operation is completed, the automation of the cluster creation management can be realized, and the cluster management efficiency can be improved.
Optionally, the first key parameter includes: the method comprises the steps that an IP address of a first virtual machine, a root password of the first virtual machine, a cluster version and a cluster-dependent container runtime type are set; the container arrangement engine is Kubernetes; the starting the cluster creation application instance based on the first key parameter comprises:
and starting the cluster creation application instance based on the first key parameter through communication with a service interface of Kubernetes.
Optionally, fig. 5 is a second flowchart of the cluster management method provided by the present invention, and as shown in fig. 5, the cluster management method may include: step 501 to step 506, wherein:
step 501, the CCM instantiates a virtual machine (under the same namespace), and the virtual machine is used as a node installed by K8S;
step 502, collecting all key parameters created by the K8S cluster by the CCM;
for example, the key parameters may include virtual machine IP, virtual machine root password, cluster K8S version, and K8S dependent container runtime type (docker or container).
Step 503, the CCM maintenance cluster creates a yacl file for Job;
alternatively, the key parameters collected in step 502 can be filled into the yaml file, and these key parameters are used as initialization environment variables for Job's startup.
Step 504, the CCM integrates api-server communication between the Client go and Openstack base K8S, and yaml is applied to pull up corresponding Job to perform cluster creation operation;
step 505, whether the CCM polls the Job to complete (complete) is used as a criterion for judging whether the process is executed successfully;
at step 506, after the cluster creation is completed, the CCM front-end needs to display the cluster is Ready (Ready).
Optionally, after the starting of the cluster creation application instance based on the first key parameter, the method further includes:
determining a cluster management task, wherein the cluster management task is any one of the following items: a cluster capacity expansion task, a cluster capacity reduction task, a cluster deletion task, a cluster upgrading task or a cluster rollback task;
acquiring a second key parameter for cluster management based on the cluster management task, wherein the second key parameter is used as an initialization environment variable for starting a target application instance, the target application instance is used for executing cluster management operation, and a dependent component of an idle server and a task script of the cluster management are solidified in a container mirror image corresponding to the target application instance;
and starting the target application instance based on the second key parameter, wherein the target application instance runs on the container arrangement engine in a work class container form.
Specifically, after a cluster is created, in order to implement cluster management functions such as cluster expansion, cluster contraction, cluster deletion, cluster upgrading or cluster rollback, a cluster management task may be determined, and then based on the cluster management task, a second key parameter for cluster management may be obtained, and then a target application instance may be started based on the second key parameter, a container mirror image corresponding to the target application instance is solidified with an ansable server dependent component and a cluster management task script, and then the target application instance may execute operations such as cluster expansion, cluster contraction, cluster deletion, cluster upgrading or cluster rollback, and the like, the target application instance operates on the container arrangement engine in a work-class container form, and after the cluster management operation is executed, a container corresponding to the target application instance may exit, and automation of various cluster management may be implemented.
It will be appreciated that the CCM has the capability to communicate with both Openstack core components and api-servers of the K8S base.
In one aspect, the CCM may complete management of the virtual machine by invoking an Openstack interface, such as creation, addition, deletion, and the like of a virtual machine node.
On the other hand, the CCM can communicate with the api-server of the K8S base to create other services Pod to accomplish specific functions. The management work of the K8S cluster on top of the virtual machine can be assumed by the service Pod. The service Pod is configured as an allowed server by solidifying the allowed task (task) in the mirror. The CCM may pass virtual machine node information (IP address, username password, etc.) to the ansable server container in the form of environment variable injection and pull the Pod. And executing the cluster management task according to the joined constraint after the Pod is started. The Pod has a significant lifetime, i.e. the lifetime is the time to execute a management command, so the Pod runs in Job style in the K8S base.
It can be understood that the cluster deployment logic of K8S is encapsulated in the Job b, the essential software installed in the K8S cluster is previously made into the virtual machine image in a preset manner, and the complex cluster management function can be realized by the cooperation of a plurality of components.
Optionally, before the obtaining, based on the cluster management task, a second key parameter for cluster management, the method further includes:
and under the condition that the cluster management task is the cluster capacity expansion task, creating a second virtual machine for capacity expansion.
It can be understood that, in order to implement cluster expansion, a second virtual machine for expansion may be created first, and then based on a cluster expansion task, a second key parameter for cluster expansion may be obtained, and then a target application instance may be started based on the second key parameter, a container mirror image corresponding to the target application instance is solidified with an allowed server dependent component and a cluster management task script, and then the target application instance may execute a cluster expansion operation, the target application instance operates on a container arrangement engine in a working container form, after the cluster expansion operation is executed, a container corresponding to the target application instance may exit, and automation of cluster expansion may be implemented.
Optionally, in a case that the cluster management task is the cluster extension task, the second key parameter includes: the method comprises the steps of setting a cluster version and a cluster-dependent container runtime type, wherein the cluster version comprises an IP address of a first virtual machine, a root password of the first virtual machine, an IP address of a second virtual machine, a root password of the second virtual machine, and the cluster runtime type.
Optionally, fig. 6 is a third schematic flowchart of a cluster management method provided by the present invention, and as shown in fig. 6, the cluster management method includes: step 601 to step 607, wherein:
step 601, creating a virtual machine for capacity expansion by the CCM;
step 602, collecting all key parameters of K8S cluster capacity expansion by CCM;
for example, all virtual machine IP, virtual machine root password, cluster K8S version, and K8S dependent container runtime type (docker or container) of the current cluster.
Step 603, collecting the key parameters of the virtual machine for capacity expansion by the CCM;
for example, virtual machine IP, virtual machine root password, cluster K8S version, K8S dependent container runtime type (docker or container).
Step 604, CCM maintains the yacl file of Job as cluster expansion;
alternatively, the key parameters collected in step 702 and step 703 can be written into a yaml file, and these parameters serve as initialization environment variables for Job startup.
Step 605, integrating the api-server communication of the Client go base K8S (or through sshpass) by the CCM, and pulling up the corresponding Job by using yaml to perform cluster capacity expansion operation;
step 606, CCM polls whether Job is complete or not as a basis for judging whether the process is executed successfully or not;
in step 607, after the cluster expansion is completed, the CCM front end may display the cluster Ready.
It will be appreciated that cluster minification is similar to cluster expansion, except that the flow needs to be reversed and the virtual machines deleted after Job complete.
It is understood that the cluster delete may be a pull of the cluster delete Job, which deletes the virtual machine after Job comelinee. (if the user has cleared the service, the virtual machine can also be deleted directly)
Optionally, after the starting of the cluster creation application instance based on the first key parameter, the method further includes:
displaying first information for indicating that a cluster is ready in case that the execution of the cluster creation application instance is determined to be completed;
or, in case that the execution of the target application instance is determined to be completed, displaying second information for indicating that the cluster is ready.
It can be understood that based on the Pod network, the communication among the CCM container, the Openstack container and the K8S message bus can be realized, and the automatic virtualized resource management and the Job startup can be realized; based on the vlan technology, the communication of Job and a virtual machine deployed by a cluster in a K8S base can be realized, and the management of a container cluster is completed; CCM can process request at the same time, manage multiple sets of virtual machine clusters, and support to pull up corresponding container cluster in parallel to manage Job. Ensuring the concurrent management of multiple clusters; in a large-scale use scene, the CCM supports multi-copy deployment, elastically expands and contracts the capacity, and ensures the stability of the platform; job deploys flexibly, starts and stops rapidly, can strengthen the cluster management experience.
According to the cluster management method provided by the invention, the cluster creation application instance can be started based on the first key parameter by acquiring the first key parameter for cluster creation, the dependent component of the idle server and the task script of the cluster management are solidified in the container mirror image corresponding to the cluster creation application instance, so that the cluster creation application instance can execute the cluster creation operation on the first virtual machine, the cluster creation application instance runs on the container arrangement engine in a working container form, the life cycle of the cluster creation application instance is the execution time length of one-time management command, the container corresponding to the cluster creation application instance can quit after the cluster creation operation is completed, the automation of the cluster creation management can be realized, and the cluster management efficiency can be improved.
The following describes the cluster management apparatus provided in the present invention, and the cluster management apparatus described below and the cluster management method described above may be referred to correspondingly.
Fig. 7 is a schematic structural diagram of a device for cluster management provided in the present invention, and as shown in fig. 7, the device includes: a creating module 701, an obtaining module 702 and a starting module 703, wherein:
a creating module 701, configured to create a first virtual machine, where the first virtual machine serves as an installation node of a cluster;
an obtaining module 702, configured to obtain a first key parameter for cluster creation, where the first key parameter is used as an initialization environment variable for starting a cluster creation application instance, the cluster creation application instance is used to execute a cluster creation operation on the first virtual machine, and a container mirror image corresponding to the cluster creation application instance is solidified with a dependent component of an idle server and a task script of cluster management;
a starting module 703, configured to start the cluster creation application instance based on the first key parameter, where the cluster creation application instance runs on a container arrangement engine in a work class container form.
According to the device for cluster management, the first key parameter used for cluster creation is obtained, the cluster creation application instance can be started based on the first key parameter, the dependent component of the idle server and the task script of the cluster management are solidified in the container mirror image corresponding to the cluster creation application instance, then the cluster creation application instance can execute cluster creation operation on the first virtual machine, the cluster creation application instance runs on the container arranging engine in a work container form, the life cycle of the cluster creation application instance is the execution time length of one-time management command, the container corresponding to the cluster creation application instance exits after the cluster creation operation is completed, automation of cluster creation management can be achieved, and efficiency of cluster management can be improved.
Fig. 8 is a schematic structural diagram of an electronic device provided in the present invention, and as shown in fig. 8, the electronic device may include: a processor (processor)810, a communication Interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication Interface 820 and the memory 830 communicate with each other via the communication bus 840. Processor 810 may invoke logical instructions in memory 830 to perform a method of cluster management, for example, the method comprising:
creating a first virtual machine, wherein the first virtual machine is used as an installation node of a cluster;
acquiring a first key parameter for cluster creation, wherein the first key parameter is used as an initialization environment variable for starting a cluster creation application instance, the cluster creation application instance is used for executing cluster creation operation on the first virtual machine, and a container mirror image corresponding to the cluster creation application instance is solidified with a dependent component of an addressable server and a task script of cluster management;
and starting the cluster creation application instance based on the first key parameter, wherein the cluster creation application instance runs on a container arrangement engine in a working class container form.
In addition, the logic instructions in the memory 830 may be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, the computer program product comprising a computer program, the computer program being storable on a non-transitory computer-readable storage medium, the computer program, when executed by a processor, being capable of executing the method of cluster management provided by the above methods, for example the method comprising:
creating a first virtual machine, wherein the first virtual machine is used as an installation node of a cluster;
acquiring a first key parameter for cluster creation, wherein the first key parameter is used as an initialization environment variable for starting a cluster creation application instance, the cluster creation application instance is used for executing cluster creation operation on the first virtual machine, and a container mirror image corresponding to the cluster creation application instance is solidified with a dependent component of an addressable server and a task script of cluster management;
and starting the cluster creation application instance based on the first key parameter, wherein the cluster creation application instance runs on a container arrangement engine in a working class container form.
In yet another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method for performing cluster management provided by the above methods, for example, the method comprising:
creating a first virtual machine, wherein the first virtual machine is used as an installation node of a cluster;
acquiring a first key parameter for cluster creation, wherein the first key parameter is used as an initialization environment variable for starting a cluster creation application instance, the cluster creation application instance is used for executing cluster creation operation on the first virtual machine, and a container mirror image corresponding to the cluster creation application instance is solidified with a dependent component of an idle server and a task script of cluster management;
and starting the cluster creation application instance based on the first key parameter, wherein the cluster creation application instance runs on a container arrangement engine in a work class container form.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method of cluster management, comprising:
creating a first virtual machine, wherein the first virtual machine is used as an installation node of a cluster;
acquiring a first key parameter for cluster creation, wherein the first key parameter is used as an initialization environment variable for starting a cluster creation application instance, the cluster creation application instance is used for executing cluster creation operation on the first virtual machine, and a container mirror image corresponding to the cluster creation application instance is solidified with a dependent component of an idle server and a task script of cluster management;
and starting the cluster creation application instance based on the first key parameter, wherein the cluster creation application instance runs on a container arrangement engine in a working class container form.
2. The method of cluster management according to claim 1, wherein the first key parameter comprises: the method comprises the steps that an IP address of a first virtual machine, a root password of the first virtual machine, a cluster version and a cluster-dependent container runtime type are set; the container arrangement engine is Kubernetes; the starting the cluster creation application instance based on the first key parameter comprises:
and starting the cluster creation application instance based on the first key parameter through communication with a service interface of Kubernetes.
3. The method for cluster management according to claim 1, further comprising, after said starting the cluster creation application instance based on the first key parameter:
determining a cluster management task, wherein the cluster management task is any one of the following items: a cluster capacity expansion task, a cluster capacity reduction task or a cluster deletion task;
acquiring a second key parameter for cluster management based on the cluster management task, wherein the second key parameter is used as an initialization environment variable for starting a target application instance, the target application instance is used for executing cluster management operation, and a dependent component of an idle server and a task script of the cluster management are solidified in a container mirror image corresponding to the target application instance;
and starting the target application instance based on the second key parameter, wherein the target application instance runs on the container arrangement engine in a work class container form.
4. The method for cluster management according to claim 3, further comprising, before the obtaining the second key parameter for cluster management based on the cluster management task:
and under the condition that the cluster management task is the cluster expansion task, creating a second virtual machine for expansion.
5. Method for cluster management according to claim 3 or 4, wherein in case the cluster management task is the cluster extension task, the second key parameter comprises: the method comprises the steps of setting a cluster version and a cluster-dependent container runtime type, wherein the cluster version comprises an IP address of a first virtual machine, a root password of the first virtual machine, an IP address of a second virtual machine, a root password of the second virtual machine, and the cluster runtime type.
6. The method for cluster management according to claim 3, further comprising, after said starting the cluster creation application instance based on the first key parameter:
displaying first information for indicating that a cluster is ready in case that the execution of the cluster creation application instance is determined to be completed;
or, in case that the execution of the target application instance is determined to be completed, displaying second information for indicating that the cluster is ready.
7. An apparatus for cluster management, comprising:
the system comprises a creating module, a sending module and a processing module, wherein the creating module is used for creating a first virtual machine which is used as an installation node of a cluster;
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a first key parameter for cluster creation, the first key parameter is used as an initialization environment variable for starting a cluster creation application instance, the cluster creation application instance is used for executing cluster creation operation on a first virtual machine, and a container mirror image corresponding to the cluster creation application instance is solidified with a dependent component of an idle server and a task script of cluster management;
and the starting module is used for starting the cluster creation application instance based on the first key parameter, and the cluster creation application instance runs on the container arrangement engine in a working container form.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of cluster management according to any of claims 1 to 6 when executing the program.
9. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the method of cluster management according to any of claims 1 to 6.
10. A computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements a method for cluster management as claimed in any one of claims 1 to 6.
CN202210661922.1A 2022-06-13 2022-06-13 Cluster management method and device, electronic equipment and storage medium Pending CN115113975A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210661922.1A CN115113975A (en) 2022-06-13 2022-06-13 Cluster management method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210661922.1A CN115113975A (en) 2022-06-13 2022-06-13 Cluster management method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115113975A true CN115113975A (en) 2022-09-27

Family

ID=83329376

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210661922.1A Pending CN115113975A (en) 2022-06-13 2022-06-13 Cluster management method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115113975A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116541133A (en) * 2023-07-05 2023-08-04 苏州浪潮智能科技有限公司 Nanotube method for container application, device and electronic equipment thereof
CN118094572A (en) * 2024-04-26 2024-05-28 中国信息通信研究院 OPENSTACK-based vulnerability discovery method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116541133A (en) * 2023-07-05 2023-08-04 苏州浪潮智能科技有限公司 Nanotube method for container application, device and electronic equipment thereof
CN116541133B (en) * 2023-07-05 2023-09-15 苏州浪潮智能科技有限公司 Nanotube method for container application, device and electronic equipment thereof
CN118094572A (en) * 2024-04-26 2024-05-28 中国信息通信研究院 OPENSTACK-based vulnerability discovery method

Similar Documents

Publication Publication Date Title
CN108809722B (en) Method, device and storage medium for deploying Kubernetes cluster
US9661071B2 (en) Apparatus, systems and methods for deployment and management of distributed computing systems and applications
WO2017045424A1 (en) Application program deployment system and deployment method
CN110752947A (en) K8s cluster deployment method and device, and deployment platform
JP5401922B2 (en) Virtual system control program, method and apparatus
CN115113975A (en) Cluster management method and device, electronic equipment and storage medium
US20210389970A1 (en) Vnf lifecycle management method and apparatus
CN110569111A (en) virtual machine implementation method, device and system based on traditional container
CN110138577B (en) Cluster creation method, first server and readable storage medium
KR102674017B1 (en) Network resource management method, system, network device and readable storage medium
CN111835679B (en) Tenant resource management method and device under multi-tenant scene
EP4057139A1 (en) Pod deployment method and device
CN109347716B (en) Instantiation method and device of consumer VNF
CN111966462A (en) Hybrid cloud management system
CN111522622A (en) K8S quick starting method based on cloud platform
CN109600439B (en) PaaS platform and deployment method thereof based on microservice
CN109347661B (en) Instantiation method and device of consumer VNF
CN114661436A (en) Cloud-native job scheduling method, system and storage medium
CN112698930B (en) Method, device, equipment and medium for obtaining server identification
Tang et al. Application centric lifecycle framework in cloud
CN109491762B (en) Container state control method and device, storage medium and electronic equipment
CN113326098B (en) Cloud management platform supporting KVM virtualization and container virtualization
CN115964128A (en) Heterogeneous GPU resource management and scheduling method and system
JP2013513838A (en) Method and system for computer architecture plug and play support
CN115202820A (en) Method, device and equipment for creating Pod unit and storage medium

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