PaaS service construction method and device, equipment and medium
By obtaining PaaS service instance information and creating configuration files using preset service templates, combined with the Kubernetes cluster interface, the automated creation of PaaS service instances is achieved, solving the problems of high development costs and low efficiency, improving creation efficiency and reducing development complexity.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-09
- Publication Date
- 2026-03-13
AI Technical Summary
In the current technology, the PaaS services of mainstream cloud vendors need to be developed and customized separately, and the development cost is high and the efficiency is low each time a new PaaS service is launched.
By obtaining PaaS service instance information, creating configuration files using preset service templates, and calling the target creation component interface of the Kubernetes cluster container orchestration platform, the automated creation of PaaS service instances is achieved.
Eliminating the need for separate development and customization each time improves the efficiency of PaaS service instance resource creation, reduces development costs and complexity, and enhances development efficiency.
Smart Images

Figure CN121664660A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a method, apparatus, device and medium for building PaaS services. Background Technology
[0002] Platform as a Service (PaaS) is a model that provides an application development and deployment environment via the Internet. It provides users with a complete platform for developing, running, and managing applications. Developers do not need to worry about the maintenance of the underlying infrastructure (such as servers, storage, networks, etc.) and can focus solely on application development and deployment. This allows developers to quickly build, deploy, and manage applications, thus becoming the core engine of modern application development.
[0003] However, the PaaS services of mainstream cloud vendors are currently built on cloud-native technology stacks. Each time a new PaaS service is launched, it needs to be developed and customized separately, which results in high development costs and low efficiency. Summary of the Invention
[0004] To address the aforementioned technical issues, this disclosure provides a PaaS service construction method, apparatus, device, and medium.
[0005] A first aspect of this disclosure provides a PaaS service construction method, including: Obtain service instance information for the Platform as a Service (PaaS) service instance. The service instance information includes at least one of the following: name, service type, version, storage space size, Internet Protocol IP address, CPU information, memory size, and password. Determine the service template corresponding to the service instance information from at least one preset service template, and create a configuration file corresponding to the PaaS service instance based on the service instance information and service template. The configuration file is used to define the resource configuration corresponding to the PaaS service. Based on the template type corresponding to the service template, the target creation component interface in the Kubernetes cluster of the container orchestration platform is called, and the instance resources corresponding to the PaaS service instance are created based on the target creation component interface and the configuration file.
[0006] A second aspect of this disclosure provides a PaaS service building apparatus, comprising: The instance information acquisition module is used to acquire service instance information of the Platform as a Service (PaaS) service instance. The service instance information includes at least one of the following: name, service type, version, storage space size, Internet Protocol IP address, CPU information, memory size, and password. The configuration file creation module is used to determine the service template corresponding to the service instance information from at least one preset service template, and to create the configuration file corresponding to the PaaS service instance based on the service instance information and the service template. The configuration file is used to define the resource configuration corresponding to the PaaS service. The PaaS service building module is used to call the target creation component interface in the container orchestration platform Kubernetes cluster based on the template type corresponding to the service template, and to create instance resources corresponding to the PaaS service instance based on the target creation component interface and configuration file.
[0007] A third aspect of this disclosure provides an electronic device, including: processor; Memory, used to store executable instructions; The processor is used to read executable instructions from memory and execute the executable instructions to implement the PaaS service construction method provided in the first aspect above.
[0008] A fourth aspect of this disclosure provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to implement the PaaS service construction method provided in the first aspect.
[0009] A fifth aspect of this disclosure provides a computer program product comprising a computer program or instructions that, when executed by a processor, implement the PaaS service construction method of the first aspect described above.
[0010] The technical solution provided in this disclosure has the following advantages compared with the prior art: The PaaS service construction method, apparatus, device, and medium provided in this disclosure can obtain service instance information of a PaaS service instance, wherein the service instance information includes at least one of the following: name, service type, version, storage space size, Internet Protocol IP address, CPU information, memory size, and password. After obtaining the service instance, a service template corresponding to the service instance information is determined from at least one preset service template. A configuration file corresponding to the PaaS service instance is created based on the service instance information and the service template, wherein the configuration file is used to define the resource configuration corresponding to the PaaS service. Based on the template type corresponding to the service template, the target creation component interface in the Kubernetes cluster of the container orchestration platform is called, and then the instance resources corresponding to the PaaS service instance are created based on the target creation component interface and the configuration file. Thus, the creation of different types of PaaS services can be met through service templates, eliminating the need for separate development and customization each time. At the same time, the creation of instance resources through the Kubernetes cluster improves the efficiency of instance resource creation, reduces the complexity of PaaS service development, and thus reduces the development cost of PaaS services and improves development efficiency. Attached Figure Description
[0011] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0012] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 This is a flowchart of a PaaS service construction method provided in an embodiment of this disclosure; Figure 2 This is a flowchart of a PaaS service instance update method provided in an embodiment of this disclosure; Figure 3 This is a flowchart of a PaaS service instance deletion method provided in an embodiment of this disclosure; Figure 4 This is a flowchart of another PaaS service construction method provided in this disclosure embodiment; Figure 5 This is a schematic diagram of the structure of a PaaS service building device provided in an embodiment of this disclosure; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0014] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0015] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.
[0016] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0017] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0018] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0019] Typically, mainstream cloud vendors' PaaS services are built on cloud-native technology stacks. Each new PaaS service requires separate development and customization, resulting in high development costs and low efficiency. To address this issue, this disclosure provides a PaaS service construction method, which is described below with reference to specific embodiments.
[0020] Figure 1This is a flowchart of a PaaS service construction method provided in an embodiment of the present disclosure. The method can be executed by a PaaS service construction device, which can be implemented in software and / or hardware. The PaaS service construction device can be configured in an electronic device, such as a server or terminal, wherein the terminal specifically includes a mobile phone, computer or tablet computer, etc.
[0021] like Figure 1 As shown, the PaaS service construction method provided in this embodiment includes the following steps.
[0022] S110. Obtain the service instance information of the Platform as a Service (PaaS) service instance.
[0023] In this embodiment of the disclosure, the service instance information includes at least one of the following: service instance name, service type, version, storage space size, Internet Protocol IP address, central processing unit CPU information, password, and memory size.
[0024] Specifically, users can fill in the service instance information of the PaaS service instance according to their needs on the interactive interface, and the PaaS service building device can obtain the service instance information in response to the user's configuration filling operation.
[0025] S120. Determine the service template corresponding to the service instance information from at least one preset service template, and create a configuration file corresponding to the PaaS service instance based on the service instance information and the service template.
[0026] In this embodiment of the disclosure, the configuration file is used to define the resource configuration corresponding to the PaaS service instance.
[0027] Specifically, the PaaS service building device can determine at least one service template corresponding to the service instance information from at least one preset service template based on the service type of the service instance in the service instance information and the correspondence between the service type and the preset service template. The at least one service template and the service instance information are then input into a preset template engine, and a configuration file corresponding to the PaaS service instance is created based on the preset template engine.
[0028] The preset template engine can be any existing general-purpose tool used to generate text output based on templates. For example, the preset template engine can be the FreeMarker engine.
[0029] In some embodiments of this disclosure, when there are command configurations in the configuration file, a script file corresponding to the command configurations in the configuration file is further generated. The script file is used to execute operational logic. The script file may include at least one command script that needs to be executed during the startup process of the PaaS service instance.
[0030] S130. Based on the template type corresponding to the service template, call the target creation component interface in the container orchestration platform Kubernetes cluster, and create instance resources corresponding to the PaaS service instance based on the target creation component interface and the configuration file.
[0031] In this embodiment of the disclosure, the target creation component interface is the interface corresponding to the various instance resources required to create a PaaS service instance. The number of target creation component interfaces can be one or more, depending on the template type.
[0032] For example, the target creation component interface may include a configuration management component interface (such as createNamespacedConfigMap) for creating configuration mapping objects, a component interface (such as createNamespacedService) for creating service objects, a component interface (such as createNamespacedStatefulSet) for creating stateful replica set objects, and so on.
[0033] Specifically, the PaaS service building device can determine at least one target creation component interface corresponding to the template type corresponding to each service template, and call at least one target creation component interface to create instance resources corresponding to the PaaS service instance based on the target creation component interface and the configuration file.
[0034] In this embodiment, service instance information for a Platform as a Service (PaaS) service instance can be obtained. This service instance information includes at least one of the following: name, service type, version, storage space size, Internet Protocol (IP) address, CPU information, memory size, and password. After obtaining the service instance, a service template corresponding to the service instance information is determined from at least one preset service template. A configuration file corresponding to the PaaS service instance is created based on the service instance information and the service template, where the configuration file defines the resource configuration corresponding to the PaaS service. The target creation component interface in the Kubernetes cluster of the container orchestration platform is called based on the template type corresponding to the service template. Then, the instance resources corresponding to the PaaS service instance are created based on the target creation component interface and the configuration file. Therefore, service templates can be used to meet the creation needs of different types of PaaS services, eliminating the need for separate development and customization each time. Simultaneously, using a Kubernetes cluster to create instance resources improves the efficiency of instance resource creation, reduces the complexity of PaaS service development, and thus reduces the development cost and improves development efficiency.
[0035] Based on the above embodiments disclosed herein, in order to facilitate subsequent operations such as viewing and modifying service instance information, the service instance information can be stored after it is obtained.
[0036] Specifically, after obtaining the service instance information for building the PaaS service instance, the PaaS service construction method may further include: storing the service instance information in a preset instance basic information table in a preset database; establishing a connection between the PaaS service instance and the Ceph cluster based on a preset connection command and the key corresponding to the distributed storage system Ceph cluster; and, if it is determined that the storage requirements of the PaaS service instance will be mounted to the Ceph cluster, controlling the Ceph cluster to generate storage blocks based on the storage space size, and mounting the PaaS service instance to the storage blocks.
[0037] In this embodiment of the disclosure, the preset database can be a pre-set relational database or other types of databases, and there is no limitation herein. Specifically, the preset database can be used to store storage instance information.
[0038] In this embodiment of the disclosure, the preset instance basic information table is a pre-set data table used to store PaaS service instance information. The PaaS service instance information may include the service instance's name, service type, version, storage space size, Internet Protocol IP address, CPU information, password, memory size, etc.
[0039] In some embodiments of this disclosure, after obtaining service instance information, the PaaS service building device can call an insertion command to insert the values corresponding to each variable in the service instance information into a preset instance basic information table based on the insertion command, so as to store the service instance information in the preset instance basic information table in the preset database.
[0040] In other embodiments of this disclosure, the PaaS service building apparatus can determine whether to mount the PaaS service instance storage requirements to the Ceph cluster after obtaining the service instance information. If it is determined that the PaaS service instance storage requirements should be mounted to the Ceph cluster, the storage space size is sent to the Ceph cluster, the Ceph cluster is controlled to generate storage blocks based on the storage space size, and the PaaS service instance is mounted to the storage blocks.
[0041] The specific implementation method for generating storage blocks is similar to the existing method for generating storage blocks based on Ceph clusters, and will not be described in detail here.
[0042] In this embodiment of the disclosure, service instance information can be stored in the instance basic information table, which facilitates subsequent changes to the service instance information. At the same time, the service instance storage requirements can be mounted to the Ceph cluster in the form of block storage, ensuring the convenience, high scalability and high reliability of the storage of service instance related information.
[0043] In this embodiment of the disclosure, in order to ensure the effectiveness and reliability of the target creation component interface call in the k8s cluster, the running status of the k8s cluster is monitored when the target creation component interface is called.
[0044] In this embodiment of the disclosure, calling the target creation component interface in the container orchestration platform Kubernetes cluster based on the template type corresponding to the service template may specifically include: obtaining the token information of the Kubernetes cluster; monitoring the running status of the Kubernetes cluster based on the token information and preset monitoring commands; determining that the running status of the Kubernetes cluster is normal, and calling the target creation component interface based on the template type corresponding to the service template.
[0045] Specifically, the PaaS service building device can obtain the token information of the Kubernetes cluster, invoke a preset monitoring command, and have the preset monitoring command monitor the running status of the Kubernetes cluster based on the token information, returning the monitoring results. If the monitoring results determine that the Kubernetes cluster is running normally, the target component creation interface is invoked based on the template type corresponding to the service template.
[0046] In this embodiment of the disclosure, by monitoring the running status of the Kubernetes cluster, it is ensured that the corresponding component interfaces are called to create instance resources when the Kubernetes running status is normal, thereby improving the reliability and accuracy of instance resource creation.
[0047] In this embodiment of the disclosure, in order to ensure the normal startup and operation of the created service instance, a ready probe is set in the configuration file. After the instance resources corresponding to the PaaS service instance are created, the status of the PaaS service instance is monitored based on the ready probe.
[0048] In this embodiment of the disclosure, after creating instance resources corresponding to the PaaS service instance based on the target creation component interface and configuration file, the PaaS service construction method may further include: performing a loop monitoring operation when the readiness probe detects that the service instance's state has not reached the ready state; and deleting the instance resources and service instance information when the number of loop monitoring operations reaches a preset threshold and the PaaS service instance's state still has not reached the ready state. Alternatively, determining that the PaaS service instance creation is complete when the readiness probe detects that the PaaS service instance's state has reached the ready state.
[0049] In this embodiment of the disclosure, the preset number threshold is a pre-set maximum number of times the status of the service instance is monitored.
[0050] Readiness probes are used to monitor the status of PaaS service instances.
[0051] Specifically, after creating the instance resources corresponding to the PaaS service instance, the PaaS service building device can monitor the status of the service instance based on a readiness probe to determine whether the service instance has reached the ready state. If the monitoring result indicates that the service instance has not reached the ready state, a loop monitoring operation is performed to continue monitoring the status of the service instance. If the number of monitoring attempts reaches a preset threshold and the PaaS service instance still has not reached the ready state, it indicates that the PaaS service instance creation has failed, and the relevant information of the PaaS service instance is deleted, that is, the instance resources and service instance information are deleted. When the monitoring result indicates that the service instance has reached the ready state, the PaaS service instance creation is determined to be complete, and the loop monitoring operation stops.
[0052] Deleting service instance information can include deleting the preset instance basic information table corresponding to the service instance information. Additionally, when it is determined that the service instance information is stored in block storage within the Ceph cluster, the storage block corresponding to the service instance information is deleted.
[0053] In this embodiment of the disclosure, by monitoring the readiness status of the service instance, the normal startup and operation of the service instance is ensured. At the same time, if it is determined that the service instance has not reached the ready state, the service instance creation is determined to have failed. In order to avoid the impact on subsequent service instance creation, the relevant information of the service instance is deleted.
[0054] In this embodiment of the disclosure, users can customize the configuration of PaaS service instances and perform operations such as updating and deleting PaaS service instances to ensure that PaaS service instances meet the user's personalized needs.
[0055] Figure 2 This is a flowchart of a PaaS service instance update method provided in this disclosure embodiment, such as... Figure 2 As shown, after creating instance resources corresponding to the PaaS service instance based on the target creation component interface and configuration file, the PaaS service construction method may further include: S210, Receive user modification operation on at least one piece of information included in the service instance information.
[0056] In this embodiment of the disclosure, the modification operation may include an operation to modify the storage space size included in the service instance information; it may also include an operation to modify information other than the storage space size included in the service instance information.
[0057] Specifically, the PaaS service building device can receive user operations in real time to modify at least one piece of information in the service instance information of the PaaS service instance according to their needs through the interactive interface.
[0058] S220. In response to the modification operation, determine the execution policy, which is used to modify the storage blocks corresponding to the PaaS service instances in the Ceph cluster, and / or to modify the PaaS service instances.
[0059] Specifically, the PaaS service building device can determine a specific execution strategy based on the modification information or modification variables corresponding to the modification operation, and modify and update the PaaS service instance according to the execution strategy. Specifically, when the modification operation modifies the storage space size included in the service instance information, the execution strategy is a first execution strategy, which is a strategy to update the storage space size corresponding to the PaaS service instance based on the target storage space size indicated by the modification operation. When the modification operation modifies information other than the storage space size included in the service instance information, the execution strategy is a second execution strategy, which is a strategy to update the PaaS service instance based on the target modification value corresponding to the target variable indicated by the modification operation.
[0060] S230. Update the PaaS service instance based on the execution policy.
[0061] In some embodiments of this disclosure, when the execution strategy is the first execution strategy, updating the PaaS service instance based on the execution strategy may specifically include: updating the storage space size corresponding to the PaaS service instance in the preset instance basic information table to the target storage space size, thereby updating the preset instance basic information table; if there is a storage block corresponding to the PaaS service instance in the Ceph cluster, updating the storage space size of the storage block in the Ceph cluster to the target storage space size; simultaneously, obtaining the target IP address of the physical host where the PaaS service instance is located; establishing a communication connection with the physical host based on the target IP address to obtain the file system name of the storage block corresponding to the PaaS service instance; updating the storage space size of the storage block in the operating system-level inode corresponding to the file system name to the target storage space size, thereby updating the storage space size of the storage block corresponding to the PaaS service instance.
[0062] In other embodiments of this disclosure, when the execution strategy is the second execution strategy, updating the PaaS service instance based on the execution strategy may specifically include: updating the value of the target variable corresponding to the PaaS service instance in the preset instance basic information table to the target modified value; updating the configuration file corresponding to the PaaS service instance based on the target modified value; updating the instance resources based on the updated configuration file; determining the target operation command based on the service type and target variable corresponding to the PaaS service instance; and executing the target operation command to update the PaaS service instance.
[0063] Among them, the target operation command is an operation command used to modify the target variable in the PaaS service instance.
[0064] In this embodiment, the PaaS service building device, upon receiving a user's modification operation, parses the operation, determines the target variable corresponding to the modification operation, and updates the value of the target variable corresponding to the PaaS service instance in the preset instance basic information table to the target modified value. Simultaneously, it inputs the modified service instance information and the corresponding service template into a preset template engine, recreates the configuration file corresponding to the PaaS service instance based on the preset template engine, updates the configuration file, and updates the instance resources based on the updated configuration file. Based on the service type corresponding to the PaaS service instance and the correspondence between service types and operation commands, it determines multiple operation commands corresponding to that service type, and selects the target operation command that matches the target variable from among these multiple operation commands. Therefore, PaaS service instances can be updated via command line, avoiding the need to restart the service when updating PaaS service instances.
[0065] In this embodiment of the disclosure, the information included in the service instance information, in addition to the storage space size, includes the version corresponding to the PaaS service instance. By configuring the version in the service instance information, users can select a version that meets their needs, or change the version according to their requirements, thus achieving the effect of supporting multiple version instances on the same PaaS platform for different users.
[0066] In this embodiment, PaaS service instances can be updated or modified in a user-defined manner, ensuring that the PaaS service instances can meet the user's personalized needs. When modifying the variable to storage space, not only is the storage space size of the storage blocks in the Ceph cluster adjusted, but the storage space size in the operating system-level index nodes can also be updated, ensuring the normal availability of service instance storage. Furthermore, when modifying variables other than storage space, the configuration file can be directly modified, and the service instance can be modified and updated via command line, without needing to restart the service instance.
[0067] In this embodiment of the disclosure, after constructing a PaaS service instance, the PaaS service instance can also be deleted in response to a user's deletion operation, thereby avoiding the occupation of resources by invalid or unnecessary PaaS service instances.
[0068] Figure 3 This is a flowchart of a PaaS service instance deletion method provided in this disclosure embodiment, such as... Figure 3 As shown, after creating the instance resources corresponding to the PaaS service instance based on the target creation component interface and configuration file, the PaaS service instance is deleted. The PaaS service instance deletion method can specifically include the following steps: S310. In response to the user's deletion operation on the PaaS service instance, delete the service instance information, and call the target deletion component interface corresponding to the PaaS service instance in the Kubernetes cluster based on the template type, and delete the instance resources based on the target deletion component interface and the configuration file.
[0069] In this embodiment of the disclosure, the deletion operation can be an operation performed by the user on the interactive interface to delete a PaaS service instance. The user can select any PaaS service instance to delete based on user permissions on the interactive interface.
[0070] In this embodiment of the disclosure, deleting service instance information may include deleting the service instance information from the preset instance basic information table corresponding to the PaaS service instance; it may also include deleting the storage block corresponding to the service instance information in the Ceph cluster.
[0071] In this embodiment of the disclosure, the PaaS service building device can determine at least one target deletion component interface corresponding to the template type from the k8s cluster based on the template type of the service template corresponding to the PaaS service instance, and call at least one target deletion component interface to delete the instance resources corresponding to the PaaS service instance based on the target deletion component interface and the configuration file.
[0072] The target deletion component interface may include configuration management component interfaces for deleting configuration mapping objects (such as deleteNamespacedConfigMap), component interfaces for deleting service objects (such as deleteNamespacedService), component interfaces for deleting stateful replica set objects (such as deleteNamespacedStatefulSet), and so on.
[0073] S320. If the PaaS service instance is successfully deleted, and the Ceph cluster stores the storage block corresponding to the PaaS service instance, delete the storage block.
[0074] In this embodiment, service instances can be deleted by directly calling the Kubernetes interface, improving the efficiency and flexibility of service instance deletion. Simultaneously, deleting storage blocks corresponding to PaaS service instances while they are stored in the Ceph cluster avoids resource occupation and improves resource utilization.
[0075] Figure 4 This is a flowchart of another PaaS service construction method provided in this disclosure embodiment, such as... Figure 4 As shown, the PaaS service construction method may include the following steps: S410. Obtain service instance information for building a Platform as a Service (PaaS) service instance.
[0076] S420. Determine the service template corresponding to the service instance information from at least one preset service template, and create the configuration file corresponding to the PaaS service instance based on the service instance information and the service template.
[0077] S430: Based on the template type corresponding to the service template, call the target creation component interface in the container orchestration platform Kubernetes cluster, and create instance resources corresponding to the PaaS service instance based on the target creation component interface and configuration file.
[0078] S440. Monitor the status of PaaS service instances based on the ready probes in the configuration file.
[0079] In this embodiment of the disclosure, if the monitoring result indicates that the PaaS service instance has not reached the ready state, step S450 is executed; if the monitoring result indicates that the PaaS service instance has reached the ready state, step S460 is executed.
[0080] S450. When the PaaS service instance is detected as not being ready based on the readiness probe, perform a loop monitoring operation; if the number of loop monitoring operations reaches a preset threshold and the PaaS service instance is still not ready, delete the instance resources and service instance information.
[0081] S460. When the PaaS service instance is detected to be in a ready state based on the ready probe, it is determined that the PaaS service instance has been created.
[0082] In this embodiment, service templates can be used to create different types of PaaS services, eliminating the need for separate development and customization each time. Furthermore, the use of a Kubernetes cluster for instance resource creation improves the efficiency of instance resource creation, reduces the complexity of PaaS service development, and consequently lowers development costs and increases development efficiency. Moreover, after creating the instance resources corresponding to the PaaS service instance, the status of the PaaS service instance is monitored to ensure its normal startup and operation, improving the accuracy and effectiveness of PaaS service construction.
[0083] Figure 5 This is a schematic diagram of the structure of a PaaS service building device provided in an embodiment of this disclosure.
[0084] In this embodiment, the PaaS service building device can be located within an electronic device and is understood as a functional module within the aforementioned electronic device. Specifically, the electronic device can be a server or a terminal, wherein the terminal specifically includes mobile phones, computers, or tablet computers, etc., without limitation.
[0085] like Figure 5 As shown, the PaaS service building device 500 may include an instance information acquisition module 510, a configuration file creation module 520, and a PaaS service building module 530.
[0086] The instance information acquisition module 510 can be used to acquire service instance information of the Platform as a Service (PaaS) service instance. The service instance information includes at least one of the following: name, service type, version, storage space size, Internet Protocol IP address, CPU information, memory size, and password. The configuration file creation module 520 can be used to determine the service template corresponding to the service instance information from at least one preset service template, and create a configuration file corresponding to the PaaS service instance based on the service instance information and the service template. The configuration file is used to define the resource configuration corresponding to the PaaS service. The PaaS service building module 530 can be used to call the target creation component interface in the container orchestration platform Kubernetes cluster based on the template type corresponding to the service template, and create instance resources corresponding to the PaaS service instance based on the target creation component interface and configuration file.
[0087] In this embodiment, service instance information for a Platform as a Service (PaaS) service instance can be obtained. This service instance information includes at least one of the following: name, service type, version, storage space size, Internet Protocol (IP) address, CPU information, memory size, and password. After obtaining the service instance, a service template corresponding to the service instance information is determined from at least one preset service template. A configuration file corresponding to the PaaS service instance is created based on the service instance information and the service template, where the configuration file defines the resource configuration corresponding to the PaaS service. The target creation component interface in the Kubernetes cluster of the container orchestration platform is called based on the template type corresponding to the service template. Then, the instance resources corresponding to the PaaS service instance are created based on the target creation component interface and the configuration file. Therefore, service templates can be used to meet the creation needs of different types of PaaS services, eliminating the need for separate development and customization each time. Simultaneously, using a Kubernetes cluster to create instance resources improves the efficiency of instance resource creation, reduces the complexity of PaaS service development, and thus reduces the development cost and improves development efficiency.
[0088] In some embodiments of this disclosure, service instance information includes service type and storage space size.
[0089] The PaaS service building apparatus 500 may also include a service instance information storage module.
[0090] The service instance information storage module can be used to store the service instance information in the preset instance basic information table in the preset database after obtaining the service instance information for building PaaS service instances. The PaaS service instance establishes a connection with the Ceph cluster based on the preset connection command and the key corresponding to the distributed storage system Ceph cluster. If it is determined that the storage requirements of the PaaS service instance will be mounted to the Ceph cluster, control the Ceph cluster to generate storage blocks based on the storage space size, and then mount the PaaS service instance to the storage block.
[0091] In some embodiments of this disclosure, the PaaS service building module 530 can be specifically used to obtain token information of the k8s cluster; Monitor the running status of the Kubernetes cluster based on token information and preset monitoring commands; Once the Kubernetes cluster is confirmed to be running normally, the target component creation interface is called based on the template type corresponding to the service template.
[0092] In some embodiments of this disclosure, a ready probe is configured in the configuration file, which is used to monitor the status of PaaS service instances.
[0093] The PaaS service building appliance 500 may also include an instance status monitoring module.
[0094] The instance status monitoring module can be used to perform a loop monitoring operation after creating instance resources corresponding to a PaaS service instance based on the target creation component interface and configuration file, and when the readiness probe detects that the PaaS service instance has not reached the ready state; if the number of loop monitoring operations reaches a preset threshold and the PaaS service instance still has not reached the ready state, the instance resources and the service instance information are deleted. or, When the readiness probe detects that the PaaS service instance has reached the ready state, it is determined that the PaaS service instance has been created.
[0095] In some embodiments of this disclosure, the PaaS service building apparatus 500 may further include an instance modification module.
[0096] The instance modification module can be used to receive user modification operations on at least one piece of information included in the service instance information after the instance resources corresponding to the PaaS service instance are created based on the target creation component interface and configuration file; In response to the modification operation, an execution strategy is determined. The execution strategy is used to modify the storage blocks corresponding to the PaaS service instances in the Ceph cluster, and / or to modify the PaaS service instances. Update PaaS service instances based on execution policies.
[0097] In some embodiments of this disclosure, the modification operation is used to modify the storage space size included in the service instance information, and the execution strategy is a first execution strategy, which is a strategy to update the storage space size corresponding to the PaaS service instance based on the target storage space size indicated by the modification operation. The instance modification module can be specifically used to update the storage space size corresponding to the PaaS service instance in the preset instance basic information table to the target storage space size; If a storage block corresponding to a PaaS service instance exists in the Ceph cluster, update the storage space size of the storage block in the Ceph cluster to the target storage space size; simultaneously, obtain the target IP address of the physical host where the PaaS service instance resides; establish a communication connection with the physical host based on the target IP address to obtain the file system name of the storage block corresponding to the PaaS service instance; update the storage space size of the storage block in the operating system-level inode corresponding to the file system name to the target storage space size; And / or, The modification operation is used to modify information other than the storage space size included in the service instance information. The execution strategy is the second execution strategy, which is a strategy to update the PaaS service instance based on the target modification value corresponding to the target variable indicated by the modification operation. The instance modification module can be specifically used to update the value of the target variable corresponding to the PaaS service instance in the preset instance basic information table to the target modified value; The configuration file corresponding to the PaaS service instance is updated based on the target modified value, and the instance resources are updated based on the updated configuration file. The target operation command is determined based on the service type and target variables corresponding to the PaaS service instance, and then executed to update the PaaS service instance.
[0098] In some embodiments of this disclosure, the PaaS service building apparatus 500 may further include an instance deletion module.
[0099] The instance deletion module can be used to delete the service instance information in response to the user's deletion operation on the PaaS service instance after the instance resources corresponding to the PaaS service instance are created based on the target creation component interface and configuration file. It can also call the target deletion component interface corresponding to the PaaS service instance in the Kubernetes cluster based on the template type to delete the instance resources based on the target deletion component interface and configuration file. If the service instance is successfully deleted, and the Ceph cluster stores the storage block corresponding to the PaaS service instance, delete the storage block.
[0100] It should be noted that, Figure 5 The PaaS service building apparatus 500 shown can execute the various steps in the above method embodiments and realize the various processes and effects in the above method embodiments, which will not be elaborated here.
[0101] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure.
[0102] In this embodiment of the disclosure, Figure 6 The electronic devices shown can be servers or terminals, and terminals specifically include mobile phones, computers, or tablets, etc., without limitation.
[0103] like Figure 6 As shown, the electronic device may include a processor 610 and a memory 620 storing computer program instructions.
[0104] Specifically, the processor 610 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this disclosure.
[0105] Memory 620 may include a large-capacity storage for information or instructions. For example, and not limitingly, memory 620 may include a hard disk drive (HDD), a floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 620 may include removable or non-removable (or fixed) media. Where appropriate, memory 620 may be internal or external to the integrated gateway device. In a particular embodiment, memory 620 is a non-volatile solid-state memory. In a particular embodiment, memory 620 includes read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (Electrically Programmable ROM, EPROM), an electrically erasable programmable PROM (EEPROM), an electrically alterable ROM (EAROM), or flash memory, or a combination of two or more of these.
[0106] The processor 610 reads and executes computer program instructions stored in the memory 620 to perform the steps of the PaaS service construction method provided in this disclosure embodiment.
[0107] In one example, the electronic device may also include a transceiver 630 and a bus 640. Wherein, as... Figure 6 As shown, the processor 610, memory 620 and transceiver 630 are connected via bus 640 and communicate with each other.
[0108] Bus 640 may include hardware, software, or both. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industrial Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses, or a combination of two or more of these. Where appropriate, bus 640 may include one or more buses.
[0109] This disclosure also provides a computer-readable storage medium that can store a computer program that, when executed by a processor, enables the processor to implement the PaaS service construction method provided in this disclosure.
[0110] The aforementioned storage medium may, for example, include a memory 620 containing computer program instructions, which can be executed by a processor 610 of an electronic device to complete the PaaS service construction method provided in this embodiment. Optionally, the storage medium may be a non-transitory computer-readable storage medium, such as a ROM, random access memory (RAM), compact disc ROM (CD-ROM), magnetic tape, floppy disk, and optical data storage device.
[0111] This disclosure also provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a processor, they implement the PaaS service construction method provided in this disclosure and can achieve the various processes and effects in the above embodiments of this disclosure, which will not be elaborated here.
[0112] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for building a PaaS service, characterized in that, include: Obtain service instance information for a Platform as a Service (PaaS) service instance, wherein the service instance information includes at least one of the following: name, service type, version, storage space size, Internet Protocol (IP) address, CPU information, memory size, and password. The service template corresponding to the service instance information is determined from at least one preset service template, and a configuration file corresponding to the PaaS service instance is created based on the service instance information and the service template, wherein the configuration file is used to define the resource configuration corresponding to the PaaS service instance; Based on the template type corresponding to the service template, the target creation component interface in the Kubernetes cluster of the container orchestration platform is called, and the instance resources corresponding to the PaaS service instance are created based on the target creation component interface and the configuration file.
2. The method according to claim 1, characterized in that, The service instance information includes the service type and the storage space size; After obtaining the service instance information for constructing the PaaS service instance, the method further includes: The service instance information is stored in a preset instance basic information table in a preset database; The PaaS service instance establishes a connection with the Ceph cluster based on a preset connection command and the key corresponding to the distributed storage system Ceph cluster. If it is determined that the storage requirements of the PaaS service instance will be mounted to the Ceph cluster, the Ceph cluster is controlled to generate storage blocks based on the storage space size, and the PaaS service instance is mounted to the storage blocks.
3. The method according to claim 1 or 2, characterized in that, The step of calling the target component creation interface in the Kubernetes cluster container orchestration platform based on the template type corresponding to the service template includes: Obtain the token information of the Kubernetes cluster; The running status of the Kubernetes cluster is monitored based on the token information and preset monitoring commands. Once the Kubernetes cluster is confirmed to be running normally, the target component creation interface is called based on the template type corresponding to the service template.
4. The method according to claim 1 or 2, characterized in that, The configuration file contains a ready probe, which is used to monitor the status of the PaaS service instance. After creating the instance resources corresponding to the PaaS service instance based on the target creation component interface and the configuration file, the method further includes: When the readiness probe detects that the PaaS service instance has not reached the ready state, a cyclic monitoring operation is performed. If the number of cyclic monitoring operations reaches a preset threshold and the PaaS service instance is still not ready, delete the instance resources and the service instance information. or, When the readiness probe detects that the PaaS service instance has reached the ready state, it is determined that the PaaS service instance has been created.
5. The method according to claim 1 or 2, characterized in that, After creating the instance resources corresponding to the PaaS service instance based on the target creation component interface and the configuration file, the method further includes: Receive user modification operations on at least one type of information included in the service instance information; In response to the modification operation, an execution strategy is determined, which is used to modify the storage block corresponding to the PaaS service instance in the Ceph cluster, and / or to modify the PaaS service instance. The PaaS service instance is updated based on the execution strategy.
6. The method according to claim 5, characterized in that, The modification operation is used to modify the storage space size included in the service instance information. The execution strategy is a first execution strategy, which is a strategy to update the storage space size corresponding to the PaaS service instance based on the target storage space size indicated by the modification operation. The update of the PaaS service instance based on the execution strategy includes: Update the storage space size corresponding to the PaaS service instance in the preset instance basic information table to the target storage space size; If a storage block corresponding to the PaaS service instance exists in the Ceph cluster, update the storage space size of the storage block in the Ceph cluster to the target storage space size; simultaneously, obtain the target IP address of the physical host where the PaaS service instance resides; establish a communication connection with the physical host based on the target IP address, and obtain the file system name of the storage block corresponding to the PaaS service instance; update the storage space size of the storage block in the operating system-level inode corresponding to the file system name to the target storage space size; And / or, The modification operation is used to modify information other than the storage space size included in the service instance information. The execution strategy is a second execution strategy, which is a strategy to update the PaaS service instance based on the target modification value corresponding to the target variable indicated by the modification operation. The update of the PaaS service instance based on the execution strategy includes: Update the value of the target variable corresponding to the PaaS service instance in the preset instance basic information table to the target modified value; The configuration file corresponding to the PaaS service instance is updated based on the target modification value, and the instance resources are updated based on the updated configuration file. Based on the service type corresponding to the PaaS service instance and the target variable, a target operation command is determined and executed to update the PaaS service instance.
7. The method according to claim 1, characterized in that, After creating the instance resources corresponding to the PaaS service instance based on the target creation component interface and the configuration file, the method further includes: In response to the user's deletion operation on the PaaS service instance, the service instance information is deleted, and the target deletion component interface corresponding to the PaaS service instance in the Kubernetes cluster is called based on the template type. The instance resources are deleted based on the target deletion component interface and the configuration file. If the PaaS service instance is successfully deleted, and the Ceph cluster stores the storage block corresponding to the PaaS service instance, then delete the storage block.
8. A PaaS service building apparatus, characterized in that, include: The instance information acquisition module is used to acquire service instance information of the Platform as a Service (PaaS) service instance. The service instance information includes at least one of the following: name, service type, version, storage space size, Internet Protocol (IP) address, CPU information, memory size, and password. The configuration file creation module is used to determine the service template corresponding to the service instance information from at least one preset service template, and create a configuration file corresponding to the PaaS service instance based on the service instance information and the service template, wherein the configuration file is used to define the resource configuration corresponding to the PaaS service; The PaaS service building module is used to call the target creation component interface in the Kubernetes cluster of the container orchestration platform based on the template type corresponding to the service template, and to create instance resources corresponding to the PaaS service instance based on the target creation component interface and the configuration file.
9. An electronic device, characterized in that, include: processor; Memory, used to store executable instructions; The processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the PaaS service construction method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, causes the processor to implement the PaaS service construction method according to any one of claims 1-7.