Application deployment method and device, equipment, medium and product

By obtaining user's application custom resources and rendering workloads and cluster distribution policies, and generating target workloads and configuration files, the problems of configuration errors and resource waste in traditional deployment methods are solved, and efficient and flexible application deployment and resource utilization are achieved.

CN119987792AActive Publication Date: 2025-05-13TRANSWARP TECHNOLOGY (SHANGHAI) CO LTD

Patent Information

Application Number
CN202510067569.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-16
Publication Date
2025-05-13
Estimated Expiration
2045-01-16

AI Technical Summary

Technical Problem

Traditional application deployment methods rely on manual operations, which can easily lead to configuration errors and waste of resources, and maintaining high availability and stability of applications in different environments is a challenge.

Method used

Generate target workloads and configuration files by obtaining user application custom resources, rendering workloads and cluster distribution policies, and deploying applications based on these files.

Benefits of technology

The deployment mechanism across multiple clusters has been optimized, resource utilization efficiency and application performance have been improved, configuration flexibility and adaptability have been enhanced, and the risk of configuration errors has been reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119987792A_ABST
    Figure CN119987792A_ABST
Patent Text Reader

Abstract

The invention discloses an application deployment method and device, equipment, a medium and a product. The method comprises the following steps: acquiring application custom resources deployed by a user; according to the application custom resource rendering workload and a cluster distribution strategy, obtaining a target workload and a configuration file; and deploying an application based on the target workload and the configuration file. By means of the technical scheme, a cross-multi-cluster deployment mechanism is optimized, complex applications can be efficiently deployed in different environments, diversified requirements are met, the resource utilization efficiency and application performance can be improved, and configuration flexibility and adaptability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of big data technology, and in particular, to an application deployment method, device, equipment, medium and product. Background Art

[0002] With the rapid development of cloud computing and distributed systems, enterprises need to deploy complex applications in different environments. These applications usually include multiple services and components, involving diverse configurations and resource requirements. Traditional deployment methods often rely on manual operations, which can easily lead to configuration errors and waste of resources. In addition, how to maintain high availability and stability of applications in different environments is also an important challenge. Summary of the invention

[0003] The embodiments of the present invention provide an application deployment method, apparatus, device, medium and product to improve resource utilization efficiency and application performance, and enhance configuration flexibility and adaptability.

[0004] According to one aspect of the present invention, there is provided an application deployment method, comprising:

[0005] Get the application custom resources deployed by the user;

[0006] Obtaining a target workload and a configuration file according to the application custom resource rendering workload and cluster distribution strategy;

[0007] An application is deployed based on the target workload and the configuration file.

[0008] According to another aspect of the present invention, there is provided an application deployment device, the device comprising:

[0009] The acquisition module is used to obtain the application custom resources deployed by the user;

[0010] A rendering module, configured to obtain a target workload and a configuration file according to the application's custom resource rendering workload and cluster distribution strategy;

[0011] A deployment module is used to deploy an application based on the target workload and the configuration file.

[0012] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0013] at least one processor; and

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

[0015] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the application deployment method described in any embodiment of the present invention.

[0016] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the application deployment method described in any embodiment of the present invention when executed.

[0017] According to another aspect of the present invention, an embodiment of the present invention further provides a computer program product, the computer program product includes a computer program, and when the computer program is executed by a processor, the application deployment method described in any embodiment of the present invention is implemented.

[0018] The embodiment of the present invention obtains the application custom resources deployed by the user, renders the workload and cluster distribution strategy according to the application custom resources, obtains the target workload and configuration file, and deploys the application based on the target workload and configuration file. Through the technical solution of the present invention, the deployment mechanism across multiple clusters is optimized, so that complex applications can be efficiently deployed in different environments to meet diverse needs, improve resource utilization efficiency and application performance, and improve configuration flexibility and adaptability.

[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 is a flow chart of an application deployment method in an embodiment of the present invention;

[0022] Figure 2 is a schematic diagram of rendering using containers based on various configurations in an embodiment of the present invention;

[0023] Figure 3 It is a schematic diagram of tracing the execution status and execution result of an operation and maintenance operation during the execution of the operation and maintenance operation in an embodiment of the present invention;

[0024] Figure 4is a schematic diagram of an application deployment method in an embodiment of the present invention;

[0025] Figure 5 is a structural diagram of an application deployment device in an embodiment of the present invention;

[0026] Figure 6 It is a structural diagram of an electronic device for implementing the application deployment method of an embodiment of the present invention. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and their meanings are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0030] Embodiment 1

[0031] For cluster deployment issues, existing technologies mainly include the following methods:

[0032] Solution 1: Karmada is an open source Kubernetes multi-cluster management solution designed to solve cross-cluster application deployment and management problems. However, Karmada focuses on multi-cluster management and may not be effective in dealing with multi-level configuration and cross-environment deployment of complex applications. In addition, the operation and maintenance tools provided by Karmada mostly focus on basic atomic functions and cannot support complex operation and maintenance scenarios, requiring more manual intervention. In terms of meeting the special storage requirements of different applications, Karmada has poor flexibility and efficiency.

[0033] Solution 2: KubeBlocks is a cloud-native data infrastructure based on Kubernetes, which aims to simplify and optimize the management of database services. It has good scalability, supports elastic expansion and contraction, and can meet the needs of applications of different scales.

[0034] Solution 3: OAM (Open Application Model) provides a declarative way to define applications, allowing operation and maintenance capabilities to be part of the application lifecycle, and defining the operation and maintenance policies required by components by binding traits. This makes it easier for operation and maintenance personnel to manage and monitor applications without having to deeply understand the underlying infrastructure.

[0035] However, the above methods all have certain disadvantages and shortcomings:

[0036] Solution 1: Karmada is mainly used for basic multi-cluster management, such as multi-cluster distribution and state aggregation of a single workload, but it lacks support for multi-level configuration and cross-environment deployment of complex applications. It lacks configuration and deployment management functions for complex applications, which can easily lead to inefficiency and increase the risk of configuration errors.

[0037] Solution 2: KubeBlocks mainly provides declarative database services for cloud platforms, with excellent scalability and support for flexible elastic expansion and contraction. However, it does not support multi-cluster or cross-cluster stateful service deployment and operation, limiting the ability to deploy stateful applications in a multi-cluster environment.

[0038] Solution 3: OAM allows users to describe all components and operation and maintenance operations of modern microservice applications as a "deployment plan" independent of the infrastructure. However, OAM requires users to master and be familiar with a large number of terms, which greatly increases the cognitive burden and operation and maintenance complexity. In addition, OAM does not support multi-cluster or cross-cluster service application operation and management, which limits its application in multi-cluster environments.

[0039] Figure 1is a flow chart of an application deployment method in an embodiment of the present invention. This embodiment is applicable to the case of application deployment. The method can be executed by an application deployment device in an embodiment of the present invention. The device can be implemented in software and / or hardware. Figure 1 As shown, the method specifically comprises the following steps:

[0040] S101: Obtain application custom resources deployed by the user.

[0041] In this embodiment, the application custom resource can be expressed as Application CR, where CR is the abbreviation of CustomResource, which is a custom resource and a specific instance corresponding to CRD, extending the API function of Kubernetes.

[0042] It should be noted that CRD (Custom Resource Definitions) is a Kubernetes custom resource definition, which allows users to extend the functionality of Kubernetes through a declarative API and create and manage custom resources. These resources are not part of the Kubernetes standard API, so that Kubernetes is not limited to built-in resources (such as Pod, Service, etc., where Pod is the smallest deployment unit in Kubernetes, containing one or more containers, with shared storage and network. Service is an abstraction in Kubernetes that defines a logical collection of Pods and provides methods to access these Pods), but can also support user-defined resource types.

[0043] Kubernetes, abbreviated as K8s, is an open source container orchestration platform for automating the deployment, expansion, and management of containerized applications. The main goal of Kubernetes is to help developers and system administrators more easily deploy applications, expand services, and manage containers across host clusters.

[0044] Specifically, obtain the Application CR deployed by the user.

[0045] S102: Obtain a target workload and a configuration file according to the application customized resource rendering workload and cluster distribution strategy.

[0046] In this embodiment, the workload may be represented as workload. Exemplarily, the workload may be, for example, Deployment, which represents a resource object in Kubernetes and is used to manage the deployment and expansion of stateless applications.

[0047] It can be known that the cluster distribution strategy refers to how to manage and allocate resources, tasks or data in the cluster to achieve efficient, reliable and scalable operation.

[0048] It should be noted that the target workload may be the final Kubernetes target workload generated after rendering configuration of the workload.

[0049] It should be explained that the configuration file may be a file obtained by filling in the configuration template according to the configuration information included in the Application CR.

[0050] Specifically, the corresponding workload and cluster distribution strategy are rendered through the Application definition.

[0051] S103. Deploy applications based on the target workload and configuration files.

[0052] Specifically, after the configuration file is generated, the target workload is deployed in the cluster by interacting with the Kubernetes cluster based on the configuration file.

[0053] The embodiment of the present invention obtains the application custom resources deployed by the user, renders the workload and cluster distribution strategy according to the application custom resources, obtains the target workload and configuration file, and deploys the application based on the target workload and configuration file. Through the technical solution of the present invention, the deployment mechanism across multiple clusters is optimized, so that complex applications can be efficiently deployed in different environments to meet diverse needs, improve resource utilization efficiency and application performance, and improve configuration flexibility and adaptability.

[0054] Optionally, the application custom resource contains the cross-cluster distribution rules and configuration information corresponding to the application deployment.

[0055] It is known that cross-cluster distribution rules are usually used to distribute and manage resources, data or tasks among multiple clusters. These rules are very important in distributed systems, microservice architectures and cloud computing environments to ensure efficient use of resources and high availability of the system.

[0056] In this embodiment, the configuration information may be information such as the configuration method of the Kubernetes workload contained in the Application CR deployed by the user. Exemplarily, the configuration information may include: cluster affinity configuration; target cluster (cluster is a set of Kubernetes nodes for running containerized applications); the weight of the target cluster to distribute copies, generally defined as the number of copies to be distributed; automatically labeling nodes to affect scheduling, adding or reducing nodes (node ​​is a machine in the Kubernetes cluster, which can be a physical machine or a virtual machine, running pods) will not cause existing pods to restart; same-node affinity, scheduling by filtering nodes by labels on the nodes; affinity or anti-affinity; cluster taint tolerance settings; cloud template (cloud configuration); cloud instance name (cloud instance name); cloud total number of copies, generally defined as the sum of the weights of all target clusters, and no copies will be created if it is 0.

[0057] According to the application custom resource rendering workload and cluster distribution strategy, the target workload and configuration file are obtained, including:

[0058] The application controller renders the workload according to the configuration information.

[0059] It can be known that in Kubernetes, the Controller is a component used to manage the application state and ensure that the application runs as expected by monitoring resource objects. In this embodiment, the Application Controller is responsible for managing the application life cycle, including operations such as starting, stopping, and restarting, and ensuring the consistency and availability of the application in a multi-cluster environment by monitoring the application state.

[0060] Specifically, users deploy Application CR, and Application Controller renders the corresponding workload through Application definition.

[0061] Render the cluster distribution strategy according to the cross-cluster distribution rules through the application controller.

[0062] Among them, cluster distribution strategies include: propagation strategy and coverage strategy.

[0063] In this embodiment, Propagation Policy and Override Policy are two important configuration policies used to manage and control the distribution and configuration of resources among multiple clusters. Among them, the propagation policy defines how to propagate configurations, resources or tasks from one cluster to other clusters, and it controls the distribution mode and scope of resources. The override policy defines how to handle conflicts when there are conflicts among multiple configurations or resources, and it determines which configuration or resource has a higher priority.

[0064] Specifically, users deploy Application CR, and Application Controller defines the rendering cluster distribution policy Propagation Policy and Override Policy through Application.

[0065] If the target controller detects changes to the workload and cluster distribution strategy, it creates the target workload and configuration file in the target cluster.

[0066] In this embodiment, the target controller may be a TosFed controller. TosFed is a TOS cluster federation, which is a federated multi-cluster container orchestration system in a multi-cluster scenario.

[0067] It should be noted that the target cluster may be a cluster whose workload and cluster distribution strategy have been changed, wherein the target workload and configuration file may be an actually running workload and configuration file.

[0068] Specifically, the TosFed controller monitors changes in resources such as workloads and cluster distribution strategies, and creates actual running workloads and configuration files in the corresponding clusters.

[0069] The technical solution of the embodiment of the present invention supports multi-level configuration and cross-cluster deployment of complex applications in terms of application deployment, greatly improving management efficiency and reducing the risk of errors. By configuring the node-level resource scheduling strategy, resource utilization and system performance are further optimized, achieving maximum utilization of hardware resources.

[0070] Optionally, the configuration information includes a configuration method for the workload.

[0071] In this embodiment, the Application is compatible with the configuration method of native Kubernetes workloads, and supports configuration sharing, configuration heterogeneity and merging. Among them, configuration sharing refers to supporting public configuration templates, such as public configurations such as images. Configuration heterogeneity and merging means that heterogeneous fields can be configured on demand according to different deployment modes / roles / target clusters at the same time, and configuration coverage and merging are automatically performed when workloads are rendered, which improves the flexibility of multi-cluster / cross-cluster deployment.

[0072] Before rendering the workload according to the configuration information through the application controller, it also includes:

[0073] The target heterogeneous fields are set according to the target deployment mode, the target role, and the target cluster, so that when the workload is rendered, the configuration is overwritten and merged according to the target heterogeneous fields.

[0074] In this embodiment, multi-cluster deployment is introduced. Multi-cluster deployment means: designing to support application deployment and management across multiple Kubernetes clusters. It provides cluster-node granularity scheduling control to facilitate cross-cluster resource planning for stateful services. The Application supports direct configuration of the target cluster and target node or selector rules for workload distribution in Cloud / Local mode. The application controller will generate the corresponding Propagation Policy according to the user configuration and finally distribute it to the nodes of the target cluster. When the distribution rules in the Application change, the Propagation Policy will be updated at the same time and the actual number of replicas will be adjusted to the expected value. The distribution rules support selection at the node granularity to implement refined resource planning and configuration for the pods of the workload.

[0075] In this embodiment, hierarchical configuration management is also introduced, and the configuration management process is simplified through hierarchical configuration and embedded templates. Different configuration merging and overwriting strategies are provided for different configuration types to ensure configuration flexibility in different scenarios. The configuration is divided into multiple levels from the outside to the inside according to different deployment modes. The outer configuration can be shared by multiple workloads. For the configuration that does not exist in the inner layer, it will be inherited from the outside. At the same time, each workload is also configured with a unique inner configuration. In Cloud mode, the workload configuration is divided into the outer Role configuration and the inner Cloud configuration. The outer configuration will be inherited to the inner configuration; in Local mode, the workload configuration is divided from the outside to the inside into Role configuration, Local configuration, Instance configuration and Location configuration. If the same workload has different configuration definitions in different clusters, the Application Controller will implement the issuance of different configurations according to different cluster Override Policy rules.

[0076] In multi-cluster deployment and management, configuring heterogeneous fields on demand according to different deployment modes, roles, and target clusters helps ensure that each cluster is optimally configured according to its specific environment and needs. First, define a common configuration template that contains all possible configuration fields, which can include service configuration, resource limits, environment variables, etc. Then, use Override Policy to adjust the configuration according to different deployment modes, roles, and target clusters. This can be done through environment variables, ConfigMap, Secret, or directly in the deployment file. For cross-cluster management, Kubernetes Federation or GitOps tools (such as Argo CD, Flux) can be used to automate the distribution and management of configurations. Finally, use automation scripts and CI / CD tools (such as Jenkins, GitHub Actions) to automate the generation and deployment of configurations. At the same time, use verification tools (such as KubeConform, Kustomize) to ensure the correctness and consistency of the configuration. Use monitoring and logging tools (such as Prometheus, Grafana, ELK Stack) to monitor the effectiveness of the configuration and the running status of the application. Through the above steps, heterogeneous fields can be configured on demand according to different deployment modes, roles, and target clusters, ensuring that the configuration of each cluster meets its specific needs while maintaining configuration consistency and manageability.

[0077] Optionally, render the workload based on the configuration information through the application controller, including:

[0078] Based on the configuration template, the application controller merges the configuration information in sequence according to the inner configuration priority strategy.

[0079] Exemplarily, the configuration template may include: Application version; dry run switch (used to simulate or test the effect of a process or command without actually executing the operation, to help users verify the correctness of the operation and avoid potential errors and risks. By using the dryrun function in command line tools, scripts, configuration files, Web applications, and database migration, the reliability of the system and user confidence can be improved); role definition list; cluster capability control switch (hpa means starting the automatic scaling function for local load); cloud template; local template; shared template, and role template, which will be inherited downward.

[0080] In actual operation, when workload rendering configuration is performed, it is merged in sequence according to the inner configuration priority strategy to generate the final Kubernetes workload.

[0081] Depending on the specific deployment method and target cluster, you can customize the configuration based on the public configuration template.

[0082] Optionally, the inner configuration priority strategy is:

[0083] If the workload is a cloud workload, the role configuration takes precedence over the cloud configuration.

[0084] Specifically, the template inheritance hierarchy order is from outside to inside:

[0085] For cloud workloads: role template→cloud template. Role template indicates role configuration, and cloud template indicates cloud configuration.

[0086] If the workload is a local workload, the role configuration takes precedence over the local configuration, which takes precedence over the instance configuration, which takes precedence over the location configuration.

[0087] Specifically, for local workloads: role template→local template→instance template→location template. Role template indicates role configuration, local template indicates local configuration, instance template indicates instance configuration, and location template indicates location configuration.

[0088] In actual operation, if the inner layer does not define the configuration, it will inherit the outer layer configuration, otherwise it will be overwritten according to the rules.

[0089] For example, Figure 2 FIG. 1 is a schematic diagram of rendering using containers based on various configurations in an embodiment of the present invention. Figure 2 As shown in the figure, based on the role configuration (Role template), local configuration (Local template) and instance configuration (Instance template), the Local c1 container uses the nginx:v2 image, and adds an annotation to the cluster1 cluster to obtain the final rendering 1; based on the role configuration (Role template) and cloud configuration (Cloudtemplate), the Cloud c2 container uses the foobar:v2 image, and the final rendering 2 is obtained.

[0090] In actual operation, when a user has multiple cloud operating system clusters, such as cloud operating systems of version 3.x and version 2.x, considering a wide range of compatibility issues, it is hoped that workloads that have been tested for compatibility will be deployed in different versions of cloud operating systems. Therefore, this embodiment uses Application to customize the configuration of different clusters / different workloads on the basis of maintaining only one configuration template, and finally deploys the desired workload version in the target cluster.

[0091] In particular, for List-type configuration items, such as Containers / Volumes, Application Controller will compare the name of each item and add the configuration to the desired location. For example, the cross-cluster deployment of Quark Executor computing services requires different resources to be applied based on the same configuration template due to the different available resources (CPU, memory) in different clusters. Application's configuration sharing, heterogeneous configuration, and merging features can easily enable workloads in different clusters to use different environment variables to meet user needs.

[0092] The technical solution of the embodiment of the present invention provides a detailed configuration level abstraction in configuration management, which improves the flexibility and scalability of configuration. Through multi-level configuration merging and overwriting, it not only ensures the consistency and accuracy of multi-cluster workload configuration, but also supports independent configuration customization strategies, which can adapt to different complex field environments.

[0093] Optionally, the method further includes:

[0094] If the application detects that the running status of the workload has changed, the application updates the change information to the resource status.

[0095] During actual operation, the Application will monitor the changes in the real-time running status of the workload and update it to the corresponding resource status, making it easier for users to observe the actual running status of the workload.

[0096] Optionally, after implementing application deployment based on the target workload and configuration file, the following is also included:

[0097] Receive custom O&M resources deployed by users.

[0098] In this embodiment, the operation and maintenance custom resource can be represented by Operation CR.

[0099] Specifically, when users perform operation and maintenance operations, such as restarting / pausing pods, they can deploy corresponding operation and maintenance custom resources.

[0100] The operation and maintenance controller formulates operation and maintenance operations according to the defined parameters in the operation and maintenance custom resources.

[0101] Among them, operation and maintenance operations include: starting, stopping, expanding and shrinking.

[0102] In this embodiment, the operation controller focuses on the automation of operation and maintenance operations to achieve dynamic adjustment and optimization of applications. In addition, it provides a set of standardized operation interfaces, including pre-check, execution, inspection and other steps, which facilitate the disassembly and expansion of load operation and maintenance operations. At the same time, it defines commonly used operation and maintenance operations, such as start, stop and restart operations, which simplifies the operation and maintenance process.

[0103] Specifically, after the user deploys the Operation, the Operation Controller will gradually formulate the defined operation and maintenance operations according to the defined parameters in the Operation CR.

[0104] Perform maintenance operations through the target controller.

[0105] Specifically, the Operation Controller performs actual operation and maintenance operations through TosFed.

[0106] In this embodiment, atomic operation and maintenance operations are introduced. Through the atomic operation and maintenance operations of the operation controller, the defined operation and maintenance behaviors are automatically executed to reduce manual intervention. These atomic operation and maintenance operations can be combined and arranged according to actual scenarios and business needs. The Operation Controller encapsulates common cross-cluster operation and maintenance operations to improve the development and operation and maintenance efficiency of cross-cluster platforms. The Operation Controller provides ways to create Override Policy to add special Annotations to workloads, directly operate the resources of member clusters or operate the fields of Applications through the cluster Client, etc., to complete the operation and maintenance operations.

[0107] Optionally, the operation and maintenance operations also include: validation (Validate), execution (Execute) and check (Check).

[0108] The method further includes:

[0109] During the execution of operation and maintenance operations, the execution status and results of the operation and maintenance operations are traced.

[0110] In actual operation, Operation encapsulates common operation and maintenance operations, such as start / stop / scaling, etc., and defines common interfaces for additional operation and maintenance operations to facilitate the expansion of business-customized operation and maintenance operations. At the same time, the actual execution status and results can be traced during execution, which enhances the operation and maintenance capabilities in multi-cluster scenarios.

[0111] Optionally, trace the execution status and results of the operation and maintenance operations during the execution process, including:

[0112] When the execution status is verification, check the validity of the operation and maintenance parameters and verify the status of the operation object.

[0113] Specifically, during the verification phase, the validity of the Operation parameters will be checked and the status of the operation object will be verified. If not satisfied, the operation will be rejected.

[0114] When the execution status is Executing, the operation and maintenance operation is performed.

[0115] Specifically, during the execution phase, corresponding operation and maintenance operations are performed, such as restarting the pod or updating the fields of the Application CR.

[0116] When the execution state is checking, the loop checks the expected state of the workload.

[0117] Specifically, during the inspection phase, some Operations need to verify the execution results of the operation and maintenance operations. They will check the expected status of the pod or workload in a loop and eventually update it to the status field of the Operation CR.

[0118] The technical solution of the embodiment of the present invention, in terms of operation and maintenance, provides standard operation and maintenance atomic operations CR, which facilitates rapid integration into the operation and maintenance workflow, reduces manual intervention, and reduces the complexity and cost of operation and maintenance.

[0119] For example, Figure 3 1 is a schematic diagram of tracing the execution status and execution results of an operation and maintenance operation during the execution of the operation and maintenance operation in an embodiment of the present invention. Figure 3 As shown in the figure, when the Operation Phase is the Validate phase, the corresponding Operation Status is Validating. When the Operation Phase is the Execute phase, the corresponding Operation Status is Running. When the Operation Phase is the Check phase, some Operations need to verify the execution results of the operation and maintenance operations. The expected status of the pod or workload will be checked in a loop, such as Success or Failure, and finally updated to the status field of the Operation CR.

[0120] The technical solution of the embodiment of the present invention, first, optimizes the deployment mechanism across multiple clusters, so that complex applications can be efficiently deployed in different environments to meet diverse needs; second, it implements more refined resource scheduling, and can allocate resources across clusters and specific nodes, thereby improving resource utilization efficiency and application performance; in addition, by introducing hierarchical configuration and embedded templates, it simplifies configuration management, reduces configuration errors, and improves configuration flexibility and adaptability. The embodiment of the present invention also enhances the operation and maintenance capabilities of the application, and by defining standardized atomic operation and maintenance operations, it achieves high scalability of operation and maintenance operations and reduces costs and complexity. Finally, the present invention supports diverse storage needs and provides flexible volume mounting strategies to adapt to different application scenarios and storage requirements.

[0121] As an exemplary description of an embodiment of the present invention, Figure 4 FIG. 1 is a schematic diagram of an application deployment method in an embodiment of the present invention. Figure 4As shown, the user deploys Application CR, and the application controller ApplicationController renders the corresponding workload and cluster distribution strategy through Application definition. The TosFed controller monitors the changes of these resources and creates the actual running workload and configuration files in the corresponding clusters. For example, Sync Workload Cluster1, Cluster2, and Cluster3 complete the startup (OPStart). When the user performs operation and maintenance operations, such as restart (OP Restart) / pause (OP Stop), by creating the corresponding operation and maintenance Operation CR, the operation and maintenance controller Operation Controller performs the actual operation and maintenance operation through TosFed, that is, Operation Pod, and at the same time, the actual execution status and results (Status Update) are fed back to the application controller Application Controller during execution.

[0122] The technical solution of the embodiment of the present invention provides a mechanism to support unified management and coordination of workloads in a multi-cluster environment, solving the problems of cross-cluster resource scheduling and application deployment; at the same time, it introduces configuration level abstraction, simplifies the configuration management of multi-cluster / cross-cluster deployment, and supports dynamic configuration merging and updating; in addition, it also provides a multi-cluster / cross-cluster atomic operation and maintenance tool, defines an extensible interface, simplifies daily management tasks, and improves operation and maintenance efficiency and accuracy.

[0123] Embodiment 2

[0124] Figure 5 is a schematic diagram of the structure of an application deployment device in an embodiment of the present invention. This embodiment is applicable to the case of application deployment. The device can be implemented in software and / or hardware. The device can be integrated in any device that provides the function of application deployment, such as Figure 5 As shown, the application deployment device specifically includes: an acquisition module 201, a rendering module 202 and a deployment module 203.

[0125] Wherein, the acquisition module 201 is used to acquire the application custom resources deployed by the user;

[0126] A rendering module 202, configured to obtain a target workload and a configuration file according to the application custom resource rendering workload and cluster distribution strategy;

[0127] The deployment module 203 is used to deploy the application based on the target workload and the configuration file.

[0128] Optionally, the application custom resource includes cross-cluster distribution rules and configuration information corresponding to application deployment;

[0129] The rendering module 202 includes:

[0130] A first rendering unit, configured to render the workload according to the configuration information through an application controller;

[0131] A second rendering unit, configured to render a cluster distribution strategy according to the cross-cluster distribution rule through an application controller, wherein the cluster distribution strategy includes: a propagation strategy and an overlay strategy;

[0132] The creation unit is configured to create a target workload and a configuration file in a target cluster if the target controller monitors changes to the workload and the cluster distribution strategy.

[0133] Optionally, the configuration information includes a configuration method of the workload;

[0134] The device also includes:

[0135] The setting unit is used to set the target heterogeneous field according to the target deployment mode, the target role and the target cluster, so that when the workload is rendered, the configuration is overwritten and merged according to the target heterogeneous field.

[0136] Optionally, the first rendering unit is specifically used for:

[0137] Based on the configuration template, the configuration information is sequentially merged according to the inner configuration priority strategy through the application controller.

[0138] Optionally, the inner layer configuration priority strategy is:

[0139] If the workload is a cloud workload, the role configuration takes precedence over the cloud configuration;

[0140] If the workload is a local workload, the role configuration takes precedence over the local configuration which takes precedence over the instance configuration which takes precedence over the location configuration.

[0141] Optionally, the device further comprises:

[0142] The update module is used to update the change information to the resource status if the application monitors that the running status of the workload has changed.

[0143] Optionally, the device further comprises:

[0144] The receiving module is used to receive the operation and maintenance custom resources deployed by the user;

[0145] A formulation module, used to formulate operation and maintenance operations according to the definition parameters in the operation and maintenance custom resources through the operation and maintenance controller, and the operation and maintenance operations include: starting, stopping, expanding and shrinking;

[0146] An execution module is used to execute the operation and maintenance operation through a target controller.

[0147] Optionally, the operation and maintenance operation further includes: verification, execution and inspection;

[0148] The device also includes:

[0149] The tracing module is used to trace the execution status and execution results of the operation and maintenance operation during the execution of the operation and maintenance operation.

[0150] Optionally, the tracing module is specifically used for:

[0151] When the execution status is verification, verify the legitimacy of the operation and maintenance parameters, and verify the status of the operation object;

[0152] When the execution state is execution, executing the operation and maintenance operation;

[0153] When the execution state is checking, the expected state of the workload is checked cyclically.

[0154] The above-mentioned product can execute the application deployment method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0155] Embodiment 3

[0156] Figure 6 A schematic diagram of the structure of an electronic device 30 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0157] like Figure 6As shown, the electronic device 30 includes at least one processor 31, and a memory connected to the at least one processor 31, such as a read-only memory (ROM) 32, a random access memory (RAM) 33, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 31 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 32 or the computer program loaded from the storage unit 38 to the random access memory (RAM) 33. In the RAM 33, various programs and data required for the operation of the electronic device 30 can also be stored. The processor 31, the ROM 32, and the RAM 33 are connected to each other through a bus 34. An input / output (I / O) interface 35 is also connected to the bus 34.

[0158] A number of components in the electronic device 30 are connected to the I / O interface 35, including: an input unit 36, such as a keyboard, a mouse, etc.; an output unit 37, such as various types of displays, speakers, etc.; a storage unit 38, such as a disk, an optical disk, etc.; and a communication unit 39, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 39 allows the electronic device 30 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0159] The processor 31 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 31 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 31 performs the various methods and processes described above, such as the application deployment method:

[0160] Get the application custom resources deployed by the user;

[0161] Obtaining a target workload and a configuration file according to the application custom resource rendering workload and cluster distribution strategy;

[0162] An application is deployed based on the target workload and the configuration file.

[0163] In some embodiments, the application deployment method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 38. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 30 via the ROM 32 and / or the communication unit 39. When the computer program is loaded into the RAM 33 and executed by the processor 31, one or more steps of the application deployment method described above may be performed. Alternatively, in other embodiments, the processor 31 may be configured to execute the application deployment method in any other appropriate manner (e.g., by means of firmware).

[0164] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0165] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0166] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0167] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0168] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0169] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0170] In one embodiment, the embodiment of the present invention further includes a computer program product, the computer program product includes a computer program, and the computer program implements the application deployment method of any embodiment of the present invention when executed by a processor.

[0171] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0172] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0173] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. An application deployment method, characterized in that: include: Get the application custom resources deployed by the user; Obtaining a target workload and a configuration file according to the application custom resource rendering workload and cluster distribution strategy; An application is deployed based on the target workload and the configuration file.

2. The method according to claim 1, characterized in that: The application custom resources include cross-cluster distribution rules and configuration information corresponding to application deployment; According to the application customized resource rendering workload and cluster distribution strategy, a target workload and configuration file are obtained, including: Rendering the workload according to the configuration information by an application controller; Rendering a cluster distribution strategy according to the cross-cluster distribution rule by an application controller, wherein the cluster distribution strategy includes: a propagation strategy and an overlay strategy; If the target controller monitors the workload and the cluster distribution policy changes, a target workload and configuration file are created in the target cluster.

3. The method according to claim 2, characterized in that The configuration information includes a configuration method of the workload; Before rendering the workload according to the configuration information through the application controller, the method further includes: The target heterogeneous fields are set according to the target deployment mode, the target role, and the target cluster, so that when the workload is rendered, the configuration is overwritten and merged according to the target heterogeneous fields.

4. The method according to claim 2, characterized in that: Rendering the workload according to the configuration information by the application controller includes: Based on the configuration template, the configuration information is sequentially merged according to the inner configuration priority strategy through the application controller.

5. The method according to claim 4, characterized in that The inner layer configuration priority strategy is: If the workload is a cloud workload, the role configuration takes precedence over the cloud configuration; If the workload is a local workload, the role configuration takes precedence over the local configuration which takes precedence over the instance configuration which takes precedence over the location configuration.

6. The method according to claim 1, characterized in that Also includes: If the application detects that the running state of the workload has changed, the application updates the change information to the resource state.

7. The method according to claim 1, characterized in that After implementing application deployment based on the target workload and the configuration file, the method further includes: Receive custom O&M resources deployed by users; Formulate operation and maintenance operations according to the defined parameters in the operation and maintenance custom resources through the operation and maintenance controller, and the operation and maintenance operations include: starting, stopping, expanding and shrinking; The operation and maintenance operation is performed through the target controller.

8. The method according to claim 7, characterized in that The operation and maintenance operations also include: verification, execution and inspection; The method further comprises: During the execution of the operation and maintenance operation, the execution status and execution result of the operation and maintenance operation are traced back.

9. The method according to claim 8, characterized in that During the execution process, the execution status and results of the operation and maintenance operations are traced, including: When the execution status is verification, verify the legitimacy of the operation and maintenance parameters, and verify the status of the operation object; When the execution state is execution, executing the operation and maintenance operation; When the execution state is checking, the expected state of the workload is checked cyclically.

10. An application deployment device, characterized in that: include: The acquisition module is used to obtain the application custom resources deployed by the user; A rendering module, configured to obtain a target workload and a configuration file according to the application's custom resource rendering workload and cluster distribution strategy; A deployment module is used to deploy an application based on the target workload and the configuration file.

11. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the application deployment method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the application deployment method according to any one of claims 1 to 9 when executed.

13. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the application deployment method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Application deployment method and system

    CN111984270A

  • Container cluster management method, device and system, electronic equipment and storage medium

    CN113687912A

  • Resource scheduling method and device, computer equipment, storage medium and program product

    CN114528085A

  • CRD application integration calling method and device in k8s container cloud platform

    CN115357369A

  • Cloud native application publishing method and device, electronic equipment and storage medium

    CN115469887A

Cited By

  • Switch management method and device applied to kubernetes GPU cluster, electronic equipment, storage medium and computer program product

    CN121151353A