Application deployment method and device, controller, equipment and storage medium
By deploying controllers in the cluster to monitor custom resource events, declarative deployment and monitoring of cloud native applications is achieved, which solves the problems of complexity and high cost of cloud native application deployment in existing technologies and provides a lightweight deployment solution. and full life cycle management.
Patent Information
- Application Number
- CN202311821428.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-27
- Publication Date
- 2024-10-29
AI Technical Summary
Existing cloud-native application deployment methods are complex and costly. In particular, Helm Chart's installation method involves complex standards and redundancy concepts, resulting in high user learning costs, high deployment costs, and a lack of full life cycle management of deployment services.
By deploying the first controller in the cluster, listening to user-entered information about application resource packages, creating custom resources, and using the controller to deploy application resource packages to the cluster, declarative deployment and monitoring of applications are achieved. Support resource recycling policy and metadata management.
It achieves lightweight cloud-native application deployment, reduces user learning costs and deployment costs, provides full life cycle management and monitoring capabilities for applications, and improves deployment efficiency and maintainability.
Smart Images

Figure CN118860418A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of application deployment technology, and in particular to an application deployment method, apparatus, controller, device, and storage medium for cloud native applications. Background Art
[0002] Cloud-native applications are applications based on container and microservice architecture.
[0003] Kubernetes (K8s for short) provides automated container orchestration, load balancing, service discovery, automated expansion and other functions, making cloud-native applications easier to deploy and manage. Helm is a package management tool for Kubernetes (K8s) that simplifies the deployment and management of applications in Kubernetes clusters. Helm Chart is a core concept of Helm, which is a pre-configured application resource package. Helm Chart provides a flexible and scalable way to manage K8s applications, which greatly simplifies the application deployment process.
[0004] The installation methods of HelmChart package mainly include the following: 1. Installation based on Helm client. This method involves complex standards and redundant concepts, and the user's learning cost is high; 2. Installation based on K8s application delivery platform (such as kube-vela). This method often involves many additional components, which brings unnecessary deployment costs, and lacks the management of the entire life cycle of deployment services. Deployment and monitoring are separated. For example, some components only complete the deployment, but do not pay attention to whether the service can be started and run normally after deployment; 3. Installation based on PaaS. This method relies on complex PaaS system and is simple to use, but the maintenance cost is high due to the numerous PaaS components.
[0005] In summary, an improved cloud-native application deployment solution is still needed. Summary of the invention
[0006] One objective of the present disclosure is to provide a lightweight cloud-native application deployment solution.
[0007] According to a first aspect of the present disclosure, an application deployment method is provided, comprising: deploying a first controller in a cluster; creating a first custom resource in the cluster in response to information related to an application resource package input by a user; deploying the application resource package to the cluster using the first controller; wherein the first controller is configured to deploy the application resource package described by the first custom resource to the cluster in response to monitoring a creation event of the first custom resource.
[0008] Optionally, the first controller pulls the application resource package described by the first custom resource from the warehouse to the local; the first controller writes the real values of the variables in the application resource package described by the first custom resource into a temporary file; the first controller passes the local file path of the application resource package and the temporary file to the software development kit, and the software development kit renders the application resource package; the first controller submits the resources rendered by the software development kit to the cluster.
[0009] Optionally, before submitting the resource rendered by the software development kit to the cluster, the first controller further sets metadata of the resource, where the metadata is used to describe and / or manage the resource.
[0010] Optionally, the metadata includes one or more of the following: resource ownership relationship; resource tag; resource annotation; resource deletion interception mechanism.
[0011] Optionally, the first custom resource describes a plurality of application resource packages and orchestration information for the plurality of application resource packages, and the first controller deploys the plurality of application resource packages as an application to the cluster based on the orchestration information.
[0012] Optionally, the first custom resource also describes a resource recovery strategy, and the method further includes: using the first controller to recycle application resources deployed in the cluster; wherein the first controller is also configured to delete the application resources corresponding to the first custom resource based on the resource recovery strategy in response to monitoring a deletion event of the first custom resource.
[0013] Optionally, the method also includes: deploying a second controller in the cluster; creating a second custom resource in the cluster using the first controller; wherein the first controller is also configured to create a second custom resource in the cluster in response to successfully deploying the application resource package to the cluster, the second custom resource being used to describe the application deployed to the cluster; using the second controller to monitor the running status of the application described by the second custom resource; wherein the second controller is configured to monitor the running status of the application described by the second custom resource in response to monitoring the creation event of the second custom resource.
[0014] Optionally, the first controller also records the resources included in the application deployed to the cluster into the status information of the first custom resource, the second custom resource describes the application deployed to the cluster by describing the first custom resource, and the second controller obtains the resources included in the application from the first custom resource based on the first custom resource described by the second custom resource; the second controller checks the health status of each obtained resource; the second controller summarizes the health status of each resource included in the application, and updates the summarized health status to the status information of the first custom resource.
[0015] According to a second aspect of the present disclosure, an application deployment device is provided, comprising: a first deployment module, used to deploy a first controller in a cluster; a first creation module, used to create a first custom resource in the cluster in response to information related to an application resource package input by a user; a second deployment module, used to deploy the application resource package to the cluster using the first controller; wherein the first controller is configured to deploy the application resource package described by the first custom resource to the cluster in response to monitoring a creation event of the first custom resource.
[0016] Optionally, the first controller pulls the application resource package described by the first custom resource from the warehouse to the local; the first controller writes the real values of the variables in the application resource package described by the first custom resource into a temporary file; the first controller passes the local file path of the application resource package and the temporary file to the software development kit, and the software development kit renders the application resource package; the first controller submits the resources rendered by the software development kit to the cluster.
[0017] Optionally, before submitting the resource rendered by the software development kit to the cluster, the first controller further sets metadata of the resource, where the metadata is used to describe and / or manage the resource.
[0018] Optionally, the metadata includes one or more of the following: resource ownership relationship; resource tag; resource annotation; resource deletion interception mechanism.
[0019] Optionally, the first custom resource describes a plurality of application resource packages and orchestration information for the plurality of application resource packages, and the first controller deploys the plurality of application resource packages as an application to the cluster based on the orchestration information.
[0020] Optionally, the first custom resource also describes a resource recovery strategy, and the device also includes: a recovery module, used to use the first controller to recycle application resources deployed in the cluster; wherein, the first controller is also configured to delete the application resources corresponding to the first custom resource based on the resource recovery policy in response to monitoring a deletion event of the first custom resource.
[0021] Optionally, the device also includes: a third deployment module, used to deploy a second controller in the cluster; a second creation module, used to create a second custom resource in the cluster using the first controller; wherein the first controller is also configured to create a second custom resource in the cluster in response to successfully deploying the application resource package to the cluster, and the second custom resource is used to describe the application deployed to the cluster; a monitoring module, used to monitor the running status of the application described by the second custom resource using the second controller; wherein the second controller is configured to monitor the running status of the application described by the second custom resource in response to monitoring the creation event of the second custom resource.
[0022] Optionally, the first controller also records the resources included in the application deployed to the cluster into the status information of the first custom resource, the second custom resource describes the application deployed to the cluster by describing the first custom resource, and the second controller obtains the resources included in the application from the first custom resource based on the first custom resource described by the second custom resource; the second controller checks the health status of each obtained resource; the second controller summarizes the health status of each resource included in the application, and updates the summarized health status to the status information of the first custom resource.
[0023] According to a third aspect of the present disclosure, a computing device is provided, comprising: a processor; and a memory on which executable codes are stored, and when the executable codes are executed by the processor, the processor executes the method described in the first aspect above.
[0024] According to a fourth aspect of the present disclosure, a computer program product is provided, comprising an executable code, and when the executable code is executed by a processor of an electronic device, the processor is caused to execute the method as described in the first aspect above.
[0025] According to a fifth aspect of the present disclosure, a non-temporary machine-readable storage medium is provided, on which executable code is stored. When the executable code is executed by a processor of an electronic device, the processor executes the method described in the first aspect above.
[0026] According to the sixth aspect of the present disclosure, an application deployment method is provided, which is applied to a first controller deployed in a cluster, comprising: listening to a creation event of a first custom resource in the cluster; in response to listening to the creation event of the first custom resource, deploying an application resource package described by the first custom resource to the cluster.
[0027] Optionally, deploying the application resource package described by the first custom resource to the cluster includes: pulling the application resource package described by the first custom resource from a warehouse to a local location; writing actual values of variables in the application resource package described by the first custom resource to a temporary file; passing the local file path of the application resource package and the temporary file to a software development kit, and having the software development kit render the application resource package; and submitting the resources rendered by the software development kit to the cluster.
[0028] Optionally, before submitting the resource rendered by the software development kit to the cluster, the method further includes: setting metadata of the resource, where the metadata is used to describe and / or manage the resource.
[0029] Optionally, the first custom resource also describes a resource recovery strategy, and the method further includes: monitoring a deletion event of the first custom resource; and in response to monitoring the deletion event of the first custom resource, deleting application resources corresponding to the first custom resource based on the resource recovery strategy.
[0030] Optionally, a second controller is also deployed in the cluster, and the method further includes: in response to successfully deploying the application resource package to the cluster, recording the resources included in the application deployed to the cluster into the status information of the first custom resource, and creating a second custom resource in the cluster, so that the second controller, in response to monitoring the creation event of the second custom resource, monitors the running status of the application based on the first custom resource described by the second custom resource, and updates the monitored running status to the status information of the first custom resource.
[0031] According to the seventh aspect of the present disclosure, a controller is provided, comprising: a monitoring unit, for monitoring a creation event of a first custom resource in the cluster; and a deployment unit, for deploying an application resource package described by the first custom resource to the cluster in response to monitoring the creation event of the first custom resource.
[0032] According to an eighth aspect of the present disclosure, a computing device is provided, comprising: a processor; and a memory on which executable code is stored, and when the executable code is executed by the processor, the processor executes the method described in the sixth aspect above.
[0033] According to a ninth aspect of the present disclosure, a non-temporary machine-readable storage medium is provided, on which executable code is stored. When the executable code is executed by a processor of an electronic device, the processor executes the method described in the sixth aspect above.
[0034] The present disclosure deploys a first controller in a cluster, creates a first custom resource in the cluster in response to information related to an application resource package input by a user, and deploys the application resource package to the cluster using the first controller; wherein the first controller, in response to monitoring a creation event of the first custom resource, deploys the application resource package described by the first custom resource to the cluster. Thus, under the action of a single first controller, the deployment of applications in the cluster can be realized, thereby realizing lightweight cloud-native application deployment. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The above and other objects, features and advantages of the present disclosure will become more apparent through a more detailed description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, wherein like reference numerals generally represent like components in the exemplary embodiments of the present disclosure.
[0036] Figure 1 A schematic flowchart of an application deployment method according to an embodiment of the present disclosure is shown.
[0037] Figure 2 A schematic diagram showing a first custom resource definition is shown.
[0038] Figure 3 A schematic diagram showing information related to an application resource bundle input by a user.
[0039] Figure 4 Shows Figure 1 A schematic flow chart of steps that the method may further comprise is shown.
[0040] Figure 5 A schematic diagram showing a second custom resource definition.
[0041] Figure 6 A schematic diagram of state information in a first custom resource is shown.
[0042] Figure 7 The overall architectural schematic diagram of the present invention is shown.
[0043] Figure 8A schematic diagram of the structure of an application deployment device according to an embodiment of the present disclosure is shown.
[0044] Fig. 9 A schematic diagram of the structure of a computing device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0045] The preferred embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the preferred embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0046] Those skilled in the art should understand that the terms "first", "second", etc. in the present disclosure are used to distinguish similar objects, rather than to describe a specific order or sequence, and have no additional limiting effect.
[0047] The present disclosure proposes an application deployment method. The method aims to use the Custom Resource Definitions (CRDs) mechanism in a cluster (such as a K8s cluster) to achieve lightweight application deployment. Furthermore, the method can also use the CRDs mechanism to achieve automatic monitoring after application deployment.
[0048] Figure 1 A schematic flowchart of an application deployment method according to an embodiment of the present disclosure is shown.
[0049] See also Figure 1 , in step S110 , a first controller is deployed in the cluster.
[0050] The first controller is a customized controller in the cluster that can extend the cluster function.
[0051] The first controller deployed in the cluster can occupy only one pod. A pod in a cluster is a minimum unit that encapsulates the resources required for service operation (such as storage, network, image, etc.).
[0052] The business logic of the first controller can be designed by a developer.
[0053] In the present disclosure, the first controller is mainly responsible for deploying applications. On this basis, the first controller can also be responsible for triggering monitoring of deployed applications, resource recovery, etc.
[0054] The first controller can implement the custom business logic by monitoring the change event of the first custom resource.
[0055] All objects in the cluster can be considered as resources. Custom Resource (CR) is an extension mechanism of the cluster, which allows users to define their own resource types, thereby extending the cluster's functionality. In order for the cluster to recognize CR, it is necessary to let the cluster understand what the macro definition of this CR is, that is, it is necessary to create Custom Resource Definitions (CRDs). CR is a custom resource created based on CRDs. CR can be regarded as an instance of CRDs, which is a resource description that conforms to the field format definition in CRDs.
[0056] Before creating the first custom resource, a first custom resource definition may also be created in the cluster. The first custom resource definition is used to define the first custom resource. The first custom resource definition and the first custom resource are both declarative resources. The first custom resource definition may be recorded as Application CRDs. The first custom resource may be recorded as Application CR. The first custom resource definition may describe (i.e., define) a resource of the Application type in a declarative manner.
[0057] Exemplarily, the first custom resource definition can be implemented in a declarative manner based on the kubernetes CRDs standard.
[0058] The core declared by the first custom resource definition may include information related to the application resource package, such as the name, version, and repository of the application resource package. On this basis, the core declared by the first custom resource definition may also include information related to application deployment, such as but not limited to orchestration information and / or resource recycling strategy.
[0059] Exemplarily, the first custom resource definition may include the following information: Helmcharts name; Helmcharts version; repository where Helmcharts is located; Helmcharts values (optional parameter); Traffic information (optional parameter); Autoscaling information (optional parameter); Pipeline information (optional parameter); Charts resource input and output information (optional parameter). Helmcharts values are used to define the configuration parameters of the application. Traffic information refers to traffic information, which is usually used to describe the access volume, traffic distribution and routing rules of resources. By defining Traffic information in CRDs, users can better control and manage resource access and traffic distribution. Autoscaling information is the automatic scaling function. Based on Autoscaling information, users can easily implement automatic scaling of resources to adapt to application needs and traffic changes. Pipeline information is orchestration information. By defining orchestration information in CRDs, users can flexibly manage and orchestrate complex application deployments involving multiple Helmcharts and ensure that they are deployed in the expected order and configuration. Such orchestration capabilities can improve the maintainability, scalability and consistency of applications.
[0060] Figure 2 A diagram showing the first custom resource definition. Figure 2 The first custom resource definition may define the version (apiVersion), type (kind), metadata (metadata), specification (spec), workflow (workflow), parameters (parameters) and other information of the first custom resource in a declarative manner.
[0061] After the first custom resource definition is created in the cluster, the user may trigger the creation process of the first custom resource. For example, the user may use the kubectl command line tool to create the first custom resource.
[0062] In order to reduce the user's learning cost, a visual interactive interface may be provided for the user, through which the user may input information related to the application resource package (such as HelmChart) to trigger the creation of the first custom resource.
[0063] That is, in step S120, in response to the information related to the application resource package input by the user, a first custom resource is created in the cluster.
[0064] The information related to the application resource package may include description information of the application resource package, such as the name, version, and repository of the application resource package to be deployed. In addition, the information related to the application resource package may also include, but is not limited to, resource configuration information, deployment configuration information, and other information related to application deployment. That is, users may also input configuration information related to application deployment according to their own needs.
[0065] Figure 3 A schematic diagram showing information related to an application resource bundle input by a user.
[0066] See also Figure 3 , users can enter but are not limited to model version, remarks, online engine, resource configuration and other information. Among them, the part marked with a relatively thick wireframe is the application resource package HelmChart selected by the user. Resource configuration can include but is not limited to configuration information for resources such as GPU, VGPU (virtual GPU), CPU, memory, etc.
[0067] Exemplarily, a "Create Service" control may be provided to the user, and in response to the user clicking the "Create Service" control, a first custom resource may be created in the cluster based on the information input by the user. For example, a first custom resource creation request may be sent to an interface service component (such as an apiserver) based on the information input by the user, and the interface service component may create the first custom resource according to the first custom resource creation request, and the created first custom resource may be stored in a storage component (such as etcd). In addition, the first custom resource definition created in the cluster may also be stored as a resource in the storage component.
[0068] In step S130, the application resource package is deployed to the cluster using the first controller.
[0069] The first controller can monitor the creation event of the first custom resource. For example, the first controller can monitor the creation event of the first custom resource through an interface (Watch interface) provided by an interface service component (such as apiserver).
[0070] In response to monitoring the creation event of the first custom resource, the first controller can deploy the application resource package described by the first custom resource to the cluster. The first custom resource can be regarded as declarative description information for the application to be deployed. The first controller can deploy the application resource package to the cluster in a manner consistent with the description of the first custom resource according to the description of the first custom resource, so as to obtain an application deployment result consistent with the declaration of the first custom resource.
[0071] In response to monitoring the creation event of the first custom resource, the first controller can first pull the application resource package described by the first custom resource from the warehouse to the local; then, the first controller can write the real values of the variables in the application resource package described by the first custom resource to a temporary file; then, the first controller can pass the local file path and temporary file of the application resource package to a software development kit (such as helm charts SDK), and the software development kit renders the application resource package; finally, the first controller can submit the resources rendered by the software development kit to the cluster, such as submitting them to the interface service component (such as apiserver) in the cluster.
[0072] Before submitting the resources rendered by the software development kit to the cluster, the first controller can also set metadata for the resources. Metadata is used to describe and / or manage resources. The metadata mentioned here may include, but is not limited to, one or more of the following: resource ownership relationships (ownerReferences); resource labels (such as business labels); resource annotations (annotations); resource deletion interception mechanisms (finalizers). In this way, resources deployed to the cluster can be managed and controlled based on metadata.
[0073] Deploying the application resource package to the cluster is equivalent to deploying the application in the cluster. The first controller can also record the resources included in the application package deployed to the cluster in the status information of the first custom resource. For example, the first controller can record all rendered resources in the status information of the first custom resource.
[0074] The first custom resource may describe multiple application resource packages and orchestration information for the multiple application resource packages. The first controller may also be used to deploy the multiple application resource packages as an application to the cluster based on the orchestration information. Thus, with the orchestration information in the first custom resource, the first controller may also implement the orchestration capability of multiple helmcharts. The orchestration may include online orchestration, offline orchestration, and mixed orchestration.
[0075] So far combined Figures 1 to 3 An exemplary statement is made on how to implement application deployment. Based on the present disclosure, users only need to input information related to the application resource package, and the application resource package can be automatically deployed to the cluster under the action of the first controller. The whole process is user-friendly and does not require users to pay a high learning cost. In addition, the first controller deployed in the cluster can occupy only one pod. In this way, lightweight cloud-native application deployment can be achieved.
[0076] The present disclosure can also realize automatic monitoring after application deployment with the help of the first controller.
[0077] Figure 4 Shows Figure 1 A schematic flow chart of steps that the method may further comprise is shown.
[0078] See also Figure 4 , in step S410, a second controller is deployed in the cluster.
[0079] The second controller is a custom controller in the cluster that can extend the cluster function. The second controller deployed in the cluster can occupy only one pod. The business logic of the second controller can be designed by the developer. In the present disclosure, the second controller is mainly responsible for monitoring the application. Specifically, the second controller can implement custom business logic by monitoring the change event of the second custom resource.
[0080] In step S420, a second custom resource is created in the cluster using the first controller.
[0081] In response to successfully deploying the application resource package to the cluster, the first controller may create in the cluster a second custom resource for describing the application deployed to the cluster. That is, the second custom resource may be automatically created under the action of the first controller. The second custom resource may include information related to the application to be monitored. That is, the second custom resource may be descriptive information for the application to be monitored.
[0082] Before creating the second custom resource, you can create a second custom resource definition in the cluster in advance. The second custom resource definition is used to define the second custom resource. The second custom resource definition and the second custom resource are both declarative resources. The second custom resource definition can be recorded as ApplicationSensor CRDs. The second custom resource can be recorded as ApplicationSensor. The second custom resource definition can describe (i.e., define) a resource of the ApplicationSensor type in a declarative manner. ApplicationSensor is mainly used to describe the Application to be monitored.
[0083] Exemplarily, the second custom resource definition can be implemented in a declarative manner based on the kubernetes CRDs standard.
[0084] Figure 5 A diagram showing a second custom resource definition. Figure 5The second custom resource definition may define information such as the version (apiVersion), type (kind), metadata (metadata), and specification (spec) of the second custom resource in a declarative manner.
[0085] Exemplarily, the first controller may send a second custom resource creation request to the interface service component (such as apiserver), and the interface service component may create the first custom resource according to the second custom resource creation request, and the created second custom resource may be stored in a storage component (such as etcd). In addition, the second custom resource definition created in the cluster may also be stored as a resource in the storage component.
[0086] In step S430, the second controller is used to monitor the running status of the application described by the second custom resource.
[0087] The second controller can monitor the creation event of the second custom resource. For example, the second controller can monitor the creation event of the second custom resource through an interface (Watch interface) provided by an interface service component (such as apiserver).
[0088] In response to monitoring the creation event of the second custom resource in the cluster, the second controller can monitor the running status of the application described by the second custom resource. The second custom resource can be regarded as declarative description information for the application to be monitored. The second controller can monitor the application according to the description of the second custom resource to obtain an application monitoring result consistent with the declaration of the second custom resource.
[0089] As described above, the first controller may update the resources included in the application to the status information of the first custom resource. Therefore, the second custom resource may describe the application to be monitored by describing the first custom resource. That is, the second custom resource may mainly include description information for the first custom resource, such as the type (kind), name (name), namespace (namespace), unique identifier (uid), etc. of the first custom resource.
[0090] The second controller can first obtain the resources included in the application from the first custom resource according to the first custom resource described by the second custom resource; then, the second controller can check the health status of each resource obtained; finally, the second controller summarizes the health status of each resource included in the application, and updates the summarized health status to the status information of the first custom resource, such as updating to a specific field (such as the phase field) in the status information of the first custom resource (i.e., Application Status).
[0091] Thus, the second controller can obtain the resource information included in the application to be monitored from the first custom resource described by the second custom resource, and obtain the status information of the entire application by aggregating the status information of these resources. The present disclosure also supports users to understand the current service status of the deployed application by consulting the first custom resource, such as whether the node is running normally, resource occupancy, etc., so as to further process and schedule.
[0092] Figure 6 FIG. 1 shows a schematic diagram of the state information in the first custom resource. Figure 6 The state information (ie, status information) in the first custom resource describes multiple resources included in the application, and also includes a phase field, the value of which can be updated by the second controller according to the real-time aggregated state.
[0093] In some embodiments, the first custom resource may also describe a resource recovery strategy, and the present disclosure may also utilize the first controller to recover application resources deployed in the cluster. Application resources refer to resources included in an application program. The first controller may delete the application resources corresponding to the first custom resource based on the resource recovery strategy in response to monitoring a deletion event of the first custom resource. Deleting the application resource corresponding to the first custom resource may refer to deleting the resources included in the status information of the first custom resource. For example, the ownerReference setting has been completed when the resource is created, so when the first custom resource is deleted, the first controller may automatically delete the application resource corresponding to the first custom resource according to the default deletion strategy (i.e., cascade deletion) provided by kubernetes. In addition, for resources that cannot be deleted by cascading (such as pvc, clusterrole and other resources), the first controller can delete them through the finalizer mechanism.
[0094] In some embodiments, the present disclosure can also use the webhook mechanism to implement capabilities such as automatic injection of sidecars according to the business. For example, the first controller can deploy the application resource package to the cluster to provide the main service as a main application, and at the same time, deploy auxiliary containers accompanying the application. As sidecars, these auxiliary containers can share the same pod as the main application container, but perform auxiliary or support tasks, such as logging, monitoring, configuration updates, or other services related to the main application. For example, in the case where the main application is a large model, a gradio sidecar, an auxiliary container that can provide a chat playground page, can be deployed.
[0095] Figure 7The overall architectural schematic diagram of the present invention is shown.
[0096] See also Figure 7 , the present disclosure as a whole realizes the automatic deployment and monitoring of applications with the help of the "CRDs+Controller mechanism" of the cluster. The Application CRDs shown in the figure are the first custom resource definitions mentioned above. The Controller includes Applicationcontroller (i.e., the first controller) and ApplicationSensorcontroller (i.e., the second controller). Chartmuseum is an open source HelmChart repository. Several pre-written helmcharts can be uploaded to chartmuseum. Different helmcharts can be adapted to the same or different models. That is, the relationship between the model and the helmcharts can be one-to-one, one-to-many, many-to-one, many-to-many, etc.
[0097] Applicationcontroller can respond to the creation of Application defined by Application CRDs in the cluster by pulling the helmcharts described by Application from chartmuseum to local; then it can obtain the real value of values through the values information in Application and write the real value to a temporary file; then pass the pulled local helmcharts path and the temporary file of values to helm charts SDK to complete the rendering; after rendering, submit the rendered resources to the kubernetes cluster through kubernetes client SDK; complete the settings of ownerReferences, business label, annotation and finalizer before submission; after successful creation, update all resources to the Status information of Application. After all resources are successfully created, Applicationcontroller creates ApplicationSensor corresponding to Application. In response to monitoring the creation of ApplicationSensor, ApplicationSensorcontroller obtains the Application Status based on the described Application information (such as kind, name, namespace, uid, etc.). After obtaining the Status information, it obtains all resources based on the resource information in the Status, calculates the health status of each resource, and summarizes the status of all resources after calculating the status of each resource. The summarized resource status is updated to the phase field of Application Status.
[0098] In summary, the present disclosure provides an ultra-lightweight strategy for application deployment and application monitoring in the cloud native field. At the same time, it is compatible with the helmcharts standard, and the installation package of the helmcharts standard is deployed and monitored in a declarative manner, so as to realize the direct use of helmcharts without any modification, and can realize the full life cycle monitoring of deployment resources. The present disclosure can be applied to the deployment and monitoring of various cloud native applications, for example, it can be used for the deployment and monitoring of large language models. The present disclosure also has the ability to orchestrate multiple helmcharts. The present disclosure can also use the Webhook mechanism (such as ValidatingWebhook and MutatingWebhook) to provide automatic injection of sidecar services, and easily realize business personalization needs.
[0099] The application deployment method disclosed in the present invention may also be implemented as an application deployment device. Figure 8 The schematic diagram of the structure of the application deployment device according to an embodiment of the present disclosure is shown. The functional units of the application deployment device can be implemented by hardware, software, or a combination of hardware and software that implements the principles of the present disclosure. It can be understood by those skilled in the art that Figure 8 The functional units described may be combined or divided into sub-units to implement the principles of the above invention. Therefore, the description herein may support any possible combination, division, or further limitation of the functional units described herein. The following is a brief description of the functional units that the application deployment device may have and the operations that each functional unit may perform. For the details involved, please refer to the relevant description above, which will not be repeated here.
[0100] See also Figure 8 , the application deployment device 800 may include a first deployment module 810, a first creation module 820 and a second deployment module 830. The first deployment module 810 is used to deploy a first controller in a cluster. The first creation module 820 is used to create a first custom resource in a cluster in response to information related to an application resource package input by a user. The second deployment module 830 is used to deploy the application resource package to the cluster using the first controller. The first controller is configured to deploy the application resource package described by the first custom resource to the cluster in response to monitoring a creation event of the first custom resource.
[0101] In some embodiments, the first controller pulls the application resource package described by the first custom resource from the warehouse to the local; the first controller writes the real value of the variable in the application resource package described by the first custom resource into a temporary file; the first controller passes the local file path and temporary file of the application resource package to the software development kit, and the software development kit renders the application resource package; the first controller submits the resource rendered by the software development kit to the cluster. Before submitting the resource rendered by the software development kit to the cluster, the first controller can also set metadata of the resource, which is used to describe and / or manage the resource.
[0102] In some embodiments, the first custom resource may further describe multiple application resource packages and orchestration information for the multiple application resource packages, and the first controller deploys the multiple application resource packages as an application to the cluster based on the orchestration information.
[0103] In some embodiments, the first custom resource also describes a resource recycling policy. The application deployment device 800 may also include a recycling module. The recycling module may utilize the first controller to recycle application resources deployed in the cluster; wherein the first controller may also be configured to delete application resources corresponding to the first custom resource based on the resource recycling policy in response to monitoring a deletion event of the first custom resource.
[0104] In some embodiments, the application deployment device 800 may also include a third deployment module, a second creation module, and a monitoring module. The third deployment module is used to deploy the second controller in the cluster. The second creation module is used to create a second custom resource in the cluster using the first controller; wherein the first controller is also configured to create a second custom resource in the cluster in response to successfully deploying the application resource package to the cluster, and the second custom resource is used to describe the application deployed to the cluster; the monitoring module is used to monitor the running status of the application described by the second custom resource using the second controller; wherein the second controller monitors the running status of the application described by the second custom resource in response to monitoring the creation event of the second custom resource. Exemplarily, the first controller may also record the resources included in the application deployed to the cluster into the status information of the first custom resource, and the second custom resource may achieve the purpose of describing the application deployed to the cluster by describing the first custom resource, so that the second controller may obtain the resources included in the application from the first custom resource according to the first custom resource described by the second custom resource; the second controller checks the health status of each resource obtained; the second controller summarizes the health status of each resource included in the application, and updates the summarized health status to the first custom resource.
[0105] The present disclosure also proposes an application deployment method, which can be applied to a first controller deployed in a cluster, that is, the method can be executed by the first controller. The following is an exemplary description of the execution process of the method, and the details involved in the method can be referred to the relevant description above.
[0106] The application deployment method may include: monitoring a creation event of a first custom resource in a cluster; and in response to monitoring the creation event of the first custom resource, deploying an application resource package described by the first custom resource into the cluster.
[0107] Exemplarily, before submitting the resource rendered by the software development kit to the cluster, the method may further include: setting metadata of the resource, where the metadata is used to describe and / or manage the resource.
[0108] Exemplarily, the first custom resource also describes a resource recycling policy, and the method may further include: monitoring a deletion event of the first custom resource; and in response to monitoring the deletion event of the first custom resource, deleting the application resource corresponding to the first custom resource based on the resource recycling policy.
[0109] Exemplarily, a second controller may also be deployed in the cluster, and the method may further include: in response to successfully deploying the application resource package to the cluster, recording the resources included in the application deployed to the cluster into the status information of the first custom resource, and creating a second custom resource in the cluster, so that the second controller, in response to monitoring the creation event of the second custom resource, monitors the running status of the application based on the first custom resource described by the second custom resource, and updates the monitored running status to the status information of the first custom resource.
[0110] The present disclosure also proposes a controller. The controller corresponds to the first controller mentioned above. The following briefly describes the functional units that the controller may have and the operations that each functional unit may perform. For the details involved, please refer to the relevant description above, which will not be repeated here.
[0111] The controller may include a monitoring unit and a deployment unit. The monitoring unit may be used to monitor a creation event of a first custom resource in the cluster. The deployment unit is used to deploy the application resource package described by the first custom resource to the cluster in response to monitoring the creation event of the first custom resource.
[0112] The controller may further include a setting unit, configured to set metadata of the resource before submitting the resource rendered by the software development kit to the cluster, where the metadata is used to describe and / or manage the resource.
[0113] The controller may further include a recycling unit configured to delete the application resource corresponding to the first custom resource based on a resource recycling policy in response to the monitoring unit monitoring a deletion event of the first custom resource.
[0114] The controller may also include a recording unit and a creation unit. In response to the deployment unit successfully deploying the application resource package to the cluster, the recording unit may record the resources included in the application deployed to the cluster into the state information of the first custom resource, and the creation unit may create a second custom resource in the cluster, so that the second controller, in response to monitoring the creation event of the second custom resource, monitors the running state of the application based on the first custom resource described by the second custom resource, and updates the monitored running state to the state information of the first custom resource.
[0115] Fig. 9A schematic diagram of the structure of a computing device that can be used to implement the above-mentioned application deployment method according to an embodiment of the present disclosure is shown.
[0116] See also Fig. 9 , the computing device 900 includes a memory 910 and a processor 920 .
[0117] The processor 920 may be a multi-core processor or may include multiple processors. In some embodiments, the processor 920 may include a general-purpose main processor and one or more special coprocessors, such as a graphics processing unit (GPU), a digital signal processor (DSP), etc. In some embodiments, the processor 920 may be implemented using a customized circuit, such as an application-specific integrated circuit (ASIC) or a field programmable gate array (FPGA).
[0118] The memory 910 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. Among them, ROM can store static data or instructions required by the processor 920 or other modules of the computer. The permanent storage device may be a readable and writable storage device. The permanent storage device may be a non-volatile storage device that does not lose the stored instructions and data even after the computer is powered off. In some embodiments, the permanent storage device uses a large-capacity storage device (such as a magnetic or optical disk, flash memory) as a permanent storage device. In some other embodiments, the permanent storage device may be a removable storage device (such as a floppy disk, optical drive). The system memory may be a readable and writable storage device or a volatile readable and writable storage device, such as a dynamic random access memory. The system memory may store some or all instructions and data required by the processor at run time. In addition, the memory 910 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and disks and / or optical disks may also be used. In some embodiments, the memory 910 may include a readable and / or writable removable storage device, such as a laser disc (CD), a read-only digital versatile disc (e.g., DVD-ROM, double-layer DVD-ROM), a read-only Blu-ray disc, an ultra-density optical disc, a flash memory card (e.g., SD card, mini SD card, Micro-SD card, etc.), a magnetic floppy disk, etc. The computer-readable storage medium does not include carrier waves and transient electronic signals transmitted wirelessly or wired.
[0119] The memory 910 stores executable codes, and when the executable codes are processed by the processor 920 , the processor 920 can execute the application deployment method mentioned above.
[0120] The application deployment method, apparatus, and device according to the present disclosure have been described above in detail with reference to the accompanying drawings.
[0121] In addition, the method according to the present disclosure may also be implemented as a computer program or a computer program product, which includes computer program code instructions for executing the above steps defined in the above method of the present disclosure.
[0122] Alternatively, the present disclosure may also be implemented as a non-temporary machine-readable storage medium (or computer-readable storage medium, or machine-readable storage medium) on which executable code (or computer program, or computer instruction code) is stored. When the executable code (or computer program, or computer instruction code) is executed by a processor of an electronic device (or computing device, server, etc.), the processor executes the various steps of the above-mentioned method according to the present disclosure.
[0123] Those skilled in the art will further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or a combination of both.
[0124] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the system and method according to multiple embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0125] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. An application deployment method, characterized in that: include: Deploy the first controller in the cluster; In response to information related to the application resource bundle input by a user, creating a first custom resource in the cluster; The application resource package is deployed to the cluster using the first controller; wherein the first controller is configured to deploy the application resource package described by the first custom resource to the cluster in response to monitoring a creation event of the first custom resource.
2. The method according to claim 1, characterized in that The first controller pulls the application resource package described by the first custom resource from the warehouse to the local; The first controller writes the real value of the variable in the application resource package described by the first custom resource into a temporary file; The first controller transmits the local file path of the application resource package and the temporary file to a software development kit, and the software development kit renders the application resource package; The first controller submits the resources rendered by the software development kit to the cluster.
3. The method according to claim 2, characterized in that Before submitting the resource rendered by the software development kit to the cluster, the first controller further sets metadata of the resource, where the metadata is used to describe and / or manage the resource.
4. The method according to claim 3, characterized in that The metadata includes one or more of the following: Ownership of resources; Resource tags; Resource annotations; Resource deletion interception mechanism.
5. The method according to claim 1, characterized in that The first custom resource describes a plurality of application resource packages and orchestration information for the plurality of application resource packages, and the first controller deploys the plurality of application resource packages as an application to the cluster based on the orchestration information.
6. The method according to claim 1, characterized in that The first custom resource also describes a resource recycling strategy, and the method further includes: The first controller is used to recycle application resources deployed in the cluster; wherein the first controller is further configured to delete application resources corresponding to the first custom resource based on the resource recycling policy in response to monitoring a deletion event of the first custom resource.
7. The method according to claim 1, characterized in that Also includes: deploying a second controller in the cluster; Using the first controller to create a second custom resource in the cluster; wherein the first controller is further configured to create a second custom resource in the cluster in response to successfully deploying the application resource package to the cluster, the second custom resource being used to describe the application deployed to the cluster; The second controller is used to monitor the running status of the application described by the second custom resource; wherein the second controller is configured to monitor the running status of the application described by the second custom resource in response to monitoring a creation event of the second custom resource.
8. An application deployment device, characterized in that: include: A first deployment module, used to deploy a first controller in the cluster; A first creation module, configured to create a first custom resource in the cluster in response to information related to the application resource package input by a user; The second deployment module is used to deploy the application resource package to the cluster using the first controller; wherein the first controller is configured to deploy the application resource package described by the first custom resource to the cluster in response to monitoring the creation event of the first custom resource.
9. A computing device comprising: processor; as well as A memory having executable codes stored thereon, which, when executed by the processor, causes the processor to execute the method according to any one of claims 1 to 7.
10. A non-transitory machine-readable storage medium having executable codes stored thereon, which, when executed by a processor of an electronic device, causes the processor to execute the method according to any one of claims 1 to 7.
Citation Information
Cited By
Application deployment method and device, equipment, medium and product
CN119987792A
An application deployment method, apparatus, equipment, medium, and product
CN119987792B
Switch management method and device applied to kubernetes GPU cluster, electronic equipment, storage medium and computer program product
CN121151353A
