Component deployment method and device, equipment, storage medium and product
By installing and deploying a gateway based on customer resource component information, sending component association information to the component registration center, and completing component deployment, the complex problems of existing microservice deployment and operation and maintenance are solved, and unified configuration management and full life cycle management of microservices are realized.
Patent Information
- Application Number
- CN202510104588.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-05-13
AI Technical Summary
The deployment and operation and maintenance of existing microservices are complex, and the traditional CI/CD pipeline requires multiple tools to work together, and the installation, configuration and maintenance are complex. Environmental consistency is difficult to ensure, and problem investigation is time-consuming and complex.
By determining the component information to be deployed based on the customer resource component information, performing component installation and deployment of the gateway, sending component association information to the component registration center, and completing component deployment. This method monitors the creation, update and deletion of CRD objects and can automatically parse them to achieve management of the entire life cycle of PBC components.
It solves the complex problems of microservice deployment and operation and maintenance, realizes unified configuration management of microservices, simplifies component deployment and operation and maintenance processes, and reduces labor costs.
Smart Images

Figure CN119987798A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of IT application technology, and in particular to component deployment. Background Art
[0002] When deploying, maintaining and upgrading microservice applications, traditional CI / CD pipelines usually require the collaboration of multiple tools, such as Jenkins, GitLab CI, Travis CI, etc. The installation, configuration and maintenance of these tools are usually very complicated, and it is very difficult to maintain consistency in configuration and management between different environments (such as development, testing, and production). Different configuration files and scripts are required to handle the differences between environments.
[0003] When a microservice application fails to be built or deployed, troubleshooting the root cause of the problem may require analyzing the logs and outputs of multiple tools, which is time-consuming and complicated, making it difficult to troubleshoot the problem. There may be hidden dependencies in CI / CD scripts and processes, especially when different teams develop and maintain different parts, making it difficult to locate the problem. At the same time, when conducting troubleshooting, certain technical capabilities and experience are required, which is labor-intensive. Therefore, how to solve the complexity of existing microservice deployment and operation and maintenance has become an urgent problem to be solved. Summary of the invention
[0004] The main purpose of this application is to provide a component deployment method, device, equipment, storage medium and product, aiming to solve the complex technical problems of existing microservice deployment and operation and maintenance.
[0005] To achieve the above objectives, the present application proposes a component deployment method, which includes: Determine the corresponding component information to be deployed according to the customer resource component information; Install components and deploy gateways according to the information of components to be deployed, and obtain target installation components and target gateway deployment results; Sending component association information corresponding to the target installation component to a component registration center to obtain target feedback information; The component deployment is completed according to the target installation component, the target gateway deployment result and the target feedback information.
[0006] In one embodiment, the step of installing components and deploying gateways according to the to-be-deployed component information to obtain target installation component and target gateway deployment results includes: Determine the target component identification code, configuration file location and gateway configuration file information according to the component information to be deployed; Install the component according to the target component identification code and the configuration file location to obtain a target installation component; The gateway is deployed according to the gateway configuration file information to obtain a target gateway deployment result.
[0007] In one embodiment, after the step of installing components and deploying gateways according to the to-be-deployed component information to obtain target installation component and target gateway deployment results, the step further includes: Determine the component dependency object of each component deployment unit according to the target installation component; Compare the component dependency object and the component deployment object set to obtain a target component comparison result; When the target component comparison result is a component comparison success result, a component auxiliary container is injected into the component deployment unit.
[0008] In one embodiment, after the step of completing component deployment according to the target installation component, the target gateway deployment result and the target feedback information, the method further includes: Compare the current component state with the target component state to obtain a state comparison result; When the state comparison result is a state inconsistency result, determining a target coordination failure and generating a component change event; The target coordination failure is repaired according to the component change event.
[0009] In one embodiment, after the step of completing component deployment according to the target installation component, the target gateway deployment result and the target feedback information, the method further includes: When the number of deployment units is changed, the number of workloads in the customer resource component information is modified according to the user's change requirements to obtain the modified customer resource component information; Generate a component change event according to the modified customer resource component information; The number of deployment units is changed according to the component change event.
[0010] In one embodiment, after the step of completing component deployment according to the target installation component, the target gateway deployment result and the target feedback information, the method further includes: When there is a component version problem, modify the component version information in the customer resource component information based on the preset component version to obtain the customer resource component information after the version is modified; The version modification of the component is completed according to the customer resource component information after the version modification.
[0011] In addition, to achieve the above purpose, the present application also proposes a component deployment device, the component deployment device comprising: A processing module, used to determine corresponding component information to be deployed according to the customer resource component information; An installation module is used to install components and deploy gateways according to the information of the components to be deployed, and obtain target installation components and target gateway deployment results; A sending module, used for sending the component association information corresponding to the target installation component to the component registration center to obtain target feedback information; A deployment module is used to complete component deployment according to the target installation component, the target gateway deployment result and the target feedback information.
[0012] In addition, to achieve the above objectives, the present application also proposes a component deployment device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the component deployment method described above.
[0013] In addition, to achieve the above objectives, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the component deployment method described above are implemented.
[0014] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the component deployment method described above are implemented.
[0015] This application determines the corresponding component information to be deployed according to the customer resource component information; installs the component and deploys the gateway according to the component information to be deployed, and obtains the target installation component and the target gateway deployment result; sends the component association information corresponding to the target installation component to the component registration center to obtain the target feedback information; completes the component deployment according to the target installation component, the target gateway deployment result and the target feedback information. By monitoring the creation, update and deletion of CRD objects and being able to automatically parse CRD objects, the management of the entire life cycle of PBC components is achieved, which solves the complex problems of microservice deployment and operation and maintenance, and realizes unified configuration management of microservices. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0018] Figure 1 A flowchart of the first embodiment of the component deployment method of the present application is provided; Figure 2 A schematic diagram of the PBC engine architecture provided for the first embodiment of the component deployment method of the present application; Figure 3 A schematic diagram of a controller workflow provided for the first embodiment of the component deployment method of the present application; Figure 4 A flowchart of the second embodiment of the component deployment method of the present application is provided; Figure 5 This is a schematic diagram of the module structure of the component deployment device of the embodiment of the present application; Figure 6 A schematic diagram of the device structure of the hardware operating environment involved in the component deployment method in the embodiment of the present application.
[0019] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0020] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0021] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0022] The main solution of the embodiment of the present application is: determine the corresponding component information to be deployed according to the customer resource component information; install the component and deploy the gateway according to the component information to be deployed, and obtain the target installation component and the target gateway deployment result; send the component association information corresponding to the target installation component to the component registration center to obtain the target feedback information; complete the component deployment according to the target installation component, the target gateway deployment result and the target feedback information.
[0023] When deploying, maintaining and upgrading microservice applications, traditional CI / CD pipelines usually require the collaboration of multiple tools, such as Jenkins (an open source automation server mainly used in the field of continuous integration and continuous delivery), GitLab CI (GitLab continuous integration, GitLab CI is a built-in tool provided by GitLab), Travis CI (Travis CI, Travis CI is a cloud-based continuous integration service), etc. The installation, configuration and maintenance of these tools are usually very complicated, and it is very difficult to maintain consistency in configuration and management between different environments (such as development, testing, and production). Different configuration files and scripts are required to handle the differences between environments.
[0024] When a microservice application fails to be built or deployed, troubleshooting the root cause of the problem may require analyzing the logs and outputs of multiple tools, which is time-consuming and complicated, making it difficult to troubleshoot the problem. There may be hidden dependencies in CI / CD scripts and processes, especially when different teams develop and maintain different parts, making it difficult to locate the problem. At the same time, when conducting troubleshooting, certain technical capabilities and experience are required, which is labor-intensive. Therefore, how to solve the complexity of existing microservice deployment and operation and maintenance has become an urgent problem to be solved.
[0025] This application determines the corresponding component information to be deployed according to the customer resource component information; installs the component and deploys the gateway according to the component information to be deployed, and obtains the target installation component and the target gateway deployment result; sends the component association information corresponding to the target installation component to the component registration center to obtain the target feedback information; completes the component deployment according to the target installation component, the target gateway deployment result and the target feedback information. By monitoring the creation, update and deletion of CRD objects and being able to automatically parse CRD objects, the management of the entire life cycle of PBC components is achieved, which solves the complex problems of microservice deployment and operation and maintenance, and realizes unified configuration management of microservices.
[0026] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or a component deployment device capable of realizing the above functions, etc. The following takes the component deployment device as an example of the execution subject, such as a controller, to illustrate this embodiment and the following embodiments.
[0027] Based on this, the present application embodiment provides a component deployment method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the component deployment method of the present application.
[0028] In this embodiment, the component deployment method includes steps S10 to S40: Step S10, determining corresponding component information to be deployed according to the customer resource component information; It should be noted that if Figure 2As shown, in order to overcome the rapid iteration and automatic deployment of each microservice in the existing microservice management, each microservice requires an independent CI / CD (Continuous Integration and Continuous Delivery / Deployment, referred to as continuous integration, continuous delivery and continuous deployment) pipeline, but it brings various defects such as complex pipeline management, high resource consumption, version incompatibility, difficult to ensure environmental consistency, and complex dependency management and automatic testing. This embodiment provides an assembly application architecture method based on the Operator mode to achieve automatic management of the entire life cycle of PBC (Packaged Business Capability) components. This embodiment focuses on the following core issues: life cycle management of component applications, automatic deployment of component applications, dependency management between components, component hybrid configuration management, and unified security management and control between components. The PBC engine is a tool or platform for managing and deploying componentized applications, acting as a control plane to manage the entire life cycle of component applications. The PBC engine is designed to take over the responsibilities of operation and maintenance personnel, solve problems such as deploying components, running components, starting clusters, upgrading components, and handling component deployment or operation failures.
[0029] Among them, Custom Resource Definition (CRD): used to define two new types of components and configurations, which can accurately describe the various properties and configurations of components. These new CRD types can be recognized and managed by Kubernetes (an open source container orchestration platform), thereby achieving unified configuration, deployment, monitoring and management at the cluster level. components.openPBC.cmcc.com is used to describe the PBC standard definition expected by users, which contains six categories of capability descriptions of assembled applications. configurators.openPBC.cmcc.com is used to describe the configuration metadata such as the registry center and observability center that all components under a tenant depend on. kubectl / helm refers to the Kubernetes command line tool / a package management tool for Kubernetes. K8s API refers to Kubernetes API. In the Kubernetes system, API is the main way to interact with the cluster and is used to manage various resources of the cluster. helm Server refers to the helm server. pbc-webhook refers to a mechanism implemented through HTTP callback (applet or script). pbc-gateways refers to the PBC gateway. pbc-default-conflg refers to the PBC default configuration. pbc-operator refers to the PBC operation and maintenance tool. pbc-operator POD refers to the PBC operator Pod. pbc-operatorREPLICASET refers to the PBC operator replica set. pbc-operator DEPLOYMENT refers to the PBC operator deployment. sample-component CR refers to the sample component CR. sample-ConfigMap CR refers to the sample ConfigMap CR. CR (Custom Resourse) customer resources are specific instances that implement CRD, pbccomfig refers to PBC configuration, helmchartvalue refers to Helm chart value, Browser refers to browser, Kafka proxy refers to KafkaProxy, Envoy gateway refers to Envoy Gateway, sidecar refers to a container that coexists with the application container in the same pod, and agent refers to the agent; Figure 3As shown, the controller is responsible for monitoring and responding to changes in custom CRD objects to maintain the stability of the application or system. The controller subscribes to the events of the CRD object through Kubemetes APlServer and performs corresponding operations based on the event type. PBC-Operator: Executes creation logic when listening to the components CRD object creation event, executes update logic when listening to the components CRD object update event, and executes deletion logic when listening to the components CRD object deletion event. PBC-webhook: listens to the creation event of the business component podcr, and injects the API message, security, management and other plug-in capabilities required by the PBC specification into the business application pod (the smallest deployable unit in Kubernetes, encapsulating one or more containers, and the most basic scheduling unit in Kubernetes) in the form of sidecar (an auxiliary container that runs in the same Pod with the main container to provide additional functions, such as service mesh agent, log collector, monitoring agent, etc.). Among them, user refers to the user, tracking refers to tracking, change events refers to change events, In case of error refers to when an error occurs, reconcile refers to coordination, Create Pod refers to creating a Pod, Kube-apiserver refers to the Kubernetes API server, adjust refers to adjustment, mututating refers to an object that can modify Kubernetes resource requests before the object is persisted, and Current state refers to the actual state of each resource in the cluster.
[0030] It is understandable that customer resource component information refers to the component custom resource information (component CR) created by the user through kubectl, including but not limited to the configuration information of the component's core API capabilities, core event capabilities, user interface capabilities, management interfaces, security-related interfaces, and deployment process. The information of the component to be deployed includes the warehouse name of the Helmchart package (the packaging format of Kubernetes applications), the name of the chart package (specific Helm Chart instance), the name of the deployed Helm realease (the unique identifier of the specific application instance installed through Helm), and the configuration data location of values.yaml (a configuration file in the Helm Chart).
[0031] In the specific implementation, the user creates the sample-componentsCR object and the sample-ConfigMapCR object through kubectl, and then the controller monitors the components instance, obtains the configuration information of the component's core API capability, core event capability, user interface capability, management interface, security-related interface, and deployment process, and then determines the configuration information of the component deployment process, that is, the repository name of the Helm chart package, the chart package name, the name of the deployed Helmrealease, and the configuration data location of values.yaml.
[0032] Step S20, installing components and deploying gateways according to the information of components to be deployed, and obtaining target installation components and target gateway deployment results; It can be understood that the target installation component refers to the component to be installed through the to-be-deployed component information, and the target gateway deployment result refers to the result of whether the gateway deployment is completed.
[0033] In the specific implementation, the installation interface of the Helm API server (which is the backend service of Helm and provides an interface for interacting with the Kubernetes cluster) is called according to the warehouse name of the Helm chart package, the name of the chart package, the name of the deployed Helmrealease, and the configuration data location of values.yaml to install or upgrade the application and obtain the target installation component. Then, the gateway is deployed according to the configuration file of the deployment gateway defined in the component CR to obtain the target gateway deployment result.
[0034] In a feasible implementation manner, step S20 may further include steps A21 to A23: Step A21, determining the component dependent object of each component deployment unit according to the target installation component; It should be noted that the component dependency object (Owner object) indicates that a resource object is the "owner" of another resource object and is used to track the dependency relationship between resources.
[0035] In the specific implementation, webhook (an HTTP callback to implement custom logic) monitors the creation events of all pods in the namespace partition corresponding to the component CR, and then determines the Owner object corresponding to each component deployment unit (pod), that is, the component dependency object.
[0036] Step A22, comparing the component dependency object and the component deployment object set to obtain a target component comparison result; It can be understood that the component deployment object set includes but is not limited to Deployment, DaemonSet, ReplicaSet, StatefulSet, Pod, ReplicationController, etc. in the chart package, and the target component comparison result refers to the comparison result of whether the component dependency object belongs to the component deployment object set.
[0037] In the specific implementation, the Owner object corresponding to each component deployment unit (pod) is compared with the Deployment, DaemonSet, ReplicaSet, StatefulSet, Pod, ReplicationController, etc. in the chart package to determine whether the component dependency object belongs to the component deployment object set, and then obtain the target component comparison result.
[0038] Step A23, when the target component comparison result is a component comparison success result, injecting a component auxiliary container into the component deployment unit.
[0039] In the specific implementation, when the target component comparison result is a successful component comparison result, it indicates that the component dependency object belongs to the component deployment object set, and then the webhook service will inject the sidecar (an auxiliary container running in the same Pod with the main container) that accesses the external service into the pod.
[0040] Step S30, sending the component association information corresponding to the target installation component to the component registration center to obtain target feedback information; It can be understood that the target feedback information refers to the information fed back by the component registration center on whether the data reported by the controller is received.
[0041] In the specific implementation, the IP, port and other information of each service in the component will be registered to the registration center; and the sidecar that has been injected into the workload pod will automatically send the observable data to the observability center to determine the target feedback information.
[0042] Step S40, completing component deployment according to the target installation component, the target gateway deployment result and the target feedback information.
[0043] It can be understood that after the components are installed through the component information to be deployed, the gateway deployment is completed, and the IP, port and other information of each service in the component are sent to the component registration center, the component deployment is completed.
[0044] In a feasible implementation manner, step S40 may further include steps A41 to A43: Step A41, comparing the current component state with the target component state to obtain a state comparison result; It can be understood that the current component state refers to the actual running state of the component in the Kubernetes cluster, and the target component state refers to the target state that the user wants the component to achieve. It is the expected configuration defined by the user by submitting resource objects (such as Component CR), which describes the behavior and properties that the component should have. The state comparison result refers to the comparison result of whether the current component state is consistent with the target component state.
[0045] In the specific implementation, the actual running status of the component in the Kubernetes cluster is compared with the target status that the user wants the component to achieve, and then the comparison result of whether the current component status is consistent with the target component status is determined, that is, the status comparison result.
[0046] Step A42, when the state comparison result is a state inconsistency result, determining a target coordination failure and generating a component change event; It can be understood that the target coordination failure refers to a failure in the controller coordination process, and the component change event is used for the controller to automatically repair the problem. The component change event refers to an event generated by the system when the controller detects that the status of a component has changed during the coordination process.
[0047] In a specific implementation, when the status comparison result is an inconsistent status result, it indicates that the actual running status of the component in the Kubernetes cluster does not reach the component status expected by the user, and then determines that the controller fails during the coordination process, and then generates a component change event.
[0048] Step A43: repair the target coordination fault according to the component change event.
[0049] In the specific implementation, when the controller detects a component change event, it re-executes the steps of obtaining configmap information, using Helm to install components, deploying Envoy gateway, injecting sidecar into the application pod, and registering the IP and port information of each service in the component to the registration center to complete the repair of the controller coordination failure.
[0050] In a feasible implementation manner, step S40 may further include steps B41 to B43: Step B41, when there is a change in the number of deployment units, the number of workloads in the customer resource component information is modified according to the user's change requirements to obtain the modified customer resource component information; It can be understood that the number of deployment units refers to the number of pods of the component's workload, the user change requirement refers to the user's requirement to change the number of pods of the component's workload, including increasing or decreasing the number of pods of the component's workload, and the number of workloads refers to the number of workloads in sample-componentsCR.
[0051] In a specific implementation, when the user has a need to change the number of deployment units, the number of workloads in sample-componentsCR is changed according to the user's need to increase or decrease the number of pods of the component's workload to obtain the modified customer resource component information.
[0052] Step B42, generating a component change event according to the modified customer resource component information; In a specific implementation, when the modified customer resource component information is obtained, the modified customer resource component information is submitted to kubernetes through kubectl, thereby generating a component change event.
[0053] Step B43: Change the number of deployment units according to the component change event.
[0054] In the specific implementation, when the controller detects a component change event, it re-executes the steps of obtaining configmap information, using Helm to install components, deploying Envoy gateway, injecting sidecar into the application pod, and registering the IP and port information of each service in the component to the registration center to achieve dynamic expansion and reduction of components.
[0055] In a feasible implementation manner, step S40 may further include steps C41-C42: Step C41, when there is a component version problem, modify the component version information in the customer resource component information based on the preset component version to obtain the customer resource component information after the version modification; It is understandable that the preset component version refers to a pre-set component version. This embodiment takes version v1 as an example, which is the initial component version.
[0056] In the specific implementation, components CR and Configmap CR are versioned. After the deployment is upgraded from version v1 to v2, if a version problem is found at any time, just roll back the versions of components CR and Configmap CR to v1, that is, modify the component version information in the customer resource component information according to the preset component version (v1) to obtain the customer resource component information after the modified version.
[0057] Step C42, completing the version modification of the component according to the modified version of the customer resource component information.
[0058] In the specific implementation, after obtaining the customer resource component information after the version is modified, the steps of obtaining configmap information, using Helm to install components, deploying Envoy gateway, injecting sidecar into the application pod, and registering the IP and port information of each service in the component to the registration center are re-executed to realize component upgrade and rollback.
[0059] It should be noted that the component deployment process of this embodiment is specifically as follows: 1) Component declarative management: the user declares the final state of the component he wants in the sample-componentsCR file according to the specification of the component CRD; 2) Component automated deployment and operation and maintenance: 2.1: Create component components: Users use kubectl to create sample-componentsCR objects and sample-ConfigMapCR objects. The controller monitors the components instance and obtains the configuration information of the component's core API capabilities, core event capabilities, user interface capabilities, management interfaces, security-related interfaces, and deployment process.
[0060] 2.2: Get configmap information: The deployment process capability configuration information of component CR includes the values.yaml required for component Helm deployment, the name of the configmap corresponding to PBC-config.yaml, and the corresponding data key. Based on this information, load the yaml data of the configuration data required for component deployment from the k8s cluster, and then parse it into the data structure corresponding to the configuration.
[0061] 2.3: Use Helm's installation component: The component CR defines the configuration information of the deployment process, including the repository name of the Helm chart package, the chart package name, the name of the deployed Helm realease, and the configuration data location of values.yaml. With this information, call the installation interface of the Helm API server to install or upgrade the application.
[0062] 2.4: Deploy Envoy Gateway: In the core capabilities of the deployment process of component CR, the configuration file PBC-config information for deploying the gateway is defined, including the machine node, service type, port list, oidc authentication, etc. of the deployed gateway. The gateway instance is deployed based on this information.
[0063] 2.5: Application pod injection sidecar: webhook monitors the creation events of all pods in the namespace partition corresponding to component CR; when the Owner object corresponding to the pod is one of Deployment, DaemonSet, ReplicaSet, StatefulSet, Pod, and ReplicationController in the application chart package, the webhook service will inject the sidecar for accessing external services into the pod.
[0064] 2.6: The IP, port and other information of each service in the component will be registered to the registration center; and the sidecar injected into the workload pod will automatically send the observable data to the observability center.
[0065] 3) Component predictive maintenance and automatic repair: During the operation of a component, if an error occurs during the controller reconcile process and the status is inconsistent with expectations, Kubernetes will generate a component change event. After the controller monitors this change event, it will re-execute steps 2.2-2.6 to automatically repair the problem.
[0066] 4) Dynamic expansion and reduction of components: When a component wants to increase or reduce the number of pods of its workload, it only needs to modify the number of workloads in the sample-componentsCR and submit it to Kubernetes through kubectl, thereby generating a component change event. After the controller monitors this change event, it will re-execute steps 2.2-2.6 to achieve dynamic expansion and reduction of components.
[0067] 5) Unified component configuration management: When the configuration in a component needs to be changed, the user modifies the component configuration data in the sample-componentsCR and sample-ConfigmapCR and submits it to Kubernetes through kubectl, thereby generating a component change event. After the controller monitors this change event, it will re-execute steps 2.2-2.6 to implement component configuration management.
[0068] 6) Automatic upgrade and rollback: Components CR and Configmap CR have versions. When the deployment is upgraded from version v1 to v2; whenever a version problem is found, just roll back the versions of components CR and Configmap CR to v1, and steps 2.2-2.6 will be re-executed to implement component upgrade and rollback.
[0069] 7) Modularity and pluggability: Each component is an independent module, corresponding to an independent components CR object. The controller can manage and maintain multiple components. Each component is pluggable. Submitting a components CR object deploys a component, and deleting a components CR object uninstalls a component.
[0070] This embodiment determines the corresponding component information to be deployed according to the customer resource component information; installs the component and deploys the gateway according to the component information to be deployed, obtains the target installation component and the target gateway deployment result; sends the component association information corresponding to the target installation component to the component registration center, obtains the target feedback information; completes the component deployment according to the target installation component, the target gateway deployment result and the target feedback information. By monitoring the creation, update and deletion of CRD objects and being able to automatically parse CRD objects, the management of the entire life cycle of PBC components is achieved, the complex deployment and operation and maintenance of microservices is solved, and unified configuration management of microservices is achieved.
[0071] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 4 , step S20 in the component deployment method further includes steps S21 to S23: Step S21, determining the target component identification code, configuration file location and gateway configuration file information according to the component information to be deployed; It can be understood that the target component identification code includes but is not limited to the warehouse name of the Helm chart package, the chart package name, the deployed Helm realease name, etc., the configuration file location refers to the configuration data location of values.yaml, and the gateway configuration file information includes but is not limited to the machine node where the gateway is deployed, service type, port list, oidc authentication, etc.
[0072] Step S22, installing the component according to the target component identification code and the configuration file location to obtain a target installation component; In the specific implementation, according to the warehouse name of the Helm chart package, the name of the chart package, the name of the deployed Helmrealease, and the configuration data location of values.yaml; through this information, the installation interface of the Helm API server is called to install or upgrade the application and obtain the target installation component.
[0073] Step S23, performing gateway deployment according to the gateway configuration file information to obtain a target gateway deployment result.
[0074] In the specific implementation, the core capability of the deployment process of component CR defines the configuration file PBC-config information for deploying the gateway, including the machine node, service type, port list, oidc authentication, etc. of the deployed gateway. Based on this information, the gateway instance is deployed and finally the target gateway deployment result is obtained.
[0075] It should be noted that in this embodiment, Operator is an architectural concept, an advanced cloud-native way to build and drive each component on a kubernetes cluster. It is different from common operation and maintenance solutions such as shell, CI / CD, and Operator can manage itself, rather than having operation and maintenance personnel write scripts to control them from the outside. In addition, this embodiment is based on Kubernetes Operator technology. By defining the CRD of the PBC component, a PBC component controller (i.e., PBC engine) is developed, which can automatically monitor the creation, update, and deletion of CRD objects, and can automatically parse CRD objects to achieve the management of the entire life cycle of PBC components, including the creation and configuration, monitoring and maintenance, update and upgrade, recovery and fault handling, and deletion of PBC components. In general, the PBC engine is like an automated assistant that can automatically manage and optimize the entire life cycle of components, making components easier to maintain and operate.
[0076] This embodiment determines the target component identification code, configuration file location and gateway configuration file information according to the component information to be deployed; installs the component according to the target component identification code and the configuration file location to obtain the target installation component; and deploys the gateway according to the gateway configuration file information to obtain the target gateway deployment result. Through the above method, automatic deployment, expansion, upgrade and recovery of components are realized.
[0077] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the component deployment method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0078] This application also provides a component deployment device, please refer to Figure 5 , the component deployment device comprises: Processing module 10, used to determine corresponding to-be-deployed component information according to the customer resource component information; An installation module 20 is used to install components and deploy gateways according to the information of the components to be deployed, and obtain target installation components and target gateway deployment results; The sending module 30 is used to send the component association information corresponding to the target installation component to the component registration center to obtain target feedback information; The deployment module 40 is used to complete component deployment according to the target installation component, the target gateway deployment result and the target feedback information.
[0079] Optionally, the installation module 20 is further used for: Determine the target component identification code, configuration file location and gateway configuration file information according to the component information to be deployed; Install the component according to the target component identification code and the configuration file location to obtain a target installation component; The gateway is deployed according to the gateway configuration file information to obtain a target gateway deployment result.
[0080] Optionally, the installation module 20 is further used for: Determine the component dependency object of each component deployment unit according to the target installation component; Compare the component dependency object and the component deployment object set to obtain a target component comparison result; When the target component comparison result is a component comparison success result, a component auxiliary container is injected into the component deployment unit.
[0081] Optionally, the deployment module 40 is further configured to: Compare the current component state with the target component state to obtain a state comparison result; When the state comparison result is a state inconsistency result, determining a target coordination failure and generating a component change event; The target coordination failure is repaired according to the component change event.
[0082] Optionally, the deployment module 40 is further configured to: When the number of deployment units is changed, the number of workloads in the customer resource component information is modified according to the user's change requirements to obtain the modified customer resource component information; Generate a component change event according to the modified customer resource component information; The number of deployment units is changed according to the component change event.
[0083] Optionally, the deployment module 40 is further configured to: When there is a component version problem, modify the component version information in the customer resource component information based on the preset component version to obtain the customer resource component information after the version is modified; The version modification of the component is completed according to the customer resource component information after the version modification.
[0084] The component deployment device provided by the present application adopts the component deployment method in the above embodiment, which can solve the technical problems of complex deployment and operation and maintenance of existing microservices. Compared with the prior art, the beneficial effects of the component deployment device provided by the present application are the same as the beneficial effects of the component deployment method provided by the above embodiment, and the other technical features in the component deployment device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0085] The present application provides a component deployment device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the component deployment method in the above-mentioned embodiment 1.
[0086] Reference below Figure 6 , which shows a schematic diagram of the structure of a component deployment device suitable for implementing an embodiment of the present application. The component deployment device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The component deployment device shown is merely an example and should not bring any limitation to the functionality and scope of use of the embodiments of the present application.
[0087] like Figure 6As shown, the component deployment device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the component deployment device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the component deployment device to communicate with other devices wirelessly or wired to exchange data. Although the figure shows a component deployment device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.
[0088] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0089] The component deployment device provided by the present application adopts the component deployment method in the above embodiment, which can solve the technical problems of complex deployment and operation and maintenance of existing microservices. Compared with the prior art, the beneficial effects of the component deployment device provided by the present application are the same as the beneficial effects of the component deployment method provided by the above embodiment, and the other technical features in the component deployment device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0090] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0091] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0092] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the component deployment method in the above-mentioned embodiment.
[0093] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0094] The computer-readable storage medium may be included in the component deployment device; or may exist independently without being assembled into the component deployment device.
[0095] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the component deployment device, the component deployment device: determines the corresponding component information to be deployed according to the customer resource component information; installs the component and deploys the gateway according to the component information to be deployed, and obtains the target installation component and the target gateway deployment result; sends the component association information corresponding to the target installation component to the component registration center, and obtains the target feedback information; completes the component deployment according to the target installation component, the target gateway deployment result and the target feedback information.
[0096] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may 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 may 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 may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0097] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the 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 square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0098] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0099] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned component deployment method, and can solve the technical problems of complex deployment and operation and maintenance of existing microservices. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the component deployment method provided in the above-mentioned embodiment, and will not be repeated here.
[0100] The present application also provides a computer program product, including a computer program, which implements the steps of the component deployment method as described above when executed by a processor.
[0101] The computer program product provided by this application can solve the technical problems of complex deployment and operation and maintenance of existing microservices. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the component deployment method provided by the above embodiment, which will not be repeated here.
[0102] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A component deployment method, characterized in that: The component deployment method comprises: Determine the corresponding component information to be deployed according to the customer resource component information; Install components and deploy gateways according to the information of components to be deployed, and obtain target installation components and target gateway deployment results; Sending component association information corresponding to the target installation component to a component registration center to obtain target feedback information; The component deployment is completed according to the target installation component, the target gateway deployment result and the target feedback information.
2. The method according to claim 1, characterized in that The step of installing components and deploying gateways according to the information of components to be deployed, and obtaining target installation components and target gateway deployment results, comprises: Determine the target component identification code, configuration file location and gateway configuration file information according to the component information to be deployed; Install the component according to the target component identification code and the configuration file location to obtain a target installation component; The gateway is deployed according to the gateway configuration file information to obtain a target gateway deployment result.
3. The method according to claim 1, characterized in that After the step of installing components and deploying gateways according to the to-be-deployed component information to obtain target installation component and target gateway deployment results, the step further includes: Determine the component dependency object of each component deployment unit according to the target installation component; Compare the component dependency object and the component deployment object set to obtain a target component comparison result; When the target component comparison result is a component comparison success result, a component auxiliary container is injected into the component deployment unit.
4. The method according to claim 1, characterized in that After the step of completing component deployment according to the target installation component, the target gateway deployment result and the target feedback information, the method further includes: Compare the current component state with the target component state to obtain a state comparison result; When the state comparison result is a state inconsistency result, determining a target coordination failure and generating a component change event; The target coordination failure is repaired according to the component change event.
5. The method according to claim 1, characterized in that After the step of completing component deployment according to the target installation component, the target gateway deployment result and the target feedback information, the method further includes: When the number of deployment units is changed, the number of workloads in the customer resource component information is modified according to the user's change requirements to obtain the modified customer resource component information; Generate a component change event according to the modified customer resource component information; The number of deployment units is changed according to the component change event.
6. The method according to claim 1, characterized in that After the step of completing component deployment according to the target installation component, the target gateway deployment result and the target feedback information, the method further includes: When there is a component version problem, modify the component version information in the customer resource component information based on the preset component version to obtain the customer resource component information after the version is modified; The version modification of the component is completed according to the customer resource component information after the version modification.
7. A component deployment device, characterized in that: The device comprises: A processing module, used to determine corresponding component information to be deployed according to the customer resource component information; An installation module is used to install components and deploy gateways according to the information of the components to be deployed, and obtain target installation components and target gateway deployment results; A sending module, used for sending the component association information corresponding to the target installation component to the component registration center to obtain target feedback information; A deployment module is used to complete component deployment according to the target installation component, the target gateway deployment result and the target feedback information.
8. A component deployment device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the component deployment method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the component deployment method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a component deployment program, and when the component deployment program is executed by a processor, the steps of the component deployment method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Generative software automatic assembly method and system based on contract framework model
CN120122919A