A method, device, equipment and medium for managing non-container applications in Kubernetes
By creating CRD and workload template files in Kubernetes, establishing the association between non-container applications and Pods, Kubernetes solves the limitations of non-container application management, achieves unified management of containerized and non-containerized applications, and improves Improve resource utilization and application stability.
Patent Information
- Application Number
- CN202410555369.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-07
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-05-07
AI Technical Summary
Kubernetes has limitations in non-container applications and cannot effectively manage and schedule non-container applications, resulting in complex and inefficient deployment and management. It also lacks mature solutions to meet the needs of large-scale production environments.
Record the application information of non-container applications by creating CRs defined by specific CRDs in the Kubernetes cluster, form a workload template file, create Pods based on this file, establish the association between non-container applications and Pods, and realize the management of non-container applications. , ensuring unified management of containerized and non-containerized applications without interrupting application processes.
It realizes the management of non-container application processes into Kubernetes clusters without interrupting them, improves resource utilization, simplifies the deployment and expansion process of non-container applications, ensures the stability and availability of applications, and supports automated Restart and dynamic deployment improve the administrator's efficiency in resource allocation and scheduling.
Smart Images

Figure CN118394478B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of managing non-container applications in Kubernetes, and in particular to a method, device, equipment and medium for managing non-container applications in Kubernetes. Background Art
[0002] Kubernetes is a powerful container orchestration platform that is designed to better manage and schedule containerized applications. Common ways to manage containerized applications with Kubernetes are as follows:
[0003] 1. Use pure YAML files: This is a way to keep it simple by writing YAML files to define Kubernetes resource objects such as Pod, Service, Deployment, etc. These files describe the properties, configurations, and relationships of resources and can be applied to the Kubernetes cluster through the kubectl command.
[0004] 2. Use Helm charts: Helm is a package manager for Kubernetes, which uses Helm charts to define, install, and upgrade Kubernetes applications. Helm charts contain all Kubernetes resource definitions and configurations for the application, making application deployment and management more convenient and consistent.
[0005] 3. Use automated operators: Operators are an extension mechanism of Kubernetes that is used to automatically manage specific types of applications or services. Operators monitor Kubernetes events and states and automatically perform corresponding operations, such as creating, updating, or deleting resource objects, to achieve automated operation and maintenance of applications.
[0006] 4. kubectl is a command-line tool for Kubernetes that allows users to interact with the Kubernetes cluster to manage and operate the resources in the cluster. The following management operations can be performed using kubectl:
[0007] a) View the cluster: You can view the status of the cluster, including detailed information about running Pods, Services, Deployments and other resources.
[0008] b) Deploy applications: By writing Kubernetes resource definition files (such as Deployment, Service, etc.), you can use kubectl to deploy these resources to the cluster.
[0009] c) Update the application: When the application needs to be updated, you can modify the resource definition file and apply these changes using kubectl.
[0010] d) Scaling applications: kubectl allows you to scale applications up or down based on demand.
[0011] e) Delete application: When an application is no longer needed, you can use kubectl to delete it.
[0012] f) View logs and debug: kubectl provides the function of viewing Pod logs and executing container commands in Pod, which is very useful for debugging and troubleshooting.
[0013] Kubernetes has reached a fairly high level of technical maturity in containerization. It has become a leader in the field of container orchestration and has made significant progress in stability and functionality. However, despite the significant progress Kubernetes has made in containerization, it still has certain limitations in some aspects, such as:
[0014] 1. Kubernetes' scheduling and orchestration mechanism is based on containers, which rely on the lightweight and portability of containers to achieve rapid deployment and expansion of applications. Non-container applications may not be able to fully utilize these features, making deployment and management on Kubernetes complex and inefficient.
[0015] 2. Many advanced features of Kubernetes, such as automatic scaling, rolling updates, and fault recovery, are designed for containerized applications. These features may not work the same way on non-container applications.
[0016] 3. The Kubernetes ecosystem also revolves around containerized applications. Although there are some tools and projects that try to bring non-container applications into the management scope of Kubernetes, these solutions are not mature or stable enough to meet the needs of large-scale production environments.
[0017] In summary, Kubernetes has great limitations in non-container applications. Faced with a large number of non-container applications in the production environment, there is no reasonable solution to incorporate these non-container applications into the management scope of Kerbernetes. Based on this, the inventors have developed a method and device that can manage non-container applications within the management scope of Kerbernetes. Summary of the invention
[0018] In order to manage non-container applications in Kerbernetes, so as to better allocate and schedule resources for containerized applications and non-containerized applications, and improve the overall resource utilization, the present invention provides a method and apparatus, equipment and medium for managing non-container applications in Kubernetes, which can complete the management of non-container applications by Kubernetes cluster without interrupting the application process of non-container applications, so that Kubernetes can uniformly manage containerized applications and non-containerized applications, and administrators can more efficiently allocate and schedule resources for containerized applications and non-containerized applications, thereby improving the overall resource utilization.
[0019] In a first aspect, the present invention provides a method for managing non-container applications in Kubernetes, which adopts the following technical solution:
[0020] A method for managing a non-container application in Kubernetes includes the following steps:
[0021] Issue collection tasks and collection scripts for non-container applications based on Kubernetes cluster and node information;
[0022] Collect application processes and application information of non-container applications on the host;
[0023] Create a CR defined by a specific CRD in Kubernetes to record application information of non-container applications;
[0024] Based on the application information of non-container applications recorded in CR, a workload template file for the Kubernetes cluster is generated;
[0025] Create a Pod based on the workload template file, schedule the Pod to the bound Kubernetes node, associate the Pod with the application process of the non-container application, and take over the application information of the non-container application.
[0026] Preferably, the application information includes application process, startup parameters, deployment directory, configuration file, log directory and network port of the non-container application.
[0027] Preferably, according to the application information of the non-container application recorded in the CR, the workload template file for forming the Kubernetes cluster further includes:
[0028] Set the network port as a health check, mount the configuration file and log directory to the deployment directory, then use the startup parameters as command line parameters for non-container applications and set the scheduling policy for workload resources.
[0029] Preferably, creating a Pod according to the workload template file, scheduling the Pod to a bound Kubernetes node, establishing an association between the Pod and an application process of a non-container application, and taking over application information of the non-container application include:
[0030] Create a Pod of Kubernetes resources according to the workload template file, and schedule the Pod to the bound Kubernetes node. Without restarting the non-container application process, establish an association between the application process of the non-container application and the Pod, and complete the goal of managing the non-container application in the Kubernetes cluster.
[0031] In a second aspect, the present invention provides a device for managing non-container applications in Kubernetes, which adopts the following technical solution:
[0032] A device for managing non-container applications in Kubernetes, characterized by comprising the following modules:
[0033] The control module is used to issue collection tasks and collection scripts for non-container applications based on Kubernetes cluster and node information;
[0034] The non-container application collection module is used to receive the collection task and execute the collection script, and then collect the application process and application information of the non-container application on the host and upload them to the control module;
[0035] The non-container application storage module is used to create a CR defined by a specific CRD in Kubernetes to record the application information of non-container applications;
[0036] The load template conversion module is used to generate a workload template file for the Kubernetes cluster based on the application information of the non-container application recorded in the CR;
[0037] The Kubernetes cluster resource creation module is used to create a Pod according to the workload template file, schedule the Pod to the bound Kubernetes node, establish an association between the Pod and the application process of the non-container application, and take over the application information of the non-container application.
[0038] Preferably, it also includes:
[0039] The PaaS platform is used to uniformly manage multiple Kubernetes clusters and serves as the entry point for Kubernetes cluster management and control.
[0040] In a third aspect, the present application provides an electronic device, which adopts the following technical solution:
[0041] An electronic device comprising:
[0042] One or more processors;
[0043] Memory;
[0044] 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 managing non-container applications in Kubernetes according to any of the above items.
[0045] In a fourth aspect, the present invention provides a device for text generation enhancement for retrieval enhancement generation, which adopts the following technical solution:
[0046] A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method for managing a non-container application in Kubernetes as described in any one of the above items is implemented.
[0047] In summary, the present invention includes the following beneficial technical effects:
[0048] 1. The present invention can complete the management of non-container applications in the Kubernetes cluster without interrupting the application process of non-container applications, so that Kubernetes can uniformly manage containerized applications and non-containerized applications. At the same time, administrators can more efficiently allocate and schedule resources for containerized applications and non-containerized applications, thereby improving overall resource utilization.
[0049] 2. After the non-container application is managed by Kubernetes, the present invention facilitates Kubernetes to monitor the non-container application and the nodes on which it runs. When a non-container application fails, the non-container application can be automatically restarted or dynamically deployed to other nodes, thereby ensuring the stability and availability of the non-container application and reducing the risk of interruption of the non-container application due to node failure, etc.
[0050] 3. The present invention makes the deployment and expansion process of non-container applications simpler and more automated. Administrators can use Kubernetes' declarative configuration to define the running state of non-container applications, and Kubernetes will automatically ensure that the running state of non-container applications is consistent with the configuration to improve the stability of non-container applications at runtime. Kubernetes also supports horizontal expansion of non-container applications, so that it can automatically increase or decrease the number of copies of non-container applications as needed.
[0051] 4. The present invention can help administrators better understand the operating status and performance of non-container applications, so that administrators can promptly discover and solve potential problems of non-container applications and improve the stability and performance of non-container applications during runtime. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 This is a flowchart of the steps of a method for managing a non-container application in Kubernetes in an embodiment of the present invention.
[0053] Figure 2 It is a structural diagram of a device for managing non-container applications in Kubernetes in an embodiment of the present invention.
[0054] Figure 3 This is an architecture diagram of a PaaS in a device that manages non-container applications in Kubernetes in an embodiment of the present invention. DETAILED DESCRIPTION
[0055] The present invention is further described in detail below in conjunction with the accompanying drawings.
[0056] Reference Figure 1 The embodiment of the present invention discloses a method for managing a non-container application in Kubernetes, the method comprising the following steps:
[0057] S1. Issue collection tasks and collection scripts for non-container applications based on Kubernetes cluster and node information;
[0058] First, use the control module to filter the Kubernetes clusters and node information that meet the management conditions. Then, the control module sends the collection tasks and collection scripts of non-container applications to the non-container application collection module based on the Kubernetes cluster and node information.
[0059] S2. Collect application processes and application information of non-container applications on the host;
[0060] After the non-container application collection module receives the collection task of the non-container application issued by the control module, the non-container application collection module executes the collection script, and then the non-container application collection module collects the application process and application information of the non-container application, wherein the application process is the current running status of the non-container application; the application information includes the application process, startup parameters, deployment directory, configuration file, log directory and network port of the non-container application.
[0061] The non-container application collection module collects the application process and application information of the non-container application and uploads them to the control module.
[0062] S3. Create a CR defined by a specific CRD in Kubernetes to record application information of non-container applications;
[0063] Specifically, a CR defined by a specific CRD is created in Kubernetes, and the application process and application information of the non-container application collected by the non-container application collection module are converted and then stored in the corresponding non-container application storage module CR.
[0064] S4. Create a workload template file for the Kubernetes cluster based on the application information of the non-container application recorded in the CR.
[0065] After the load template conversion component detects the converted information in the CR, it forms a workload template file for the Kubernetes cluster based on the application information of the converted non-container application recorded in the CR;
[0066] At the same time, set the network port as a health check, mount the configuration file and log directory to the deployment directory, then use the startup parameters as command line parameters for non-container applications and set the scheduling policy for workload resources.
[0067] S5. Create a Pod according to the workload template file, schedule the Pod to the bound Kubernetes node, establish an association between the Pod and the application process of the non-container application, and take over the application information of the non-container application.
[0068] Specifically, a Pod of Kubernetes resources is created according to the workload module file, and the Pod is scheduled to the bound Kubernetes node. Without restarting the non-container application process, an association relationship between the application process of the non-container application and the Pod is established, thereby achieving the goal of managing the non-container application into the Kubernetes cluster and taking over the application information of the non-container application.
[0069] To summarize, the present invention screens clusters and nodes that meet the conditions, collects application processes and application information of non-container applications, then converts the storage, and then converts it into a workload template file, and completes the Pod creation of Kubernetes resources according to the workload template file, and finally schedules the Pod to the Kubernetes node and completes the binding, and finally completes the management of non-container applications.
[0070] Reference Figure 2 The embodiment of the present application also provides a device for managing non-container applications in Kubernetes, which includes the following modules:
[0071] The control module is used to issue collection tasks and collection scripts for non-container applications based on Kubernetes cluster and node information;
[0072] The non-container application collection module is used to receive the collection task and execute the collection script, and then collect the application process and application information of the non-container application on the host and upload them to the control module;
[0073] The non-container application storage module is used to create a CR defined by a specific CRD in Kubernetes to record the application information of non-container applications;
[0074] The load template conversion module is used to generate a workload template file for the Kubernetes cluster based on the application information of the non-container application recorded in the CR;
[0075] The Kubernetes cluster resource creation module is used to create a Pod according to the workload template file, schedule the Pod to the bound Kubernetes node, establish an association between the Pod and the application process of the non-container application, and take over the application information of the non-container application.
[0076] Reference Figure 3 , each of the above modules is only for the management of a non-container application. There are usually multiple non-container applications in a device. In order to facilitate the management of non-container applications with different functions and different fields, multiple Kubernetes clusters are set up, and multiple Kubernetes clusters need to have the same entrance. Therefore, the above-mentioned device for managing non-container applications to Kubernetes also includes a PaaS platform, wherein the PaaS platform is used to uniformly manage multiple Kubernetes clusters and serve as the entrance for Kubernetes cluster management, and multiple sets of Kubernetes clusters are hosted in the PaaS platform. Non-container applications will be managed in different Kubernetes clusters for centralized management and control, and the CR of non-container applications is maintained. At the same time, unified management allows the control module to schedule different non-container applications, and different non-container applications also carry different functions. Multiple Kubernetes clusters are managed by the PaaS platform, and multiple non-container applications are managed by the Kubernetes cluster, so as to achieve unified management of multiple non-container applications with different functions and different fields, thereby achieving the management of multiple non-container applications with different functions and different fields.
[0077] 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.
[0078] 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.
[0079] 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.
[0080] 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.
[0081] 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 managing non-container applications in Kubernetes disclosed in the above embodiment.
[0082] 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.
[0083] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer can execute the corresponding content of a method for managing a non-container application in Kubernetes disclosed in the above embodiment.
[0084] 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.
[0085] 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 managing non-container applications in Kubernetes, characterized in that: The following steps are involved: Issue collection tasks and collection scripts for non-container applications based on Kubernetes cluster and node information; Collect application processes and application information of non-container applications on the host; Create a CR defined by a specific CRD in Kubernetes to record application information of non-container applications; Based on the application information of non-container applications recorded in CR, a workload template file for the Kubernetes cluster is generated; Create a Pod based on the workload template file, schedule the Pod to the bound Kubernetes node, associate the Pod with the application process of the non-container application, and take over the application information of the non-container application.
2. A method for managing non-container applications in Kubernetes according to claim 1, characterized in that: The application information includes the application process, startup parameters, deployment directory, configuration file, log directory and network port of the non-container application.
3. A method for managing non-container applications in Kubernetes according to claim 2, characterized in that: According to the application information of non-container applications recorded in CR, the workload template file that forms the Kubernetes cluster also includes: Set the network port as a health check, mount the configuration file and log directory to the deployment directory, then use the startup parameters as command line parameters for non-container applications and set the scheduling policy for workload resources.
4. A method for managing non-container applications in Kubernetes according to claim 3, characterized in that: Create a Pod based on the workload template file, schedule the Pod to the bound Kubernetes node, associate the Pod with the application process of the non-container application, and take over the application information of the non-container application, including: Create a Pod of Kubernetes resources according to the workload template file, and schedule the Pod to the bound Kubernetes node. Without restarting the non-container application process, establish an association between the application process of the non-container application and the Pod, and complete the goal of managing the non-container application in the Kubernetes cluster.
5. A device for managing non-container applications in Kubernetes, characterized in that: Includes the following modules: The control module is used to issue collection tasks and collection scripts for non-container applications based on Kubernetes cluster and node information; The non-container application collection module is used to receive the collection task and execute the collection script, and then collect the application process and application information of the non-container application on the host and upload them to the control module; The non-container application storage module is used to create a CR defined by a specific CRD in Kubernetes to record the application information of non-container applications; The load template conversion module is used to generate a workload template file for the Kubernetes cluster based on the application information of the non-container application recorded in the CR; The Kubernetes cluster resource creation module is used to create a Pod according to the workload template file, schedule the Pod to the bound Kubernetes node, establish an association between the Pod and the application process of the non-container application, and take over the application information of the non-container application.
6. The device for managing non-container applications in Kubernetes according to claim 5, characterized in that: Also includes: The PaaS platform is used to uniformly manage multiple Kubernetes clusters and serves as the entry point for Kubernetes cluster management and control.
7. 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 managing a non-container application to Kubernetes according to any one of claims 1 to 4.
8. 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 managing a non-container application in Kubernetes as described in any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Dynamic load balancing scheduling method and system based on Kubernetes platform resources
CN113010270A
Network QoS (Quality of Service) configuration method, equipment and a medium
CN113709810A
Resource scheduling method and device, computer equipment and storage medium
CN115145695A
Method and apparatus for creating a container
EP4080362A2
Use of crds as descriptors for applications, application components, deployments, clouds, ai / ML models, and RTE in an o-ran system
US20230069604A1
