Software startup method, device, server and storage medium based on Kubernetes cluster

By creating the minimum running unit in the Kubernetes cluster and mounting the ConfigMap configuration file, the problem of low loading efficiency of ConfigMap configuration file is solved, and the software startup efficiency is improved.

CN115016862BActive Publication Date: 2025-05-16SHENZHEN SHULIAN TIANXIA INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210692824.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-17
Publication Date
2025-05-16
Estimated Expiration
2042-06-17

AI Technical Summary

Technical Problem

The ConfigMap configuration file is inefficient in loading in Kubernetes clusters, which affects the software startup efficiency.

Method used

Create a minimum running unit in a Kubernetes cluster, deploy software engineering files, and mount the ConfigMap configuration file into the minimum running unit, allowing the software to read the configuration file directly from the minimum running unit at startup.

Benefits of technology

By directly reading the ConfigMap configuration file from the minimum running unit, the loading efficiency of configuration files is significantly improved, thereby improving the efficiency of software startup.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115016862B_ABST
    Figure CN115016862B_ABST
Patent Text Reader

Abstract

The present application relates to the field of Internet technology, and discloses a software startup method, device, server and storage medium based on Kubernetes cluster, the method comprising: after the Kubernetes cluster obtains the engineering file corresponding to a certain software, creating a minimum operation unit, and deploying the engineering file in the minimum operation unit; obtaining the ConfigMap configuration file corresponding to the software from the ConfigMap storage space, and mounting the ConfigMap configuration file corresponding to the software on the minimum operation unit; obtaining the ConfigMap configuration file corresponding to the software from the minimum operation unit to start the software. By mounting the ConfigMap configuration file corresponding to the software on the minimum operation unit, the software directly reads the ConfigMap configuration file from the minimum operation unit during the startup process, and the present application can improve the loading efficiency of the configuration file, thereby improving the efficiency of software startup.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a software startup method, device, server and storage medium based on a Kubernetes cluster. Background Art

[0002] Kubernetes, or K8s for short, is an abbreviation that replaces the eight characters in the middle of the name "ubernete". Kubernetes is an open source containerized application for managing multiple hosts in a cloud platform. The goal of Kubernetes is to make the deployment of containerized applications simple and efficient. Kubernetes provides a mechanism for application deployment, planning, updating, and maintenance.

[0003] ConfigMap is a Kubernetes configuration resource. It is saved in the Kubernetes system in the form of one or more key:value pairs for application use. It can be used to represent the value of a variable or the content of a complete configuration file.

[0004] At present, after the software development is completed, the software engineering files are submitted to the Kubernetes cluster for management. Kubernetes is responsible for allocating hardware resources to run the software engineering files, thereby achieving the purpose of running the software. Usually, the software parameters are configured in the ConfigMap configuration file. When the software starts, the ConfigMap configuration file is loaded to start the software.

[0005] However, since the ConfigMap configuration files are usually stored in the ConfigMap storage space of Kubernetes, the ConfigMap configuration files need to be downloaded from the ConfigMap storage space when the software is started, resulting in low efficiency in loading the configuration files, which affects the efficiency of software startup. Summary of the invention

[0006] The embodiments of the present application provide a software startup method, device, server and storage medium based on a Kubernetes cluster to improve the loading efficiency of a ConfigMap configuration file, thereby improving the efficiency of software startup.

[0007] In a first aspect, an embodiment of the present application provides a software startup method based on a Kubernetes cluster, the method comprising:

[0008] After the Kubernetes cluster obtains the engineering file corresponding to a certain software, it creates a minimum operating unit and deploys the engineering file to the minimum operating unit.

[0009] Get the ConfigMap configuration file corresponding to the software from the ConfigMap storage space, and mount the ConfigMap configuration file corresponding to the software on the minimum running unit;

[0010] Get the ConfigMap configuration file corresponding to the software from the minimum running unit to start the software.

[0011] In some embodiments, creating a minimum operating unit includes:

[0012] According to the running parameters of the software, a minimum running unit corresponding to the software is created, wherein the running parameters of the software include hard disk parameters, the minimum running unit corresponds to a hard disk space, and the space size corresponding to the hard disk space is not less than the space size corresponding to the hard disk parameters.

[0013] In some embodiments, deploying the project file to the minimum operating unit includes:

[0014] Save the project file to the hard disk space corresponding to the smallest running unit.

[0015] In some embodiments, mounting the ConfigMap configuration file corresponding to the software on the minimum running unit includes:

[0016] Save the ConfigMap configuration file to the hard disk space corresponding to the minimum running unit, where the ConfigMap configuration file corresponds to the preset path of the hard disk space, and the preset path is stored in the property file in the project file corresponding to the software.

[0017] In some embodiments, obtaining a ConfigMap configuration file corresponding to the software from the minimum running unit to start the software includes:

[0018] Run the engineering file corresponding to the software in the minimum operation unit, and obtain the preset path of the hard disk space corresponding to the minimum operation unit from the property file in the engineering file corresponding to the software;

[0019] Obtain the ConfigMap configuration file corresponding to the software according to the preset path of the hard disk space corresponding to the minimum running unit;

[0020] Read the configuration parameters in the ConfigMap configuration file and load the configuration parameters into the software context to start the software.

[0021] In some embodiments, the method further comprises:

[0022] When the ConfigMap configuration file is updated, the updated ConfigMap configuration file is automatically obtained and deployed to the minimum operating unit.

[0023] In some embodiments, the engineering files corresponding to the software are developed through the Quarkus framework, and the engineering files corresponding to the software include Docker image files.

[0024] In a second aspect, an embodiment of the present application provides a software startup device based on a Kubernetes cluster, including:

[0025] The project file module is used to create a minimum operating unit after obtaining the project file corresponding to a certain software in the Kubernetes cluster, and deploy the project file to the minimum operating unit;

[0026] The configuration file module is used to obtain the ConfigMap configuration file corresponding to the software from the ConfigMap storage space and deploy the ConfigMap configuration file corresponding to the software to the minimum running unit;

[0027] The software startup module is used to obtain the ConfigMap configuration file corresponding to the software from the minimum running unit to start the software.

[0028] In a third aspect, an embodiment of the present application provides a server, including:

[0029] at least one processor; and

[0030] a memory communicatively connected to at least one processor; wherein,

[0031] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the software startup method based on the Kubernetes cluster as described in the first aspect.

[0032] In a fourth aspect, an embodiment of the present application provides a non-volatile computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are used to enable a server to execute a software startup method based on a Kubernetes cluster as in the first aspect.

[0033] In a fifth aspect, an embodiment of the present application provides a computer program product, including computer program instructions, which, when read and executed by one or more processors, execute the software startup method based on the Kubernetes cluster as described above.

[0034] In an embodiment of the present application, a software startup method, device, server and storage medium based on a Kubernetes cluster are provided. The method includes: after the Kubernetes cluster obtains the engineering file corresponding to a certain software, a minimum operation unit is created, and the engineering file is deployed in the minimum operation unit; the ConfigMap configuration file corresponding to the software is obtained from the ConfigMap storage space, and the ConfigMap configuration file corresponding to the software is mounted on the minimum operation unit; the ConfigMap configuration file corresponding to the software is obtained from the minimum operation unit to start the software. By mounting the ConfigMap configuration file corresponding to the software on the minimum operation unit, the software directly reads the ConfigMap configuration file from the minimum operation unit during the startup process. The present application can improve the loading efficiency of the configuration file, thereby improving the efficiency of software startup. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0036] Figure 1 This is a schematic diagram of the structure of a Kubernetes cluster provided in an embodiment of the present application;

[0037] Figure 2 This is a schematic diagram of the structure of another Kubernetes cluster provided in an embodiment of the present application;

[0038] Figure 3 It is a flowchart of a software startup provided by an embodiment of the present application;

[0039] Figure 4 It is a flowchart of a software startup method based on a Kubernetes cluster provided in an embodiment of the present application;

[0040] Figure 5 yes Figure 4 A detailed flowchart of step S403 in FIG.

[0041] Figure 6 This is a schematic diagram of the overall process of a software startup method based on a Kubernetes cluster provided in an embodiment of the present application;

[0042] Figure 7 It is a schematic diagram of a software startup device based on a Kubernetes cluster provided in an embodiment of the present application;

[0043] Figure 8It is a structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0045] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, all within the scope of protection of the present application. In addition, although the functional module division is performed in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a sequence different from the module division in the device or the flow chart. Furthermore, the words "first", "second", "third", etc. used in this application do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and effects.

[0046] Before explaining the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0047] (1) A Kubernetes cluster is a cluster consisting of a control node (Master) and a load node (Node). The control node (Master) is responsible for the management and control of the entire cluster. The control node (Master) usually occupies an independent server.

[0048] (2) Load node, or Node, refers to a physical host or virtual machine in the Kubernetes cluster. Node is the workload node in the Kubernetes cluster. Each Node will be assigned some workload (Docker container) by the Master. When a Node goes down, its workload will be automatically transferred to other Nodes by the Master. Basic information of the Node: name, label, creation time, etc.

[0049] (3) The smallest operating unit, namely Pod, refers to the most basic deployment and scheduling unit of Kubernetes. It can contain containers and logically represents an instance of a certain application. Each Pod has a special Pause container called the "root container". The image corresponding to the Pause container is part of the Kubernetes platform. In addition to the Pause container, each Pod also contains one or more closely related user business containers.

[0050] See also Figure 1 , Figure 1 This is a schematic diagram of the structure of a Kubernetes cluster provided in an embodiment of the present application;

[0051] like Figure 1 As shown, the Kubernetes cluster 100 includes multiple load nodes 110 and multiple control nodes 120 , wherein each load node 110 is connected to at least one of the multiple control nodes 120 .

[0052] Specifically, each load node 110 is in communication connection with the control node 120, and the load node 110 serves as a workload node in the Kubernetes cluster 100 to run key processes. In the embodiment of the present application, the minimum operation unit runs on the load node 110.

[0053] Among them, multiple control nodes 120 constitute a group of control nodes, which are responsible for the management and control of the entire Kubernetes cluster 100. It can be understood that the number of control nodes 120 in the embodiment of the present application can be one or more than two.

[0054] Take the Kubernetes cluster including one control node (Master) and two load nodes (Node) as an example. Figure 2 , Figure 2 This is a schematic diagram of the structure of another Kubernetes cluster provided in an embodiment of the present application;

[0055] like Figure 2 As shown, the Kubernetes cluster 200 includes a control node 220 , a first load node 211 , and a second load node 212 , wherein the first load node 211 and the second load node 212 are both communicatively connected to the control node 220 .

[0056] Specifically, the first load node 211 includes two minimum operating units (Pod), namely minimum operating unit 1 and minimum operating unit 2, each minimum operating unit is assigned a separate IP address, wherein the minimum operating unit 1 includes two containers (Container), namely container 1 and container 2; the minimum operating unit 2 includes two containers (Container), namely container 3 and container 4.

[0057] Specifically, the second load node 212 includes two minimum operating units (Pod), namely minimum operating unit 3 and minimum operating unit 4, wherein minimum operating unit 3 includes two containers (Container), namely container 1 and container 2; minimum operating unit 4 includes two containers (Container), namely container 3 and container 4.

[0058] ConfigMap is a Kubernetes configuration resource that is saved in the Kubernetes system in the form of one or more key:value pairs for application use. It can be used to represent the value of a variable or the content of a complete configuration file.

[0059] At present, after the software development is completed, the software engineering files are submitted to the Kubernetes cluster for management. Kubernetes is responsible for allocating hardware resources to run the software engineering files, thereby achieving the purpose of running the software. Usually, the software parameters are configured in the ConfigMap configuration file. When the software starts, the ConfigMap configuration file is loaded to start the software.

[0060] For details, please refer to Figure 3 , Figure 3 It is a flowchart of a software startup provided by an embodiment of the present application;

[0061] like Figure 3 As shown in the figure, the process started by the software includes:

[0062] Step S301: software starts;

[0063] Specifically, the minimum operating unit (Pod) starts the engineering file corresponding to the software, for example, a Docker image file.

[0064] Step S302: Download the ConfigMap configuration file;

[0065] Specifically, the minimum operating unit requests the ConfigMap storage space of the Kubernetes cluster to download the ConfigMap configuration file corresponding to the software.

[0066] Step S303: Return the ConfigMap configuration file;

[0067] Specifically, the ConfigMap storage space returns the ConfigMap configuration file corresponding to the software to the minimum running unit.

[0068] Step S304: Load the ConfigMap file content;

[0069] Specifically, the minimum running unit loads the file content of the ConfigMap configuration file corresponding to the software.

[0070] Step S305: normal startup;

[0071] Specifically, the software starts normally.

[0072] From the above steps, it can be seen that during the software startup process, the software needs to request the ConfigMap storage space of the Kubernetes cluster to download the corresponding ConfigMap configuration file of the software. However, since the ConfigMap configuration file needs to be downloaded from the ConfigMap storage space when the software is started, and the naming and path of the ConfigMap configuration file are restricted, the loading efficiency of the configuration file is not high, which affects the efficiency of software startup.

[0073] Based on this, an embodiment of the present application provides a software startup method based on a Kubernetes cluster to improve the loading efficiency of the ConfigMap configuration file, thereby improving the efficiency of software startup.

[0074] See also Figure 4 , Figure 4 It is a flowchart of a software startup method based on a Kubernetes cluster provided in an embodiment of the present application;

[0075] Among them, the software startup method based on the Kubernetes cluster is applied to the server. Specifically, the execution subject of the software startup method based on the Kubernetes cluster is one or more processors of one or more servers.

[0076] like Figure 4 As shown, the software startup method based on the Kubernetes cluster includes:

[0077] Step S401: After the Kubernetes cluster obtains the engineering file corresponding to a certain software, a minimum operating unit is created and the engineering file is deployed in the minimum operating unit;

[0078] Specifically, developers complete software development based on the Quarkus framework, and then package the compiled software and the environment files required for the software to run (such as operating system, JDK, etc.) to generate the corresponding engineering files of the software, such as Docker image files.

[0079] After that, the engineering file corresponding to the software is submitted to the Kubernetes cluster, and the Kubernetes cluster allocates hardware resources to create the smallest operating unit, such as Pod, and deploys the engineering file to the smallest operating unit, such as deploying the Docker image file to the Pod to run the Docker image file on the Pod. It can be understood that the smallest operating unit, such as Pod, can be understood as a computer, which corresponds to corresponding hardware resources such as memory space, hard disk space, CPU, etc.

[0080] Specifically, create a minimum operating unit, including:

[0081] According to the running parameters of the software, a minimum running unit corresponding to the software is created, wherein the running parameters of the software include hard disk parameters, the minimum running unit corresponds to a hard disk space, and the space size corresponding to the hard disk space is not less than the space size corresponding to the hard disk parameters.

[0082] For example: if the hard disk size required for the operation of a certain software is 50GB, then the hard disk parameter included in the operation parameters of the software is 50GB. At this time, the Kubernetes cluster allocates a load node, and the space size of the load node is greater than 50GB, wherein the load node includes a server, that is, a server is allocated, and a minimum operation unit with a hard disk space of not less than 50GB is created, wherein the minimum operation unit corresponds to a hard disk space, and the space size corresponding to the hard disk space is not less than the space size corresponding to the hard disk parameter. Preferably, the space size corresponding to the hard disk space is equal to the space size corresponding to the hard disk parameter. For example: if the hard disk parameter included in the operation parameters of the software is 50GB, then the size of the hard disk space corresponding to the minimum operation unit is also 50GB.

[0083] It is understandable that the operating parameters of the software also include parameters such as memory space and computing power, wherein the computing power is represented by the number of processors, for example, the number of central processing units (CPUs).

[0084] By using the running parameters of the software to create the minimum running unit corresponding to the software, the present application can deploy the engineering files corresponding to the software to the minimum running unit corresponding to the software, thereby providing the necessary running conditions for the software.

[0085] After creating the minimum operation unit, deploy the project file to the minimum operation unit. Specifically, deploying the project file to the minimum operation unit includes:

[0086] Save the project file to the hard disk space corresponding to the smallest running unit.

[0087] Specifically, the project file includes a Docker image file, the minimum operating unit includes a Pod, and the project file is saved to a hard disk space corresponding to the minimum operating unit, for example, the Docker image file is saved to a hard disk of the Pod.

[0088] By deploying the project files in the hard disk space corresponding to the smallest operating unit of the software, the operating parameters of the software can be matched, which is conducive to the operation of the software in the smallest operating unit and improves the operating efficiency of the software.

[0089] Step S402: Obtain the ConfigMap configuration file corresponding to the software from the ConfigMap storage space, and mount the ConfigMap configuration file corresponding to the software on the minimum running unit;

[0090] It is understandable that the ConfigMap storage space is a special storage volume in the Kubernetes cluster that is used to store unencrypted data. In actual applications, configuration data is usually saved in the form of a ConfigMap configuration file. For example, the configuration data required by a software project is collected in a ConfigMap configuration file, and then the ConfigMap configuration file is saved in the ConfigMap storage space of the Kubernetes cluster.

[0091] During the software startup process, you need to obtain the ConfigMap configuration file corresponding to the software from the ConfigMap storage space and mount the ConfigMap configuration file corresponding to the software on the minimum running unit.

[0092] Specifically, mount the ConfigMap configuration file corresponding to the software on the smallest running unit, including:

[0093] The ConfigMap configuration file is saved to the hard disk space corresponding to the minimum running unit. Specifically, the ConfigMap configuration file is saved to a container (Container) in the hard disk space corresponding to the minimum running unit, wherein the ConfigMap configuration file corresponds to a preset path of the hard disk space, and the preset path is stored in a property file in the project file corresponding to the software.

[0094] For example, the ConfigMap configuration file is mounted to the container of the smallest running unit (Pod) through the configuration of the yaml file, wherein the preset path is stored in the property file in the project file corresponding to the software, for example, the project file is developed based on the Quarkus framework, the property file includes the application.properties file, and the preset path is configured through the path configuration parameter of the Quarkus framework, for example, through the quarkus.beaurycamp-configmap.filepath parameter. After the configuration is completed, the preset path is saved in the property file in the project file, for example, the application.properties file.

[0095] By saving the ConfigMap configuration file to the preset path of the hard disk space corresponding to the smallest running unit, it is helpful to quickly obtain the ConfigMap configuration file, thereby improving the startup speed of the software.

[0096] Step S403: Obtain the ConfigMap configuration file corresponding to the software from the minimum running unit to start the software.

[0097] For details, please refer to Figure 5 , Figure 5 yes Figure 4 A detailed flowchart of step S403 in FIG.

[0098] like Figure 5 As shown, step S403: obtaining the ConfigMap configuration file corresponding to the software from the minimum running unit to start the software includes:

[0099] Step S4031: running the engineering file corresponding to the software in the minimum operation unit, and obtaining the preset path of the hard disk space corresponding to the minimum operation unit from the property file in the engineering file corresponding to the software;

[0100] Specifically, the engineering files corresponding to the software are stored in the hard disk space of the minimum running unit, and the engineering files corresponding to the software are run in the minimum running unit, including: decompressing the engineering files corresponding to the software in the hard disk space of the minimum running unit, for example: Docker image files.

[0101] The project file corresponding to the software is decompressed to obtain the property file corresponding to the project file, and the preset path of the hard disk space corresponding to the minimum running unit is obtained from the property file. For example, the property file includes an application.properties file, and the application.properties file is used to save the path of the ConfigMap configuration file corresponding to the software.

[0102] Step S4032: Obtain the ConfigMap configuration file corresponding to the software according to the preset path of the hard disk space corresponding to the minimum running unit;

[0103] Specifically, according to the preset path of the hard disk space corresponding to the minimum running unit, the ConfigMap configuration file corresponding to the software is obtained from the hard disk space of the minimum running unit.

[0104] It is understandable that since the minimum running unit runs on the load node, it is equivalent to obtaining the ConfigMap configuration file corresponding to the software locally. Compared with the method of downloading the ConfigMap configuration file in the ConfigMap storage space, it can improve the loading efficiency of the configuration file, thereby improving the startup efficiency of the software; and, when the software is released in the Kubernetes environment, configmap can be used conveniently, which reduces the requirements for the Kubernetes environment, and it is more convenient to modify the configmap related configuration, without the need to recompile and package the software, which can better integrate the Quarkus framework with configmap.

[0105] On the other hand, since the Kubernetes cluster downloads the ConfigMap configuration file through the HyperText Transfer Protocol (HTTP), anonymous access needs to be enabled in the Kubernetes environment, which leads to certain requirements for the Kubernetes environment and may cause security issues. The solution in this application pre-mounts the ConfigMap configuration file on the minimum operating unit, allowing users to seamlessly use the Quarkus framework in the Kubernetes environment, which is conducive to facilitating the management of the minimum operating unit and saving service hardware costs.

[0106] Step S4033: Read the configuration parameters in the ConfigMap configuration file, and load the configuration parameters into the context of the software to start the software.

[0107] Specifically, after obtaining the ConfigMap configuration file, the configuration parameters in the ConfigMap configuration file are read, and the configuration parameters are loaded into the context of the software, wherein the software is developed through the Quarkus framework, that is, the engineering files corresponding to the software are developed through the Quarkus framework.

[0108] It can be understood that the context of software refers to the collection of resources required during the operation of the software. For example, when the software of the Quarkus framework is started, all the resources required for the software operation process will be saved in the context, where the context includes configuration data, executable files, and the relationship between resources.

[0109] Specifically, the context includes a configuration resource file, such as a configSource file, and loading configuration parameters into the context of the software includes saving configuration parameters into the configuration resource file of the context, such as a configSource file. In an embodiment of the present application, the configuration resource file of the context is also used to include configuration data of the database, such as a database user name, password; software name; listening port and other information.

[0110] It can be understood that after the configuration parameters are loaded into the context of the software, the target node starts the software, wherein the target node is a load node, and the load node is a load node that runs the minimum running unit.

[0111] Please refer to Figure 6 , Figure 6 This is a schematic diagram of the overall process of a software startup method based on a Kubernetes cluster provided in an embodiment of the present application;

[0112] like Figure 6 As shown in the figure, the overall process of the software startup method based on the Kubernetes cluster includes:

[0113] Step S601: The Kubernetes cluster obtains the engineering files corresponding to the software;

[0114] Specifically, developers complete software development based on the Quarkus framework, and then package the compiled software and the environment files required for the software to run (such as operating system, JDK, etc.) to generate the corresponding engineering files of the software, such as Docker image files, and publish the corresponding engineering files of the software to the Kubernetes cluster, so that the Kubernetes cluster obtains the corresponding engineering files of the software.

[0115] Step S602: The Kubernetes cluster creates a minimum operating unit;

[0116] Specifically, the Kubernetes cluster creates a minimum operating unit corresponding to the software according to the operating parameters of the software, wherein the operating parameters of the software include hard disk parameters, the minimum operating unit corresponds to a hard disk space, and the space size corresponding to the hard disk space is not less than the space size corresponding to the hard disk parameters.

[0117] It is understandable that the minimum operating unit is equivalent to a computer, which has its own hardware resources such as memory, hard disk, CPU, etc. For example, if the software operating parameters require 50GB hard disk space, 10GB memory, and 2 CPUs, the Kubernetes cluster will divide these resources into a minimum operating unit, such as Pod, on the server that meets the operating parameters. Among them, the server that meets the operating parameters is the load node in the Kubernetes cluster.

[0118] Step S603: The Kubernetes cluster deploys the project file to the smallest operating unit;

[0119] Specifically, the Kubernetes cluster deploys the project file to the minimum operating unit, where the minimum operating unit runs on the load node in the Kubernetes cluster, that is, the load node in the Kubernetes cluster determined in the above steps.

[0120] Step S604: The Kubernetes cluster requests the ConfigMap configuration file;

[0121] Specifically, the Kubernetes cluster requests the ConfigMap configuration file corresponding to the software from the ConfigMap storage space.

[0122] It is understandable that the user saves the contents of the configuration file to the ConfigMap storage space. The file name can be used as the key, and the value is the content of the entire file. Multiple configuration files can be placed in the same ConfigMap storage space.

[0123] Step S605: The ConfigMap storage space returns the ConfigMap configuration file;

[0124] Specifically, the ConfigMap storage space returns the ConfigMap configuration file to the Kubernetes cluster.

[0125] Step S606: The Kubernetes cluster saves the ConfigMap configuration file;

[0126] Specifically, the Kubernetes cluster mounts the ConfigMap configuration file corresponding to the software to the smallest running unit, including:

[0127] The ConfigMap configuration file is saved to the hard disk space corresponding to the minimum running unit. Specifically, the ConfigMap configuration file is saved to a container (Container) in the hard disk space corresponding to the minimum running unit, wherein the ConfigMap configuration file corresponds to a preset path of the hard disk space, and the preset path is stored in a property file in the project file corresponding to the software.

[0128] For example, the ConfigMap configuration file is mounted to the container of the smallest running unit (Pod) through the configuration of the yaml file, wherein the preset path is stored in the property file in the project file corresponding to the software, for example, the project file is developed based on the Quarkus framework, the property file includes the application.properties file, and the preset path is configured through the path configuration parameter of the Quarkus framework, for example, through the quarkus.beaurycamp-configmap.filepath parameter. After the configuration is completed, the preset path is saved in the property file in the project file, for example, the application.properties file.

[0129] Step S607: the minimum operation unit starts the project file;

[0130] Specifically, the minimum operating unit starts the engineering file corresponding to the software, including: decompressing the engineering file corresponding to the software to the hard disk space of the minimum operating unit, wherein the engineering file corresponding to the software includes a Docker image file.

[0131] Step S608: The minimum operating unit reads the ConfigMap configuration file;

[0132] Specifically, the minimum operating unit reads the configuration parameters in the ConfigMap configuration file.

[0133] Step S609: The minimum running unit loads the configuration parameters in the ConfigMap configuration file into the context of the software to start the software.

[0134] Specifically, the minimum operating unit loads the configuration parameters in the ConfigMap configuration file into the context of the software, wherein the software is developed through the Quarkus framework, that is, the engineering files corresponding to the software are developed through the Quarkus framework.

[0135] In some embodiments, the method further comprises:

[0136] When the ConfigMap configuration file is updated, the updated ConfigMap configuration file is automatically obtained and deployed to the minimum operating unit.

[0137] Specifically, after the content of the ConfigMap configuration file is modified, the Kubernetes cluster will automatically re-obtain the content of the ConfigMap configuration file and deploy the updated ConfigMap configuration file to the minimum operating unit, where the minimum operating unit runs on the target node, which is equivalent to updating the corresponding ConfigMap configuration file on the target node, where the target node refers to the load node corresponding to the ConfigMap configuration file.

[0138] When modeling the user's software, application or program, in the smallest operating unit, such as Pod, define the ConfigMap configuration file as a special storage volume for mounting. When the smallest operating unit is scheduled to a specific load node (Node), the ConfigMap configuration file in the ConfigMap storage space will be automatically restored to the local directory of the load node, and then mapped to the configuration directory specified by the smallest operating unit, so that the user's software, application or program can read the ConfigMap configuration file without perception, thereby improving the efficiency of software startup.

[0139] It should be noted that in each of the above embodiments, there is not necessarily a certain order between the above steps. A person skilled in the art can understand, based on the description of the embodiments of the present application, that in different embodiments, the above steps may have different execution orders, that is, they may be executed in parallel, may be executed interchangeably, and so on.

[0140] In an embodiment of the present application, a software startup method based on a Kubernetes cluster is provided, the method comprising: after the Kubernetes cluster obtains the engineering file corresponding to a certain software, creating a minimum operation unit, and deploying the engineering file to the minimum operation unit; obtaining the ConfigMap configuration file corresponding to the software from the ConfigMap storage space, and mounting the ConfigMap configuration file corresponding to the software on the minimum operation unit; obtaining the ConfigMap configuration file corresponding to the software from the minimum operation unit to start the software. By mounting the ConfigMap configuration file corresponding to the software on the minimum operation unit, the software directly reads the ConfigMap configuration file from the minimum operation unit during the startup process. The present application can improve the loading efficiency of the configuration file, thereby improving the efficiency of software startup.

[0141] As another aspect of the embodiment of the present application, the embodiment of the present application provides a software startup device based on a Kubernetes cluster. Wherein, the software startup device based on a Kubernetes cluster can be a software module, and the software module includes a number of instructions, which are stored in a memory, and the processor can access the memory and call the instructions for execution to complete the software startup method based on the Kubernetes cluster described in the above embodiments.

[0142] Please refer to Figure 7 , Figure 7 It is a schematic diagram of a software startup device based on a Kubernetes cluster provided in an embodiment of the present application;

[0143] Among them, the software startup device based on the Kubernetes cluster is applied to a server. Specifically, the software startup method based on the Kubernetes cluster is applied to one or more processors of one or more servers.

[0144] Among them, the software startup device based on the Kubernetes cluster can be a software module, which includes a number of instructions stored in a memory. The processor can access the memory and call the instructions for execution to complete the software startup method based on the Kubernetes cluster described in the above-mentioned embodiments.

[0145] like Figure 7 As shown, the software startup device 70 based on the Kubernetes cluster includes:

[0146] The project file module 701 is used to create a minimum operation unit after obtaining the project file corresponding to a certain software in the Kubernetes cluster, and deploy the project file to the minimum operation unit;

[0147] The configuration file module 702 is used to obtain the ConfigMap configuration file corresponding to the software from the ConfigMap storage space, and deploy the ConfigMap configuration file corresponding to the software in the minimum running unit;

[0148] The software startup module 703 is used to obtain the ConfigMap configuration file corresponding to the software from the minimum running unit to start the software.

[0149] In an embodiment of the present application, a software startup device based on a Kubernetes cluster can also be constructed by hardware devices. For example, a software startup device based on a Kubernetes cluster can be constructed by one or more chips, and each chip can work in coordination with each other to complete the software startup method based on a Kubernetes cluster described in the above embodiments. For another example, a software startup device based on a Kubernetes cluster can also be constructed by various logic devices, such as a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISC Machine) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of these components.

[0150] The software startup device based on the Kubernetes cluster in the embodiment of the present application can be a device, or a component, an integrated circuit, or a chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and the non-mobile electronic device can be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and the embodiment of the present application is not specifically limited.

[0151] The Kubernetes cluster-based software startup device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0152] The software startup device based on Kubernetes cluster provided in the embodiment of the present application can achieve Figure 4 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0153] It should be noted that the above-mentioned software startup device based on Kubernetes cluster can execute the software startup method based on Kubernetes cluster provided in the embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in the embodiment of the software startup device based on Kubernetes cluster, please refer to the software startup method based on Kubernetes cluster provided in the embodiment of the present application.

[0154] In an embodiment of the present application, a software startup device based on a Kubernetes cluster is provided, and the device includes: a project file module, which is used to create a minimum operation unit after the Kubernetes cluster obtains the project file corresponding to a certain software, and deploys the project file to the minimum operation unit; a configuration file module, which is used to obtain the ConfigMap configuration file corresponding to the software from the ConfigMap storage space, and deploy the ConfigMap configuration file corresponding to the software to the minimum operation unit; a software startup module, which is used to obtain the ConfigMap configuration file corresponding to the software from the minimum operation unit to start the software. By mounting the ConfigMap configuration file corresponding to the software on the minimum operation unit, the software directly reads the ConfigMap configuration file from the minimum operation unit during the startup process. The present application can improve the loading efficiency of the configuration file, thereby improving the efficiency of software startup.

[0155] Please refer to Figure 8 , Figure 8 It is a structural diagram of a server provided in an embodiment of the present application;

[0156] like Figure 8 As shown, the server 80 includes one or more processors 801 and a memory 802. Figure 8 A processor 801 is taken as an example.

[0157] The processor 801 and the memory 802 may be connected via a bus or other means. Figure 8 The example of connecting through bus is taken in the following.

[0158] The memory 802, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as the program instructions / modules corresponding to the software startup method based on the Kubernetes cluster in the embodiment of the present application. The processor 801 executes various functional applications and data processing by running the non-volatile software programs, instructions and modules stored in the memory 802, that is, realizing the functions of the software startup method based on the Kubernetes cluster provided in the above method embodiment and the various modules or units in the above device embodiment.

[0159] The memory 802 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 802 may optionally include a memory remotely arranged relative to the processor 801, and these remote memories may be connected to the processor 801 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0160] The program instructions / modules are stored in the memory 802, and when executed by one or more processors 801, the software startup method based on the Kubernetes cluster in any of the above method embodiments is executed.

[0161] The server 80 of the embodiment of the present application exists in various forms. Figure 4 The various steps shown; when the functions of each unit can also be implemented, the above-mentioned server 80 includes but is not limited to: a tower server, a rack server, a blade server and a cloud server.

[0162] The present application also provides a non-volatile computer storage medium, which stores computer executable instructions, and the computer executable instructions are executed by one or more processors, such as Figure 8 A processor 801 in the embodiment may enable the one or more processors to execute the software startup method based on the Kubernetes cluster in any of the above method embodiments.

[0163] The embodiment of the present application also provides a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a server, the server executes the above-mentioned software startup method based on a Kubernetes cluster. When the program or instructions are executed by a processor, the various processes of the above-mentioned software startup method based on a Kubernetes cluster embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not repeated here.

[0164] By mounting the ConfigMap configuration file corresponding to the software on the minimum running unit, the software can directly read the ConfigMap configuration file from the minimum running unit during the startup process. This application can improve the loading efficiency of the configuration file, thereby improving the efficiency of software startup.

[0165] The embodiment of the present application also provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, the processor is used to run a program or instruction, implement the various processes of the above-mentioned software startup method embodiment based on the Kubernetes cluster, and can achieve the same technical effect. To avoid repetition, it is not repeated here. It should be understood that the chip mentioned in the embodiment of the present application can also be called a system-level chip, a system chip, a chip system, or a system-on-chip chip, etc.

[0166] The above-described device or equipment embodiments are merely illustrative, wherein the unit modules described as separate components may or may not be physically separated, and the components displayed as module units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network module units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.

[0167] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0168] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes in different aspects of the present application as above, which are not provided in detail for the sake of simplicity. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A software startup method based on Kubernetes cluster, characterized in that: The method comprises: After the Kubernetes cluster obtains the engineering file corresponding to a certain software, a minimum operation unit is created, and the engineering file is deployed in the minimum operation unit, wherein the minimum operation unit corresponds to a hard disk space; Obtaining the ConfigMap configuration file corresponding to the software from the ConfigMap storage space, and mounting the ConfigMap configuration file corresponding to the software on the minimum running unit; Obtaining a ConfigMap configuration file corresponding to the software from the minimum running unit to start the software; The step of deploying the engineering file to the minimum operation unit includes: Saving the project file to the hard disk space corresponding to the minimum operation unit; The step of mounting the ConfigMap configuration file corresponding to the software on the minimum operating unit includes: The ConfigMap configuration file is saved to the hard disk space corresponding to the minimum running unit, wherein the ConfigMap configuration file corresponds to a preset path of the hard disk space, and the preset path is stored in a property file in the project file corresponding to the software.

2. The method according to claim 1, characterized in that The creating of the minimum operation unit includes: According to the running parameters of the software, a minimum running unit corresponding to the software is created, wherein the running parameters of the software include hard disk parameters, and the space size corresponding to the hard disk space is not less than the space size corresponding to the hard disk parameters.

3. The method according to claim 1, characterized in that: The obtaining the ConfigMap configuration file corresponding to the software from the minimum running unit to start the software includes: Running the engineering file corresponding to the software in the minimum operation unit, and obtaining the preset path of the hard disk space corresponding to the minimum operation unit from the property file in the engineering file corresponding to the software; Obtaining a ConfigMap configuration file corresponding to the software according to a preset path of the hard disk space corresponding to the minimum running unit; The configuration parameters in the ConfigMap configuration file are read, and the configuration parameters are loaded into the context of the software to start the software.

4. The method according to claim 1 or 2, characterized in that: The method further comprises: When the ConfigMap configuration file is updated, the updated ConfigMap configuration file is automatically obtained and deployed to the minimum operating unit.

5. The method according to claim 1 or 2, characterized in that: The engineering files corresponding to the software are developed through the Quarkus framework, and the engineering files corresponding to the software include Docker image files.

6. A software startup device based on Kubernetes cluster, characterized in that: include: The project file module is used to create a minimum operation unit after obtaining the project file corresponding to a certain software in the Kubernetes cluster, and deploy the project file in the minimum operation unit, wherein the minimum operation unit corresponds to a hard disk space; A configuration file module is used to obtain the ConfigMap configuration file corresponding to the software from the ConfigMap storage space, and deploy the ConfigMap configuration file corresponding to the software in the minimum running unit; A software startup module, used to obtain a ConfigMap configuration file corresponding to the software from the minimum running unit to start the software; Project file module, specifically used for: Saving the project file to the hard disk space corresponding to the minimum operation unit; Configuration file module, specifically used for: The ConfigMap configuration file is saved to the hard disk space corresponding to the minimum running unit, wherein the ConfigMap configuration file corresponds to a preset path of the hard disk space, and the preset path is stored in a property file in the project file corresponding to the software.

7. A server, characterized in that: include: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the software startup method based on the Kubernetes cluster as described in any one of claims 1-5.

8. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the server to execute the software startup method based on the Kubernetes cluster as described in any one of claims 1 to 5.