A method and device for uniformly deploying container applications and non-container applications based on Kubernetes
By using Kubernetes to uniformly deploy containerized and non-containerized applications, the method and apparatus solve the problems of high management complexity and low efficiency in existing technologies, achieve simplified resource management and consistent operation and maintenance experience, and improve management efficiency and user experience.
Patent Information
- Application Number
- CN202410710062.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2044-06-03
AI Technical Summary
Existing Kubernetes products can only maintain either containerized or non-containerized applications, resulting in high management complexity, poor flexibility, low efficiency, high learning costs, difficulty in updating dependent versions, and insufficient awareness of application installation status.
This invention provides a method and apparatus for unified deployment of containerized and non-containerized applications based on Kubernetes. By predefining application information and media, and utilizing a console, control center, media server, and resource pool, it enables unified management and deployment of containerized and non-containerized applications, including application listing, instance creation, resource pool deployment, and application instance conversion and deployment.
It simplifies the resource management process, provides a consistent operation and maintenance experience, reduces learning costs and operational complexity, improves management efficiency and user experience, achieves unified monitoring and log collection, and reduces operational error rates.
Smart Images

Figure CN118626207B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of unified deployment of container applications and non-container applications, and in particular to a method and device for unified deployment of container applications and non-container applications based on Kubernetes. Background Art
[0002] Currently, existing Kubernetes products can only maintain container applications or non-container applications. There is currently no product based on Kubernetes that can maintain both container and non-container applications.
[0003] The main container application products that can be maintained based on Kubernetes clusters are as follows:
[0004] 1. Helm: Helm is a package manager for Kubernetes, which is used to package, configure, install, and upgrade container applications running on Kubernetes clusters. It can deploy and manage containerized applications in Kubernetes clusters.
[0005] 2. Spinnaker: Spinnaker is an open source, multi-cloud continuous delivery platform that provides the ability to automate the deployment, testing, and release of applications. By integrating Kubernetes, it can easily deploy and manage container applications on multiple cloud platforms.
[0006] 3. Rancher: Rancher is an open source container management platform that provides an easy-to-use interface and rich features for deploying and managing container applications.
[0007] 4. Kapp: Kapp is a simple Kubernetes application deployment tool that provides a declarative way to describe the application status and automatically handles the application deployment and upgrade process. Kapp focuses on simplicity and ease of use, and is suitable for rapid deployment and iteration of container applications.
[0008] Currently, there are relatively few products that manage non-containerized applications based on Kubernetes, because Kubernetes itself is a container orchestration platform. However, there are some products or tools that can assist in running non-containerized applications on Kubernetes, or integrate non-containerized applications into the Kubernetes ecosystem through some methods. The following are some specific products and tools:
[0009] 1. Virtual Kubelet: Virtual Kubelet is an implementation of Kubernetes kubelet that pretends to be a kubelet and is used to connect Kubernetes clusters to other APIs. This allows Kubernetes nodes to be supported by other services, such as serverless container platforms. Virtual Kubelet provides a library that enables public cloud vendors to build their own virtual kubelet versions to extend Node properties to a container platform.
[0010] 2. KubeVirt: KubeVirt is an open source project of Red Hat, which aims to run virtual machines on Kubernetes in a containerized manner. The project extends the existing cluster by using custom resources (CRD) and other Kubernetes features, and provides a set of virtualization APIs that can be used to manage virtual machines, indirectly realizing the deployment and management of non-containerized applications in Kubernetes clusters.
[0011] Whether it is the above-mentioned products for maintaining container applications or products for maintaining non-container applications, they all have certain defects, as follows:
[0012] 1. Steep learning curve: For first-time users, whether it is a containerized tool such as Helm, Spinnaker, Rancher, Kapp, or a non-containerized tool such as Virtual Kubelet and KubeVirt, you need to first understand the working principle and operation of the tool, which requires a certain amount of time and learning cost. The powerful functions of these tools may not be easy for novices to use.
[0013] 2. Dependency version updates: As time goes by and the project develops, the dependent tools may be updated, and manually tracking and updating these dependencies can sometimes become a challenge, which may affect the stability and security of the application.
[0014] 3. Insufficient awareness of application installation status: For example, after Helm pushes all the templates in the chart to Kubernetes, its installation process ends. It does not care whether the components configured in the yaml can run effectively in Kubernetes, which is exactly the part that users care about most.
[0015] 4. Increased management complexity: Separately managing two different types of applications, container applications and non-container applications, means that two different sets of tools, processes, and methods need to be maintained. This not only increases the complexity of management, but may also result in a large amount of duplication of work, leading to low management efficiency.
[0016] Currently, existing Kubernetes products can only maintain containerized applications or non-containerized applications, which also leads to problems such as high complexity, poor flexibility and low efficiency in maintenance and management. Summary of the invention
[0017] In order to better manage and maintain containerized applications and non-containerized applications and improve management and maintenance efficiency, the present invention provides a method and device for uniformly deploying containerized applications and non-containerized applications based on Kubernetes, which simplifies resource management and management process, provides a consistent operation and maintenance experience, simplifies the complexity of management, and realizes unified monitoring and log collection, so that users can better manage and maintain containerized applications and non-containerized applications, greatly improving management efficiency and maintenance efficiency.
[0018] In a first aspect, the present invention provides a method for uniformly deploying container applications and non-container applications based on Kubernetes, which adopts the following technical solution:
[0019] A method for uniformly deploying container applications and non-container applications based on Kubernetes, comprising the following steps:
[0020] S1, pre-defining application information of an application, generating the pre-defined application information, preparing a corresponding pre-defined application medium for the pre-defined application information, and then compressing the pre-defined application information and the pre-defined application medium into an application package;
[0021] S2. Application launch;
[0022] S21. Fill in the basic application information in the console, and upload the basic application information and application package to the control center;
[0023] S22, the control center receives the basic application information and the application package, then extracts the predefined application information in the application package and verifies it, stores the basic application information and the predefined application information after the verification, then extracts the predefined application media in the application package and uploads it to the media server;
[0024] S23, the media server receives the predefined application media and performs verification and storage;
[0025] S24, the control center initiates a request to deploy the Operator to the container resource pool and the non-container resource pool;
[0026] S25: The container resource pool and the non-container resource pool pull images from the media server according to the template definition of the Operator and complete the deployment of the Operator.
[0027] S3. Creation of container application or non-container application: Click the application instance to be created, and complete the application instance information of the application, and upload the completed application instance information to the control center. The control center determines whether the application instance information belongs to a container application instance. If so, the application instance information is sent to the container resource pool. If not, the application instance information is sent to the non-container resource pool.
[0028] S4. Creation of container applications and creation of non-container applications;
[0029] S41, creation of container application;
[0030] S411, receiving application instance information and performing verification and storage;
[0031] S412, classify and store the basic information, configuration parameters and resource pool information in the application instance information;
[0032] S413, converting the basic information, configuration parameters, and resource pool information of the application instance information into the CR structure of Kubernetes, and creating a CR in the selected resource pool;
[0033] S414: convert the basic information and configuration parameters of the application instance information recorded in the CR into a Kubernetes resource template file, and issue the Kubernetes resource template file;
[0034] S415, receiving the Kubernetes resource template file, and sending the Kubernetes resource template file to the Kubernetes cluster through the Kubernetes interface to complete the deployment of the container application;
[0035] S42, creation of non-container applications;
[0036] S421, receiving application instance information and performing verification and storage;
[0037] S422, classify and store the basic information, configuration parameters and resource pool information in the application instance information;
[0038] S423, converting the basic information, configuration parameters, patch information, and resource pool information of the application instance information into the CR structure of Kubernetes, and creating a CR in the selected resource pool;
[0039] S424. Convert the basic information and configuration parameters of the application instance information recorded in the CR into a Kubernetes resource template file, and issue the Kubernetes resource template file;
[0040] S425, receiving a Kubernetes resource template file, and sending the Kubernetes resource template file to the Kubernetes cluster through a Kubernetes interface, and creating a Pod of a non-container application instance;
[0041] S426. In the process of creating a Pod for the non-container application instance, download the binary medium of the non-container application.
[0042] S427: After the binary medium of the non-container application is downloaded, the process of the non-container application is associated with the Pod to complete the deployment of the non-container application.
[0043] Preferably, the application information of the predefined application includes:
[0044] S11, pre-define the definition information of the application, the definition information includes: application name, service category, application status and HomePage definition;
[0045] S12. Predefine the middleware version of the application, where the middleware version includes: middleware version number, middleware version series, upgradeable version list, version status, CPU architecture, containerization status, image list, and non-container media list;
[0046] S13, pre-define the service category of the application, the service category includes: service name, service version series, deployment type, dependency information, workload template, parameter description, deployment topology and service medium list;
[0047] S14. Predefined application Operators. The Operators include: Operator version, Operator application name, Operator deployment type, Operator version series, Operator service category, deployment template, and parameter set.
[0048] Preferably, the predefined application media include Operator images, containerized images, and non-container media.
[0049] Preferably, the application instance information includes:
[0050] Basic configuration area: application instance name, application version, deployment type, service category, application patch;
[0051] Parameter configuration area: select the parameter template and complete the parameter setting, K8S service type is used to set the service address, and the log directory is used to store log files and collect data;
[0052] Deployment resource pool area: The target resource center, cluster, and node for container applications and non-container applications will be set.
[0053] In a second aspect, the present invention provides a device for uniformly deploying container applications and non-container applications based on Kubernetes, which adopts the following technical solution:
[0054] A device for uniformly deploying container applications and non-container applications based on Kubernetes, including the following modules:
[0055] A predefined application information module, used for predefining application information of an application, generating the predefined application information, preparing a corresponding predefined application medium for the predefined application information, and compressing the predefined application information and the predefined application medium into an application package;
[0056] Application listing module, including:
[0057] The console module is used by users to fill in basic application information and upload the basic application information and application package to the control center module;
[0058] The control center module is used to receive the basic application information and the application package, then extract the predefined application information in the application package and verify it, store the basic application information and the predefined application information after the verification, then extract the predefined application media in the application package and upload it to the media server;
[0059] The media server module is used to receive, verify and store predefined application media;
[0060] The control center request module is used to initiate requests to deploy Operators to container resource pools and non-container resource pools;
[0061] The resource pool deployment module is used for container resource pools and non-container resource pools to pull images from the media server according to the template definition of the Operator and complete the deployment of the Operator;
[0062] The application instance creation module is used to create an application instance, improve the application instance information of the application, and upload the improved application instance information to the control center. The control center determines whether the application instance information belongs to a container application instance. If so, the application instance information is sent to the container resource pool. If not, the application instance information is sent to the non-container resource pool.
[0063] Container application creation module: used to create container applications;
[0064] The container application creation module includes:
[0065] The container application instance verification storage unit is used to receive application instance information and perform verification and storage;
[0066] The container application instance classification storage unit is used to classify and store basic information, configuration parameters and resource pool information in the application instance information;
[0067] The container application instance conversion unit is used to convert the basic information, configuration parameters, and resource pool information of the application instance into the CR structure of Kubernetes and create a CR in the selected resource pool;
[0068] The container application instance delivery unit is used to convert the basic information and configuration parameters of the application instance information recorded in the CR into a Kubernetes resource template file and deliver the Kubernetes resource template file;
[0069] The container application instance deployment unit is used to receive the Kubernetes resource template file and send the Kubernetes resource template file to the Kubernetes cluster through the Kubernetes interface to complete the deployment of the container application;
[0070] A non-container creation module, used to create non-container applications;
[0071] The non-container application creation module includes:
[0072] A non-container application creation unit, used to receive, verify and store application instance information;
[0073] A non-container application instance classification storage unit is used to classify and store basic information, configuration parameters and resource pool information in the application instance information;
[0074] The non-container application instance conversion unit is used to convert the basic information, configuration parameters, patch information, and resource pool information of the application instance into the CR structure of Kubernetes and create a CR in the selected resource pool;
[0075] The non-container application instance delivery unit is used to convert the basic information and configuration parameters of the application instance information recorded in the CR into a Kubernetes resource template file and deliver the Kubernetes resource template file;
[0076] The Pod creation unit is used to receive the Kubernetes resource template file and send the Kubernetes resource template file to the Kubernetes cluster through the Kubernetes interface to create a Pod of a non-container application instance;
[0077] The non-container binary media unit is used to download the binary media of the non-container application during the Pod creation process of the non-container application instance;
[0078] The non-container application instance association deployment module is used to associate the process of the non-container application with the Pod after the binary media of the non-container application is downloaded, so as to complete the deployment of the non-container application.
[0079] Preferably, the predefined application information module includes:
[0080] The predefined module is used to predefine the application information of the application, generate the predefined application information, and prepare the corresponding predefined application medium for the predefined application information.
[0081] The compression module is used to compress the predefined application information and the predefined application medium into an application package.
[0082] Preferably, the predefined module includes:
[0083] A definition information pre-definition unit is used to pre-define the definition information of the application, the definition information includes: application name, service category, application status and HomePage definition;
[0084] The middleware version pre-definition unit is used to pre-define the middleware version of the application. The middleware version includes: the middleware version number, the middleware version series, the upgradeable version list, the version status, the CPU architecture, the containerization status, the image list and the non-container media list;
[0085] The service category predefined unit is used to predefine the service category of the application. The service category includes: service name, service version series, deployment type, dependency information, workload template, parameter description, deployment topology and service medium list;
[0086] Operator predefined unit, used to predefine the operator of the application. The operator includes: Operator version, Operator application name, Operator deployment type, Operator version series, Operator service category, deployment template and parameter set.
[0087] In a third aspect, the present invention provides an electronic device, which adopts the following technical solution:
[0088] An electronic device comprising:
[0089] One or more processors;
[0090] Memory;
[0091] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to: execute any of the above-mentioned methods for uniformly deploying container applications and non-container applications based on Kubernetes.
[0092] In a fourth aspect, the present invention provides a computer-readable storage medium, which adopts the following technical solution:
[0093] A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method for uniformly deploying container applications and non-container applications based on Kubernetes as described in any one of the above items is implemented.
[0094] In summary, the present invention includes the following beneficial technical effects:
[0095] 1. The present invention simplifies resource management and management process, provides a consistent operation and maintenance experience, simplifies the complexity of management, and realizes unified monitoring and log collection, so that users can better manage and maintain containerized applications and non-containerized applications, greatly improving management efficiency and maintenance efficiency.
[0096] 2. The present invention greatly improves management efficiency. Its graphical interface greatly simplifies the management process, allowing users to quickly deploy and manage applications without having to deeply understand the complex commands and configurations of Kubernetes. Through an intuitive interface and simple operations, users can quickly complete operations such as application creation, updating, and deletion, thereby improving management efficiency.
[0097] 3. The present invention greatly reduces the learning cost and management threshold: For users who are not familiar with Kubernetes, they do not need to spend a lot of time learning command line tools and configuration file writing rules. They can get started with simple operations, which reduces their learning cost and management threshold.
[0098] 4. The present invention improves and optimizes the user experience: The graphical interface makes the management process more intuitive and convenient. Users can quickly complete operations by dragging, clicking, etc., which reduces the possibility of errors and improves operational efficiency and user experience. The customized applications provided can meet the different needs of users.
[0099] 5. The present invention simplifies resource management and scheduling: It provides a unified view of Kubernetes cluster resources, allowing users to easily view and manage containers, non-container applications, storage, networks, etc. This helps users better understand the distribution and usage of resources and perform reasonable scheduling and allocation according to needs.
[0100] 6. The present invention greatly reduces the error rate of operation: it operates through graphical tools, provides intelligent prompts and verification functions, ensures that the commands and configurations entered by the user are correct, avoids problems caused by manual input of commands or configuration errors, and reduces the error rate of operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0101] Figure 1 It is a structural diagram of application placement in step S2 of the method for uniformly deploying container applications and non-container applications based on Kubernetes in an embodiment of the present invention.
[0102] Figure 2 It is a structural diagram of creating application instances and application instance information in step S3 of the method for uniformly deploying container applications and non-container applications based on Kubernetes in an embodiment of the present invention.
[0103] Figure 3 This is a step diagram of container application creation in step S4 of the method for uniformly deploying container applications and non-container applications based on Kubernetes in an embodiment of the present invention.
[0104] Figure 4 This is a step diagram of creating a non-container application in step S5 of the method for uniformly deploying container applications and non-container applications based on Kubernetes in an embodiment of the present invention. DETAILED DESCRIPTION
[0105] The present invention is further described in detail below in conjunction with the accompanying drawings.
[0106] The embodiment of the present invention discloses a method for uniformly deploying container applications and non-container applications based on Kubernetes, which includes the following steps:
[0107] S1, pre-defining application information of an application, generating the pre-defined application information, preparing a corresponding pre-defined application medium for the pre-defined application information, and then compressing the pre-defined application information and the pre-defined application medium into an application package;
[0108] Specifically, the application information of the above predefined application includes the following steps:
[0109] S11, pre-define the definition information of the application, the definition information includes: application name, service category, application status and HomePage definition;
[0110] S12. Predefine the middleware version of the application, where the middleware version includes: middleware version number, middleware version series, upgradeable version list, version status, CPU architecture, containerization status, image list, and non-container media list;
[0111] S13, pre-define the service category of the application, the service category includes: service name, service version series, deployment type, dependency information, workload template, parameter description, deployment topology and service medium list;
[0112] S14. Predefined application Operators. The Operators include: Operator version, Operator application name, Operator deployment type, Operator version series, Operator service category, deployment template, and parameter set.
[0113] Then, the predefined application information is matched with the corresponding predefined application medium, where the predefined application medium includes an Operator image, a containerized image, a non-container medium, and the like.
[0114] S2. Application launch;
[0115] Specifically, refer to Figure 1 , which specifically includes the following steps:
[0116] S21. Fill in the basic application information in the console, and upload the basic application information and application package to the control center;
[0117] S22, the control center receives the basic application information and the application package, then extracts the predefined application information in the application package and verifies it, stores the basic application information and the predefined application information after the verification, then extracts the predefined application media in the application package and uploads it to the media server;
[0118] S23, the media server receives the predefined application media and performs verification and storage;
[0119] S24, the control center initiates a request to deploy the Operator to the container resource pool and the non-container resource pool;
[0120] S25: The container resource pool and the non-container resource pool pull images from the media server according to the template definition of the Operator and complete the deployment of the Operator.
[0121] S3. Reference Figure 2 , Creation of container applications or non-container applications: Click the application instance to be created, and complete the application instance information of the application, and upload the completed application instance information to the control center. The control center determines whether the application instance information belongs to a container application instance. If so, the application instance information is sent to the container resource pool. If not, the application instance information is sent to the non-container resource pool;
[0122] Specifically, the above application example information includes:
[0123] S301, basic configuration area: application instance name, application version, deployment type, service category, application patch, where the application patch is exclusive to non-container applications;
[0124] S302, parameter configuration area: select the parameter template and complete the parameter setting, K8S service type is used to set the service address, and the log directory is used to store log files and collection;
[0125] S303, deployment resource pool area: set the target resource center, cluster and node for container applications and non-container applications.
[0126] S4. Creation of container applications and creation of non-container applications;
[0127] Specifically, refer to Figure 3 , which comprises the following steps:
[0128] S41, creation of container application;
[0129] S411, receiving application instance information and performing verification and storage;
[0130] S412, classify and store the basic information, configuration parameters and resource pool information in the application instance information;
[0131] S413, converting the basic information, configuration parameters, and resource pool information of the application instance information into the CR structure of Kubernetes, and creating a CR in the selected resource pool;
[0132] S414: convert the basic information and configuration parameters of the application instance information recorded in the CR into a Kubernetes resource template file, and issue the Kubernetes resource template file;
[0133] S415, receiving the Kubernetes resource template file, and sending the Kubernetes resource template file to the Kubernetes cluster through the Kubernetes interface to complete the deployment of the container application;
[0134] S42, creation of non-container applications;
[0135] Specifically, refer to Figure 4 , which comprises the following steps:
[0136] S421, receiving application instance information and performing verification and storage;
[0137] S422, classify and store the basic information, configuration parameters and resource pool information in the application instance information;
[0138] S423, converting the basic information, configuration parameters, patch information, and resource pool information of the application instance information into the CR structure of Kubernetes, and creating a CR in the selected resource pool;
[0139] S424. Convert the basic information and configuration parameters of the application instance information recorded in the CR into a Kubernetes resource template file, and issue the Kubernetes resource template file;
[0140] S425, receiving a Kubernetes resource template file, and sending the Kubernetes resource template file to the Kubernetes cluster through a Kubernetes interface, and creating a Pod of a non-container application instance;
[0141] S426. In the process of creating a Pod for the non-container application instance, download the binary medium of the non-container application.
[0142] S427: After the binary medium of the non-container application is downloaded, the process of the non-container application is associated with the Pod to complete the deployment of the non-container application.
[0143] Through the above process, unified deployment of container applications and non-container applications is completed, thereby realizing unified deployment of container applications and non-container applications based on Kubernetes, thereby better managing and maintaining containerized applications and non-containerized applications, and greatly improving the efficiency of management and maintenance.
[0144] The embodiment of the present application also discloses a device for uniformly deploying container applications and non-container applications based on Kubernetes, which includes the following modules:
[0145] A predefined application information module, used for predefining application information of an application, generating the predefined application information, preparing a corresponding predefined application medium for the predefined application information, and compressing the predefined application information and the predefined application medium into an application package;
[0146] The predefined application information modules include:
[0147] The predefined module is used to predefine the application information of the application, generate the predefined application information, and prepare the corresponding predefined application medium for the predefined application information.
[0148] A compression module, used for compressing the predefined application information and the predefined application medium into an application package;
[0149] Predefined modules include:
[0150] A definition information predefinition unit, used to predefine definition information of an application, wherein the definition information includes: application name, service category, application status and HomePage definition;
[0151] A middleware version predefinition unit, used to predefine the middleware version of the application, wherein the middleware version includes: a middleware version number, a middleware version series, an upgradeable version list, a version status, a CPU architecture, a containerization status, a mirror list, and a non-container medium list;
[0152] A service category predefinition unit is used to predefine the service category of an application, wherein the service category includes: service name, service version series, deployment type, dependency information, workload template, parameter description, deployment topology, and service medium list;
[0153] The Operator predefined unit is used to predefine the Operator of the application. The Operator includes: Operator version, Operator application name, Operator deployment type, Operator version series, Operator service category, deployment template, and parameter set.
[0154] Application listing module, including:
[0155] The console module is used by users to fill in basic application information and upload the basic application information and application package to the control center module;
[0156] The control center module is used to receive the basic application information and the application package, then extract the predefined application information in the application package and verify it, store the basic application information and the predefined application information after the verification, then extract the predefined application media in the application package and upload it to the media server;
[0157] The media server module is used to receive, verify and store predefined application media;
[0158] The control center request module is used to initiate requests to deploy Operators to container resource pools and non-container resource pools;
[0159] The resource pool deployment module is used for container resource pools and non-container resource pools to pull images from the media server according to the template definition of the Operator and complete the deployment of the Operator;
[0160] The application instance creation module is used to create an application instance, improve the application instance information of the application, and upload the improved application instance information to the control center. The control center determines whether the application instance information belongs to a container application instance. If so, the application instance information is sent to the container resource pool. If not, the application instance information is sent to the non-container resource pool.
[0161] Container application creation module: used to create container applications;
[0162] The container application creation module includes:
[0163] The container application instance verification storage unit is used to receive application instance information and perform verification and storage;
[0164] The container application instance classification storage unit is used to classify and store basic information, configuration parameters and resource pool information in the application instance information;
[0165] The container application instance conversion unit is used to convert the basic information, configuration parameters, and resource pool information of the application instance into the CR structure of Kubernetes and create a CR in the selected resource pool;
[0166] The container application instance delivery unit is used to convert the basic information and configuration parameters of the application instance information recorded in the CR into a Kubernetes resource template file and deliver the Kubernetes resource template file;
[0167] The container application instance deployment unit is used to receive the Kubernetes resource template file and send the Kubernetes resource template file to the Kubernetes cluster through the Kubernetes interface to complete the deployment of the container application;
[0168] A non-container creation module, used to create non-container applications;
[0169] The non-container application creation module includes:
[0170] A non-container application creation unit, used to receive, verify and store application instance information;
[0171] A non-container application instance classification storage unit is used to classify and store basic information, configuration parameters and resource pool information in the application instance information;
[0172] The non-container application instance conversion unit is used to convert the basic information, configuration parameters, patch information, and resource pool information of the application instance into the CR structure of Kubernetes and create a CR in the selected resource pool;
[0173] The non-container application instance delivery unit is used to convert the basic information and configuration parameters of the application instance information recorded in the CR into a Kubernetes resource template file and deliver the Kubernetes resource template file;
[0174] The Pod creation unit is used to receive the Kubernetes resource template file and send the Kubernetes resource template file to the Kubernetes cluster through the Kubernetes interface to create a Pod of a non-container application instance;
[0175] The non-container binary media unit is used to download the binary media of the non-container application during the Pod creation process of the non-container application instance;
[0176] The non-container application instance association deployment module is used to associate the process of the non-container application with the Pod after the binary media of the non-container application is downloaded, so as to complete the deployment of the non-container application.
[0177] An embodiment of the present invention further provides an electronic device, the electronic device comprising: a processor and a memory. The processor and the memory are connected, such as through a bus. Optionally, the electronic device may further include a transceiver. It should be noted that in actual applications, the transceiver is not limited to one, and the structure of the electronic device does not constitute a limitation on the embodiment of the present invention.
[0178] The processor may be a CPU central processing unit, a general processor, a DSP data signal processor, an ASIC application specific integrated circuit, an FPGA field programmable gate array or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present invention. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0179] The bus may include a path to transmit information between the above components. The bus may be a PCI peripheral component interconnect standard bus or an EISA extended industry standard architecture bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc.
[0180] The memory can be a ROM read-only memory or other types of static storage devices that can store static information and instructions, a RAM random access memory or other types of dynamic storage devices that can store information and instructions, or an EEPROM electrically erasable programmable read-only memory, a CD-ROM read-only disc or other optical disc storage, an optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this.
[0181] The memory is used to store the application code for executing the solution of the present invention, and the execution is controlled by the processor. The processor is used to execute the application code stored in the memory to implement the content shown in the method for uniformly deploying container applications and non-container applications based on Kubernetes disclosed in the above embodiment.
[0182] The electronic devices include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital TVs, desktop computers, etc. It can also be a server, etc.
[0183] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer-readable storage medium is run on a computer, the computer can execute the corresponding contents of a method for uniformly deploying container applications and non-container applications based on Kubernetes disclosed in the above embodiment.
[0184] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0185] The above are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for uniformly deploying container applications and non-container applications based on Kubernetes, characterized in that: The following steps are involved: S1, pre-defining application information of an application, generating the pre-defined application information, preparing a corresponding pre-defined application medium for the pre-defined application information, and then compressing the pre-defined application information and the pre-defined application medium into an application package; The application information of the predefined application includes: S11, pre-define the definition information of the application, the definition information includes: application name, service category, application status and HomePage definition; S12. Predefine the middleware version of the application, where the middleware version includes: middleware version number, middleware version series, upgradeable version list, version status, CPU architecture, containerization status, image list, and non-container media list; S13, pre-define the service category of the application, the service category includes: service name, service version series, deployment type, dependency information, workload template, parameter description, deployment topology and service medium list; S14, Operator of predefined application, the Operator includes: Operator version, Operator application name, Operator deployment type, Operator version series, Operator service category, deployment template and parameter set; The predefined application media include Operator images, containerized images, and non-container media; S2. Application launch; S21. Fill in the basic application information in the console, and upload the basic application information and application package to the control center; S22, the control center receives the basic application information and the application package, then extracts the predefined application information in the application package and verifies it, stores the basic application information and the predefined application information after the verification, then extracts the predefined application media in the application package and uploads it to the media server; S23, the media server receives the predefined application media and performs verification and storage; S24, the control center initiates a request to deploy the Operator to the container resource pool and the non-container resource pool; S25: The container resource pool and the non-container resource pool pull images from the media server according to the template definition of the Operator and complete the deployment of the Operator. S3. Creation of container application or non-container application: Click the application instance to be created, and complete the application instance information of the application, and upload the completed application instance information to the control center. The control center determines whether the application instance information belongs to a container application instance. If so, the application instance information is sent to the container resource pool. If not, the application instance information is sent to the non-container resource pool. S4. Creation of container applications and creation of non-container applications; S41, creation of container application; S411, receiving application instance information and performing verification and storage; S412, classify and store the basic information, configuration parameters and resource pool information in the application instance information; S413, converting the basic information, configuration parameters, and resource pool information of the application instance information into the CR structure of Kubernetes, and creating a CR in the selected resource pool; S414: convert the basic information and configuration parameters of the application instance information recorded in the CR into a Kubernetes resource template file, and issue the Kubernetes resource template file; S415, receiving the Kubernetes resource template file, and sending the Kubernetes resource template file to the Kubernetes cluster through the Kubernetes interface to complete the deployment of the container application; S42, creation of non-container applications; S421, receiving application instance information and performing verification and storage; S422, classify and store the basic information, configuration parameters and resource pool information in the application instance information; S423, converting the basic information, configuration parameters, patch information, and resource pool information of the application instance information into the CR structure of Kubernetes, and creating a CR in the selected resource pool; S424. Convert the basic information and configuration parameters of the application instance information recorded in the CR into a Kubernetes resource template file, and issue the Kubernetes resource template file; S425, receiving a Kubernetes resource template file, and sending the Kubernetes resource template file to the Kubernetes cluster through a Kubernetes interface, and creating a Pod of a non-container application instance; S426. In the process of creating a Pod for the non-container application instance, download the binary medium of the non-container application. S427: After the binary medium of the non-container application is downloaded, the process of the non-container application is associated with the Pod to complete the deployment of the non-container application.
2. According to a method for uniformly deploying container applications and non-container applications based on Kubernetes according to claim 1, it is characterized in that: The application example information includes: Basic configuration area: application instance name, application version, deployment type, service category, application patch; Parameter configuration area: select the parameter template and complete the parameter setting, K8S service type is used to set the service address, and the log directory is used to store log files and collect data; Deployment resource pool area: The target resource center, cluster, and node for container applications and non-container applications will be set.
3. A device for uniformly deploying container applications and non-container applications based on Kubernetes, characterized in that: Includes the following modules: A predefined application information module, used for predefining application information of an application, generating the predefined application information, preparing a corresponding predefined application medium for the predefined application information, and compressing the predefined application information and the predefined application medium into an application package; The predefined application information module includes: A predefined module is used to predefine application information of an application, generate the predefined application information, and prepare corresponding predefined application media for the predefined application information. The predefined application media includes an Operator image, a containerized image, and a non-container medium. A compression module, used for compressing the predefined application information and the predefined application medium into an application package; The predefined modules include: A definition information pre-definition unit is used to pre-define the definition information of the application, the definition information includes: application name, service category, application status and HomePage definition; The middleware version pre-definition unit is used to pre-define the middleware version of the application. The middleware version includes: the middleware version number, the middleware version series, the upgradeable version list, the version status, the CPU architecture, the containerization status, the image list and the non-container media list; The service category predefined unit is used to predefine the service category of the application. The service category includes: service name, service version series, deployment type, dependency information, workload template, parameter description, deployment topology and service medium list; Operator predefined unit, used for predefined application operators. Operators include: Operator version, Operator application name, Operator deployment type, Operator version series, Operator service category, deployment template, and parameter set; Application listing module, including: The console module is used by users to fill in basic application information and upload the basic application information and application package to the control center module; The control center module is used to receive the basic application information and the application package, then extract the predefined application information in the application package and verify it, store the basic application information and the predefined application information after the verification, then extract the predefined application media in the application package and upload it to the media server; The media server module is used to receive, verify and store predefined application media; The control center request module is used to initiate requests to deploy Operators to container resource pools and non-container resource pools; The resource pool deployment module is used for container resource pools and non-container resource pools to pull images from the media server according to the template definition of the Operator and complete the deployment of the Operator; The application instance creation module is used to create an application instance, improve the application instance information of the application, and upload the improved application instance information to the control center. The control center determines whether the application instance information belongs to a container application instance. If so, the application instance information is sent to the container resource pool. If not, the application instance information is sent to the non-container resource pool. Container application creation module: used to create container applications; The container application creation module includes: The container application instance verification storage unit is used to receive application instance information and perform verification and storage; The container application instance classification storage unit is used to classify and store basic information, configuration parameters and resource pool information in the application instance information; The container application instance conversion unit is used to convert the basic information, configuration parameters, and resource pool information of the application instance into the CR structure of Kubernetes and create a CR in the selected resource pool; The container application instance delivery unit is used to convert the basic information and configuration parameters of the application instance information recorded in the CR into a Kubernetes resource template file and deliver the Kubernetes resource template file; The container application instance deployment unit is used to receive the Kubernetes resource template file and send the Kubernetes resource template file to the Kubernetes cluster through the Kubernetes interface to complete the deployment of the container application; A non-container creation module, used to create non-container applications; The non-container application creation module includes: A non-container application creation unit, used to receive, verify and store application instance information; A non-container application instance classification storage unit is used to classify and store basic information, configuration parameters and resource pool information in the application instance information; The non-container application instance conversion unit is used to convert the basic information, configuration parameters, patch information, and resource pool information of the application instance into the CR structure of Kubernetes and create a CR in the selected resource pool; The non-container application instance delivery unit is used to convert the basic information and configuration parameters of the application instance information recorded in the CR into a Kubernetes resource template file and deliver the Kubernetes resource template file; The Pod creation unit is used to receive the Kubernetes resource template file and send the Kubernetes resource template file to the Kubernetes cluster through the Kubernetes interface to create a Pod of a non-container application instance; The non-container binary media unit is used to download the binary media of the non-container application during the Pod creation process of the non-container application instance; The non-container application instance association deployment module is used to associate the process of the non-container application with the Pod after the binary media of the non-container application is downloaded, so as to complete the deployment of the non-container application.
4. An electronic device, characterized in that: It includes: One or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to: execute a method for uniformly deploying container applications and non-container applications based on Kubernetes according to any one of claims 1 to 2.
5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a method for uniformly deploying container applications and non-container applications based on Kubernetes as described in any one of claims 1 to 2 is implemented.
