CN110413288B - Application deployment method, device, server and storage medium - Google Patents

Application deployment method, device, server and storage medium Download PDF

Info

Publication number
CN110413288B
CN110413288B CN201910703051.3A CN201910703051A CN110413288B CN 110413288 B CN110413288 B CN 110413288B CN 201910703051 A CN201910703051 A CN 201910703051A CN 110413288 B CN110413288 B CN 110413288B
Authority
CN
China
Prior art keywords
target service
application
service component
component
server
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.)
Active
Application number
CN201910703051.3A
Other languages
Chinese (zh)
Other versions
CN110413288A (en
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.)
New H3C Big Data Technologies Co Ltd
Original Assignee
New H3C Big Data Technologies 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 New H3C Big Data Technologies Co Ltd filed Critical New H3C Big Data Technologies Co Ltd
Priority to CN201910703051.3A priority Critical patent/CN110413288B/en
Publication of CN110413288A publication Critical patent/CN110413288A/en
Application granted granted Critical
Publication of CN110413288B publication Critical patent/CN110413288B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • 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/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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the invention relates to the technical field of big data, in particular to an application deployment method, an application deployment device, a server and a storage medium, wherein the method comprises the following steps: acquiring a target service component required by an application to be deployed; generating a parameter configuration page of the target service component based on page information of the target service component stored in advance; acquiring configuration parameters of the target service component based on the parameter configuration page; acquiring built-in attributes of a target service component; and calling a preset function provided by the Kubernetes cluster according to the built-in attribute and the configuration parameter to start the target service component, so that the Kubernetes cluster deploys the application to be deployed. The invention realizes one-key deployment and improves the efficiency of application deployment.

Description

Application deployment method, device, server and storage medium
Technical Field
The embodiment of the invention relates to the technical field of big data, in particular to an application deployment method, an application deployment device, a server and a storage medium.
Background
In the prior art, when an application is deployed, corresponding servers and resources are usually required to be manually created, a dependent environment for application operation is built, resources such as memory, CPU, storage space and the like which are required to be occupied by the application are estimated, the method has strong dependence on the environment of a physical server, the application deployment efficiency is low, and when the physical server is down accidentally, the application deployed on the physical server is difficult to migrate.
Disclosure of Invention
The embodiment of the invention aims to provide an application deployment method, an application deployment device, a server and a storage medium, which are used for solving the problem of low application deployment efficiency.
In order to achieve the above object, the technical scheme adopted by the embodiment of the invention is as follows:
in a first aspect, an embodiment of the present invention provides an application deployment method, applied to a server, where the server communicates with a Kubernetes cluster, the method including: acquiring a target service component required by an application to be deployed; generating a parameter configuration page of the target service component based on the page information of the target service component; acquiring configuration parameters of the target service component based on the parameter configuration page; acquiring built-in attributes of a target service component; and calling a preset function provided by the Kubernetes cluster according to the built-in attribute and the configuration parameter to start the target service component, so that the Kubernetes cluster deploys the application to be deployed.
In a second aspect, an embodiment of the present invention further provides an application deployment device, where the application deployment device is applied to a server, and the server communicates with a Kubernetes cluster, and the device includes a component acquisition module, a page generation module, a parameter acquisition module, a built-in attribute acquisition module, and a deployment module. The component acquisition module is used for acquiring a target service component required by the application to be deployed; the page generation module is used for generating a parameter configuration page of the target service component based on page information of the target service component stored in advance; the parameter acquisition module is used for acquiring configuration parameters of the target service component based on the parameter configuration page; the built-in attribute acquisition module is used for acquiring built-in attributes of the target service component; the deployment module is used for calling a preset function provided by the Kubernetes cluster according to the built-in attribute and the configuration parameter to start the target service component, so that the Kubernetes cluster deploys the application to be deployed.
In a third aspect, an embodiment of the present invention further provides a server, where the server includes: one or more processors; and a memory for storing one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the application deployment method described above.
In a fourth aspect, an embodiment of the present invention further provides a computer readable storage medium having stored thereon a computer program, which when executed by a processor, implements the above-mentioned application deployment method.
Compared with the prior art, when the user deploys the application based on the Kubernetes cluster, the system generates a parameter configuration page for the target service component when determining the target service component of the application to be deployed; and then, acquiring configuration parameters input by a user on a parameter configuration page and built-in attributes of the target service component, and calling a preset function provided by the Kubernetes cluster according to the built-in attributes and the configuration parameters to start the target service component, so that the Kubernetes cluster deploys the application to be deployed. Compared with the prior art, the embodiment of the invention only needs the user to input the configuration parameters of the target service component on the parameter configuration page, and the deployment of the application to be deployed is automatically completed according to the configuration parameters of the target service component, so that one-key deployment is realized, and the efficiency of application deployment is improved.
In order to make the above objects, features and advantages of the present invention more comprehensible, embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 shows a software architecture schematic diagram of an application scenario provided by an embodiment of the present invention.
Fig. 2 shows a block schematic diagram of a server according to an embodiment of the present invention.
Fig. 3 shows a flowchart of an application deployment method provided by an embodiment of the present invention.
Fig. 4 is a flow chart of sub-steps of one implementation of step S101 shown in fig. 3.
Fig. 5 is a flow chart of substeps of another implementation of step S101 shown in fig. 3.
Fig. 6 is a sub-step flowchart of step S105 shown in fig. 3.
Fig. 7 shows a diagram of an internal call relationship of an interface function according to an embodiment of the present invention.
FIG. 8 illustrates an example diagram of a web application after deployment provided by an embodiment of the invention.
Fig. 9 shows a block schematic diagram of an application deployment apparatus according to an embodiment of the present invention.
Icon: 10-a server; 101-memory; 102-a communication interface; 103-a processor; 104-a bus; 200-an application deployment device; 201-a component acquisition module; 202-a page generation module; 203, a parameter acquisition module; 204-a built-in attribute acquisition module; 205-deployment module.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. The components of the embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the invention, as presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be made by a person skilled in the art without making any inventive effort, are intended to be within the scope of the present invention.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. Meanwhile, in the description of the present invention, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance.
In the technical field of big data, as the number of applications to be deployed increases, the problems of incompatibility and difficult migration caused by the dependence of a physical server environment are prominent, the deployment efficiency is greatly reduced, the reliability is reduced, in order to reduce the strong dependence on the physical server environment during application deployment, the applications are usually deployed on a virtual machine, the virtual machine is formed by installing a required operating system on the virtual hardware resource based on a hardware resource virtualized by an intermediate software layer between a physical server and an operating system, and therefore, the operating system environment required by the deployment of the applications can be created based on different physical server environments, and the application is deployed based on the operating system environment, so that the dependence of the application deployment on the physical server environment is reduced.
Although the virtual machine reduces the dependence of application deployment on the physical server environment, in practical application, the environment developed has larger environmental difference from the actual operation and maintenance environment, the development environment and the operation and maintenance environment cannot reach good bridging, and when the online application is deployed, the problem that the environment is incompatible still needs to be treated in time.
In order to further improve the application deployment efficiency and realize one-key deployment, the embodiment of the invention carries out application deployment based on a Kubernetes cluster, which is an open source and is used for managing containerized applications on a plurality of hosts in a cloud platform, the purpose of the Kubernetes cluster is to enable the application deploying containerization to be simple and efficient, and the Kubernetes cluster provides a mechanism for application deployment, planning, updating and maintenance. The embodiment of the invention provides a parameter configuration page, and after a user inputs configuration parameters on the parameter configuration page, a preset function provided by a Kubernetes cluster is called according to the configuration parameters to complete the deployment of an application to be deployed, which will be described in detail below.
Referring to fig. 1, fig. 1 shows a software architecture schematic diagram of an application scenario provided by an embodiment of the present invention. In fig. 1, the bottom layer is a storage controller running a Linux operating system, and is used for managing a hardware storage device, a clusteris cluster file system is deployed on the storage device through the Linux operating system running on the storage controller, and the storage controller is mainly used for storing data required by a container group pod for mounting, wherein the pod is a minimum/simplest basic unit for creating or deploying a Kubernetes cluster, and one pod represents a running process on the Kubernetes cluster. A pod encapsulates an application container or containers that share storage resources, networks, namespaces, are uniformly arranged and scheduled, and run in a shared context, storage resources, a separate network IP, and policy options that govern the way the container operates. The container is a portable and lightweight operating system level virtualization technology, and can be conveniently operated anywhere by mirroring the running environment of self-contained software. Kubernetes clusters are deployed based on clusteries cluster file systems, and application deployment systems are implemented based on Kubernetes clusters. Kubernetes clusters are divided into 2 namespaces: the system comprises an embedded service space and an application service space, wherein the embedded service space is mainly used for starting the normal running services of a database, a service agent tool, a mirror image library and other support systems on which an application deployment system depends; the application service space provides service support for applications deployed by a user through an application deployment system, the application deployment device belongs to a functional module of the application deployment system, the application deployment system also comprises a monitoring module, a mirror image management module and other functional modules, the monitoring module is mainly used for checking and early warning the health state of the deployed applications and drawing, presenting and early warning the use condition of application resources, and the mirror image management module is used for managing the mirror image corresponding to each service component.
Referring to fig. 2, fig. 2 is a block diagram of a server 10 according to an embodiment of the present invention, where the server 10 includes a memory 101, a communication interface 102, a processor 103, and a bus 104, where the memory 101, the communication interface 102, and the processor 103 are connected by the bus 104, and the processor 103 is configured to execute executable modules stored in the memory 101, such as computer programs.
The memory 101 may include a high-speed random access memory (RAM: random Access Memory), and may further include a non-volatile memory (non-volatile memory), such as at least one disk memory. The communication connection between the server 10 and the external storage device is achieved through at least one communication interface 102 (which may be wired or wireless).
Bus 104 may be an ISA bus, a PCI bus, an EISA bus, or the like. Only one double arrow is shown in fig. 2, but not only one bus or one type of bus.
The memory 101 is configured to store a program, and the processor 103 executes the program after receiving an execution instruction to implement the application deployment method disclosed in the above embodiment of the present invention.
In this embodiment, the server 10 communicates with the Kubernetes cluster at least includes the following two cases: (1) The server 10 is a hardware device independent of the Kubernetes cluster, at this time, the server 10 is in communication connection with the Kubernetes cluster, and after acquiring the built-in attribute and the configuration parameter, the server 10 invokes a preset function provided by the Kubernetes cluster to start the target service component, so that the Kubernetes cluster deploys the application to be deployed. (2) The deployment program corresponding to the application deployment method disclosed in the above embodiment also operates on the Kubernetes cluster, that is, the server 10 executing the deployment program is a server in the Kubernetes cluster, at this time, the server 10 executing the deployment program communicates with the Kubernetes cluster, and after obtaining the built-in attribute and the configuration parameter, the server 10 invokes a preset function provided by the Kubernetes cluster to start the target service component, so that the Kubernetes cluster deploys the application to be deployed. Referring to fig. 3, fig. 3 shows a flowchart of an application deployment method provided by an embodiment of the present invention, applied to a server 10, where the application deployment method includes the following steps:
step S101, obtaining a target service component required by an application to be deployed.
In this embodiment, an application may be divided into a plurality of services, where a service may be described by using a service component, each service may correspond to a service component, where the service component defines a configuration parameter item and a built-in attribute item of the corresponding service, where the configuration parameter item may be a parameter that needs to be configured by an external operating environment on which the service component such as a memory, a CPU, an environment variable depends, and a value of the configuration parameter item may be input by a user on a parameter configuration page; the built-in attribute items may be the image file name, the starting parameter, and other attributes related to the program on which the service component depends, and the corresponding values, for example, the built-in attribute item of the service component a includes the image file name, where the values of the image file name are: a_image, according to the image file name, a program which needs to be executed by the running service component A can be found. The built-in attribute item may be a database stored in advance in the server 10. One application to be deployed may require one or more target service components, and when each target service component is started by calling a preset function provided by the Kubernetes cluster, deployment of the application to be deployed is completed, for example, one web application requires three target service components: the web application deployment is completed after the three target service components are started by calling a preset function provided by the Kubernetes cluster.
In this embodiment, first, the user may issue an application deployment instruction on the deployment interface to determine the target service component, and then the server 10 acquires the target service component again, where there are at least two specific implementations to determine the target service component, and the substeps S1011-S1012 correspond to one way to determine the target service component, and the substeps S1013-S1014 correspond to another way to determine the target service component.
Referring to fig. 4, fig. 4 is a flowchart of sub-steps of an implementation of step S101 shown in fig. 3, where step S101 may include the following sub-steps:
substep S1011, receiving an application deployment instruction, wherein the application deployment instruction is for instructing the server to determine a target service template from the at least one service template.
In this embodiment, in order to simplify the user operation, a plurality of commonly used service templates are stored in the server 10 in advance, each service template includes a plurality of service components, and the user can select all the service components in the service template by selecting the service template, so that the user is prevented from selecting the required service components one by one on the deployment interface, thereby simplifying the user operation and enhancing the usability.
Sub-step S1012, the service components included in the target service template are determined as target service components required for the application to be deployed.
In this embodiment, the user may select all target service components in the target service template by selecting the target service template, so that the required target service components may be selected by implementing one operation, thereby further simplifying the user operation.
In this embodiment, when the pre-stored service template does not meet the requirement of the application to be deployed, in order to facilitate the user to quickly determine the required target service components, components other than the service components in the target service template may be selected for the application to be deployed, so as to enhance flexibility of application deployment, and substeps S1013-S1014 may achieve this objective.
Referring to fig. 5, fig. 5 is a flowchart of the substeps of another implementation of step S101 shown in fig. 3, where step S101 may further include the substeps of:
substep S1013, receiving an application deployment instruction, where the application deployment instruction is configured to instruct the server to determine a target service template from at least one service template, and to determine a self-selected service component from at least one alternative service component.
In this embodiment, the deployment interface may display, in addition to the service template for the user to select, an alternative service component for the user to select, where page information of the alternative service component is stored in advance in the server 10.
Substep S1014 determines the service components included in the target service template and the discretionary service components as target service components required for the application to be deployed.
It should be noted that, the user may also generate a custom template according to the template generation rule and the requirement of the actual scene, so as to further increase flexibility of application deployment.
It should be noted that, instead of using the target service template, the user may directly determine the self-selected service component from the candidate service components, and determine the self-selected service component as the target service component required by the application to be deployed.
Step S102, generating a parameter configuration page of the target service component based on the pre-stored page information of the target service component.
In this embodiment, in order to facilitate the user to input the configuration parameters more conveniently, the server 10 stores the page information of the target service component in advance, and a corresponding parameter configuration page may be generated according to the page information of the target service component, so that the user may input the configuration parameters of the target service component on the parameter configuration page.
Step S103, acquiring configuration parameters of the target service component based on the parameter configuration page.
In this embodiment, for example, the configuration parameter item displaying mysql on the parameter configuration page may be: the user name, the password, the memory, the occupation time of the CPU and the deployment mode, the user can input configuration parameters corresponding to the configuration parameter items on the parameter configuration page, and the user name is as follows: test, password is: 123456, 1GB memory, 10ms CPU occupation time, and single-machine deployment mode.
Step S104, acquiring built-in attributes of the target service component.
Step S105, calling a preset function provided by the Kubernetes cluster according to the built-in attribute and the configuration parameter to start the target service component, so that the Kubernetes cluster deploys the application to be deployed.
In this embodiment, the deployment of the application to be deployed by the Kubernetes cluster is implemented by each target service component required for starting the application to be deployed, so that each target service component may be started according to a user requirement, and therefore, a preset calling relationship is required to be set between a plurality of target service components according to the configuration parameters and the built-in parameters of the target service component, and in order to enable the application to be deployed to be normally used, the corresponding target service components must be started in sequence according to the preset calling relationship, and in order to deploy the application to be deployed on the Kubernetes cluster, so that the application to be deployed operates more stably and more efficiently, and the target service component is started by calling a preset function provided by the Kubernetes cluster.
In this embodiment, in order to achieve low coupling with the Kubernetes cluster, interaction between the Kubernetes cluster and a preset function provided by the Kubernetes cluster is simplified as much as possible, maintainability is improved, and first, configuration parameters and built-in attributes of each target service component are packaged to obtain a component entity class corresponding to each target service component. And then, according to the interrelation between the target service components, packaging the component entity class of the target service components to obtain the application entity class of the application to be deployed. And finally, analyzing the application entity class, and calling a preset function provided by the Kubernetes cluster according to the interrelationship among the target service components to start each target service component.
Referring to fig. 6, fig. 6 is a flowchart of sub-steps of step S105 shown in fig. 3, and step S105 may include the following sub-steps:
in the substep S1051, the configuration parameters and the built-in attribute of each target service component are encapsulated, so as to obtain the component entity class of each target service component.
In this embodiment, the component entity class may be an instance of an abstract structure including a configuration parameter item and a built-in attribute item of a service component, and an operation method for operating the configuration parameter item and an operation method for operating the built-in attribute item. Taking java implementation as an example, the abstract structure may be a component class, and the component class is instantiated to obtain a component entity class, and a simple instantiation process may be: an object of the component class is created, and then assignment is carried out on the corresponding attribute items in the object according to the configuration parameters and the built-in attributes. It should be noted that, in the actual application scenario, the development language used may be c++, python, etc., which is not predetermined to the specific implementation language, and the process of instantiating the component class may not only include assignment, but also include addition and implementation of some methods, etc.
In the substep S1052, the component entity class of each target service component is encapsulated according to the interrelation between the target service components, so as to obtain the application entity class of the application to be deployed.
In this embodiment, the specific packaging process of the application entity class is similar to the packaging process of the component entity class, except that the abstract structure used is not the component class, but an application class including the interrelationship between the target service components, and the application entity class of the application to be deployed is obtained after the application class is instantiated. The application entity class includes the interrelationships between component entity classes of the target service components required by the application to be deployed and the target service components.
In the substep S1053, a preset function provided by the Kubernetes cluster is called according to the application entity class to start each target service component.
As a specific embodiment, this can be achieved by:
first, the application entity class is analyzed, and the starting sequence of each target service component is determined according to the interrelationship between the target service components.
In this embodiment, the interrelationship between the target service components may be a dependency relationship between two target service components in the target service components, for example, the web front-end component depends on the redis component, and thus, the redis component is started before the web front-end component.
Next, the preset functions provided by the Kubernetes cluster required to launch each target service component are determined.
And finally, sequentially calling corresponding preset functions to start the corresponding target service components according to the starting sequence of each target service component.
It should be noted that, as a specific implementation manner, the implementation step of the substep S1044 may be encapsulated in an interface function, where input parameters of the interface function are application entity classes, and the interface function may: analyzing the application entity class, and determining the starting sequence of each target service component according to the interrelation between the target service components; determining a preset function provided by a Kubernetes cluster required for starting each target service component; and sequentially calling corresponding preset functions to start the corresponding target service components according to the starting sequence of each target service component.
Referring to fig. 7, fig. 7 shows a diagram of an internal call relationship of an interface function according to an embodiment of the present invention. Since all target service components eventually run in the form of a pod, and pod-related data needs to be persisted, a pod can have multiple copies in view of reliability. When the interface function is internally implemented, a corresponding storage space is first prepared for the target service component, and then other resources required for pod generation are generated based on the storage space. In fig. 7, a storage module provides a storage space for a pod, deploys a cluster file system (e.g., a cluster file system) based on the storage module, and is used for managing the space provided by the storage module and providing an access interface for the outside, an interface function firstly calls the access interface provided by the cluster file system, prepares the space required by the pod, and then calls an interface function (also referred to as a K8s api) provided by a Kubernetes cluster to create resources required by the pod, including: creating a persistent volume pv (persistent volume, pv) and a persistent volume declaration pvc (persistent volume claim, pvc) based on the prepared storage space, the pv providing storage resources for the pvc, the pvc being a request for storage, the pvc requesting specific storage resource size and storage access mode from the pv without concern for specific storage resources, i.e. implementation details of storage access, the pvc requiring binding to the pv to request the required storage resources from the bound pv; creating a statefulset controller, wherein the statefulset controller is a stateful controller in a Kubernetes cluster, so that the name of each copy of a pod is unchanged in the whole life cycle, and the statefulset controller can ensure that the copies are started, updated or deleted according to a fixed sequence; creating a service (service), wherein the service defines a mode of accessing a group of specific pod by the outside, provides load balancing for the pod, has own IP and port, and provides service to the outside through the IP and port; creating an ingress proxy that can provide services with uniform resource locators URLs (Uniform Resource Locator, URLs) for external access to the cluster, load balancing, secure socket layer SSL (Secure Sockets Layer, SSL) termination, hypertext transfer protocol HTTP (HyperText Transfer Protocol, HTTP) routing, etc.; creating a pod, adding the containers into the pod, wherein each container corresponds to a mirror image, the containers run on a volume basis (volume), and the volume provides storage resources required for the running of the containers through pvc.
Referring to fig. 8, fig. 8 shows an exemplary diagram of a web application after deployment according to an embodiment of the present invention. In FIG. 8, the web application includes three target components: the web front end target component, the redistarget component and the mysql target component are mutually backed up by two pod: the copies of pod1 and pod1, there are two pods corresponding to one service 1, the redis database target component and the mysql database target component, each corresponding to one service, providing external services, which provide master-slave services to the outside respectively, the redis target component has a master container set 2 and a slave container set 2, corresponding to the master service 2 and the slave service 2 respectively, the mysql target component has a master container set 3 and a slave container set 3, corresponding to the master service 3 and the slave service 3 respectively, the web application provides application services to the outside in URL form through the ingress proxy, for example, the user can pass throughhttp://ip:port/ test/Accessing a service provided by the web application. These three target components are all ultimately running and providing web services based on the storage space provided by the clusterifs cluster file system.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
firstly, providing a parameter configuration page for a user to input configuration parameters, and automatically completing the deployment of the application without the need of the user to operate again after the configuration parameters of the user are obtained, so that one-key deployment is realized, and the efficiency of application deployment is greatly improved.
And secondly, the service template is used, so that the user operation is simplified, and the application deployment efficiency is further improved.
And thirdly, the user can customize the service template, so that the flexibility of application deployment is improved.
Finally, the operation of calling the preset function provided by the Kubernetes cluster is uniformly packaged in the same interface function, so that low coupling with the Kubernetes cluster is realized, software development is simplified, and software maintenance cost is reduced.
Referring to fig. 9, fig. 9 is a block diagram of an application deployment apparatus 200 according to an embodiment of the invention. The application deployment device 200 comprises at least one software functional module which may be stored in the memory 101 in the form of software or firmware (firmware) or cured in an Operating System (OS) of the server 10. The application deployment device 200 includes a component acquisition module 201, a page generation module 202, a parameter acquisition module 203, a built-in attribute acquisition module 204, and a deployment module 205.
The component obtaining module 201 is configured to obtain a target service component required by an application to be deployed.
In this embodiment, the server 10 stores at least one service template in advance, where each service template includes at least one service component, and as a specific implementation, the component obtaining module 201 is specifically configured to: receiving an application deployment instruction, wherein the application deployment instruction is used for instructing a server to determine a target service template from at least one service template; the service components included in the target service template are determined to be target service components required by the application to be deployed.
In this embodiment, the server 10 stores at least one service template and at least one alternative service component in advance, where each service template includes at least one service component, and as another specific implementation, the component obtaining module 201 is specifically further configured to: receiving an application deployment instruction, wherein the application deployment instruction is used for instructing a server to determine a target service template from at least one service template and determine a self-selected service component from at least one alternative service component; and determining the service components included in the target service template and the self-selected service components as target service components required by the application to be deployed.
The page generation module 202 is configured to generate a parameter configuration page of the target service component based on the pre-stored page information of the target service component.
The parameter obtaining module 203 is configured to obtain the configuration parameters of the target service component based on the parameter configuration page.
The built-in attribute obtaining module 204 is configured to obtain built-in attributes of the target service component.
The deployment module 205 is configured to invoke a preset function provided by the Kubernetes cluster according to the built-in attribute and the configuration parameter to start the target service component, so that the Kubernetes cluster deploys the application to be deployed.
In this embodiment, the target service components are multiple, and the deployment module 205 is specifically configured to: packaging configuration parameters and built-in attributes of each target service component to obtain component entity classes of each target service component; packaging the component entity class of the target service component according to the interrelation between the target service components to obtain an application entity class of the application to be deployed; and calling a preset function provided by the Kubernetes cluster according to the application entity class to start each target service component.
In this embodiment, the deployment module 205 executes a manner of calling a preset function provided by the Kubernetes cluster according to the application entity class to enable the Kubernetes cluster to deploy the application to be deployed, including: analyzing the application entity class, and determining the starting sequence of each target service component according to the interrelation between the target service components; determining a preset function provided by a Kubernetes cluster required for starting each target service component; and calling a corresponding preset function to start the corresponding target service assembly according to the starting sequence of each target service assembly.
It will be clear to those skilled in the art that, for convenience and brevity of description, the specific working process of the application deployment device 200 described above may refer to the corresponding process in the foregoing method embodiment, which is not repeated herein.
The embodiment of the present invention also discloses a computer readable storage medium, on which a computer program is stored, which when executed by the processor 103 implements the application deployment method disclosed in the previous embodiment of the present invention.
In summary, the embodiments of the present invention provide an application deployment method, an apparatus, a server, and a storage medium, which are applied to a server, where the server communicates with a Kubernetes cluster, and the method includes: acquiring a target service component required by an application to be deployed; the page information of the target service component is stored in the server in advance; generating a parameter configuration page of the target service component according to the page information of the target service component; acquiring configuration parameters of the target service component from the parameter configuration page; and calling a preset function provided by the Kubernetes cluster according to the configuration parameters so that the Kubernetes cluster deploys the application to be deployed. Compared with the prior art, the embodiment of the invention only needs the user to input the configuration parameters of the target service component on the parameter configuration page, and the deployment of the application to be deployed is automatically completed according to the configuration parameters of the target service component, so that one-key deployment is realized, and the efficiency of application deployment is improved.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention. It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.

Claims (8)

1. An application deployment method, applied to a server, the server being in communication with a Kubernetes cluster, the server having pre-stored at least one service template, each service template comprising at least one service component, the method comprising:
acquiring a target service component required by an application to be deployed; the step of obtaining the target service components required by the application to be deployed comprises the following steps:
receiving an application deployment instruction, wherein the application deployment instruction is used for instructing the server to determine a target service template from the at least one service template;
determining a service component included in the target service template as the target service component required by the application to be deployed;
generating a parameter configuration page of the target service component based on the pre-stored page information of the target service component;
acquiring configuration parameters of the target service component based on the parameter configuration page;
acquiring built-in attributes of the target service component;
and calling a preset function provided by the Kubernetes cluster according to the built-in attribute and the configuration parameter to start the target service component, so that the Kubernetes cluster deploys the application to be deployed.
2. The application deployment method according to claim 1, wherein the server stores at least one alternative service component in advance, and the step of acquiring a target service component required for the application to be deployed includes:
receiving an application deployment instruction, wherein the application deployment instruction is used for instructing the server to determine a target service template from the at least one service template and determine a self-selected service component from the at least one alternative service component;
and determining the service components included in the target service template and the self-selected service components as the target service components required by the application to be deployed.
3. The application deployment method according to claim 1, wherein when the target service component is plural, the step of calling a preset function provided by the Kubernetes cluster according to the built-in attribute and the configuration parameter to start the target service component includes:
packaging the configuration parameters and the built-in attributes of each target service component to obtain a component entity class of each target service component;
packaging the component entity class of each target service component according to the interrelation among the target service components to obtain the application entity class of the application to be deployed;
and calling a preset function provided by the Kubernetes cluster according to the application entity class to start each target service component.
4. The application deployment method according to claim 3, wherein the step of calling a preset function provided by the Kubernetes cluster according to the application entity class to start each target service component comprises:
analyzing the application entity class, and determining the starting sequence of each target service component according to the interrelation between the target service components;
determining a preset function provided by the Kubernetes cluster required for starting each target service component;
and sequentially calling corresponding preset functions to start the corresponding target service components according to the starting sequence of each target service component.
5. An application deployment apparatus for use with a server in communication with a Kubernetes cluster, the server having pre-stored at least one service template, each service template comprising at least one service component, the apparatus comprising:
the component acquisition module is used for acquiring a target service component required by the application to be deployed; the component acquisition module is specifically configured to:
receiving an application deployment instruction, wherein the application deployment instruction is used for instructing the server to determine a target service template from the at least one service template;
determining a service component included in the target service template as the target service component required by the application to be deployed;
the page generation module is used for generating a parameter configuration page of the target service component based on the pre-stored page information of the target service component;
the parameter acquisition module is used for acquiring the configuration parameters of the target service component based on the parameter configuration page;
the built-in attribute acquisition module is used for acquiring built-in attributes of the target service component;
and the deployment module is used for calling a preset function provided by the Kubernetes cluster according to the built-in attribute and the configuration parameter to start the target service component, so that the Kubernetes cluster deploys the application to be deployed.
6. The application deployment apparatus according to claim 5, wherein the server has at least one alternative service component stored in advance, and the component obtaining module is specifically configured to:
receiving an application deployment instruction, wherein the application deployment instruction is used for instructing the server to determine a target service template from the at least one service template and determine a self-selected service component from the at least one alternative service component;
and determining the service components included in the target service template and the self-selected service components as the target service components required by the application to be deployed.
7. A server, the server comprising:
one or more processors;
a memory for storing one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-4.
8. A computer readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, implements the method according to any of claims 1-4.
CN201910703051.3A 2019-07-31 2019-07-31 Application deployment method, device, server and storage medium Active CN110413288B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910703051.3A CN110413288B (en) 2019-07-31 2019-07-31 Application deployment method, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910703051.3A CN110413288B (en) 2019-07-31 2019-07-31 Application deployment method, device, server and storage medium

Publications (2)

Publication Number Publication Date
CN110413288A CN110413288A (en) 2019-11-05
CN110413288B true CN110413288B (en) 2023-05-09

Family

ID=68364774

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910703051.3A Active CN110413288B (en) 2019-07-31 2019-07-31 Application deployment method, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN110413288B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111158709A (en) * 2019-12-29 2020-05-15 北京浪潮数据技术有限公司 Cluster deployment method, device and equipment and computer readable storage medium
CN111221593A (en) * 2019-12-31 2020-06-02 五八有限公司 Dynamic loading method and device
CN111277460B (en) * 2020-01-17 2022-02-25 江苏满运软件科技有限公司 ZooKeeper containerization control method and device, storage medium and electronic equipment
CN111399983B (en) * 2020-03-18 2024-05-14 北京达佳互联信息技术有限公司 Scheduling method and device based on container scheduling service
CN113676501A (en) * 2020-05-13 2021-11-19 北京金山云网络技术有限公司 Application deployment method and device based on Kubernetes cluster and electronic equipment
CN111666155A (en) * 2020-06-02 2020-09-15 中国建设银行股份有限公司 Resource configuration file management method, device, equipment and medium
CN111897539B (en) * 2020-07-20 2024-03-29 国云科技股份有限公司 Method and device for deploying application according to service roles
CN111984270A (en) * 2020-08-20 2020-11-24 第四范式(北京)技术有限公司 Application deployment method and system
CN112162753A (en) * 2020-09-28 2021-01-01 腾讯科技(深圳)有限公司 Software deployment method and device, computer equipment and storage medium
CN112764753B (en) * 2020-12-31 2024-04-12 北京知因智慧科技有限公司 Project deployment method and device, electronic equipment and storage medium
CN114253557B (en) * 2022-03-01 2022-05-20 苏州浪潮智能科技有限公司 Cloud platform application deployment method and device, electronic equipment and storage medium
CN115357258B (en) * 2022-10-24 2022-12-27 北京闪马智建科技有限公司 Application deployment method and device, storage medium and electronic device
CN116737344B (en) * 2023-08-10 2023-11-07 中国电子投资控股有限公司 Multi-container cluster scheduling method and scheduling service system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009152736A1 (en) * 2008-06-16 2009-12-23 华为技术有限公司 Method and apparatus for creating and deploying service
CN107766060A (en) * 2017-10-31 2018-03-06 新华三云计算技术有限公司 Application configuration dispositions method and device
CN109391514A (en) * 2018-10-11 2019-02-26 深信服科技股份有限公司 Deployed with devices method, server, storage medium and device based on high availability

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7206817B2 (en) * 2002-01-18 2007-04-17 Bea Systems, Inc. Systems and methods for application management and deployment
CN105867955A (en) * 2015-09-18 2016-08-17 乐视云计算有限公司 Deployment system and deployment method of application program
CN105260203B (en) * 2015-09-25 2017-11-17 福州大学 A kind of Hadoop deployment and collocation method based on model
CN105487891A (en) * 2015-11-26 2016-04-13 航天恒星科技有限公司 Distributed cluster deploying method and system
CN106055388A (en) * 2016-06-25 2016-10-26 国云科技股份有限公司 Cloud platform application automatic deployment framework
US10505830B2 (en) * 2016-08-11 2019-12-10 Micro Focus Llc Container monitoring configuration deployment
CN106406933B (en) * 2016-08-30 2020-05-12 广西电网有限责任公司 One-key automatic deployment method for Tomcat cluster
CN108011739B (en) * 2016-10-31 2021-05-04 华为技术有限公司 Deployment method, device and system of virtual network
CN108574702A (en) * 2017-03-08 2018-09-25 中兴通讯股份有限公司 A kind of cloud application dispositions method and system
CN109426514B (en) * 2017-08-24 2022-09-02 北京金山云网络技术有限公司 Service automation deployment method and device, electronic equipment and storage medium
CN108549542A (en) * 2018-04-11 2018-09-18 泰康保险集团股份有限公司 A kind of file dispositions method, device and equipment
CN108958927B (en) * 2018-05-31 2023-04-18 康键信息技术(深圳)有限公司 Deployment method and device of container application, computer equipment and storage medium
CN109885316B (en) * 2019-02-18 2023-05-09 国家计算机网络与信息安全管理中心 Hdfs-hbase deployment method and device based on kubernetes

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009152736A1 (en) * 2008-06-16 2009-12-23 华为技术有限公司 Method and apparatus for creating and deploying service
CN107766060A (en) * 2017-10-31 2018-03-06 新华三云计算技术有限公司 Application configuration dispositions method and device
CN109391514A (en) * 2018-10-11 2019-02-26 深信服科技股份有限公司 Deployed with devices method, server, storage medium and device based on high availability

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
何震苇 等.基于开源PaaS技术的互联网业务平台自动部署方案.《电信科学》.2015,(第10期),全文. *

Also Published As

Publication number Publication date
CN110413288A (en) 2019-11-05

Similar Documents

Publication Publication Date Title
CN110413288B (en) Application deployment method, device, server and storage medium
US11178207B2 (en) Software version control without affecting a deployed container
US20210406079A1 (en) Persistent Non-Homogeneous Worker Pools
US20210314223A1 (en) Managing Virtual Network Functions
US8762986B2 (en) Advanced packaging and deployment of virtual appliances
US10324709B2 (en) Apparatus and method for validating application deployment topology in cloud computing environment
US20150186129A1 (en) Method and system for deploying a program module
US9996331B1 (en) Customized application state transition
CN111527474B (en) Dynamic delivery of software functions
US11528186B2 (en) Automated initialization of bare metal servers
US11456914B2 (en) Implementing affinity and anti-affinity with KUBERNETES
US11681585B2 (en) Data migration for a shared database
US11271895B1 (en) Implementing advanced networking capabilities using helm charts
CN116028163A (en) Method, device and storage medium for scheduling dynamic link library of container group
US10482111B2 (en) Custom property cluster definition for a graphic user interface
CN117112122A (en) Cluster deployment method and device
US11750451B2 (en) Batch manager for complex workflows
CN112115056A (en) Project deployment method and device, server and storage medium
US10073689B2 (en) Managing application lifecycles within a federation of distributed software applications
CN115357198B (en) Mounting method and device of storage volume, storage medium and electronic equipment
WO2023084345A1 (en) Automated deployment of enterprise archive with dependency on application server via script
CN115202820A (en) Method, device and equipment for creating Pod unit and storage medium
CN115437647A (en) Multi-frame-adaptive micro-service deployment method, device, terminal and storage medium
CN114860203A (en) Project creation method, project creation device, server and storage medium
CN110971665A (en) Management method, system, equipment and storage medium for interfacing multi-type storage

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
GR01 Patent grant
GR01 Patent grant