Plug-in installation method and device, electronic equipment and medium
By deploying network hook services and plugin controllers in a pre-defined cluster, and using package management tools to create and install plugin resources, the problem of inconsistent plugin installation methods is solved, achieving consistency in the plugin installation process and simplifying maintenance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-04-17
AI Technical Summary
The existing plugin installation methods are not standardized, resulting in multiple plugins having multiple installation methods, which increases maintenance costs.
By deploying a pre-defined cluster and a network hook service within it, the plugin controller is invoked to obtain the configuration files for plugin resources and package management tools. The package management tool is then used to create and install plugin resources in the pre-defined cluster, including verification of pre- and post-installation processing logic.
It achieves consistency in the plugin installation process, reduces the difficulty of maintenance and iteration, and improves the universality and efficiency of plugin installation.
Smart Images

Figure CN121879781A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a plug-in installation method, a plug-in installation device, an electronic device, and a readable storage medium. Background Technology
[0002] In cloud-native scenarios, there are business scenarios that provide Kubernetes clusters. For ease of use, a cluster usually requires a rich set of plugins. However, different users and different plugins have different installation methods. Therefore, there are various inconsistent installation methods for existing plugins, resulting in multiple installation methods for multiple plugins, which in turn leads to excessive maintenance costs. Summary of the Invention
[0003] In view of the above problems, embodiments of the present invention are proposed to provide a plug-in installation method, a plug-in installation device, an electronic device, and a readable storage medium that overcome or at least partially solve the above problems.
[0004] In a first aspect, embodiments of the present invention provide a method for installing a plug-in, the method comprising: Deploy a preset cluster, and deploy a network hook service within the preset cluster; When the network hook service receives a plugin installation request sent from the cluster console, it calls the plugin controller; The plugin controller obtains the plugin resources and package management tool configuration files corresponding to the plugin. The package management tool is invoked, and the plugin resources are created in the preset cluster according to the configuration file. The plugin is installed using the package management tool based on the plugin resources created in the preset cluster.
[0005] Optionally, the package management tool is invoked to create the plugin resources in the preset cluster according to the configuration file, including: The state changes of the plugin resources are monitored through the tuning mechanism of the plugin controller. When the plugin controller detects that it has acquired new plugin resources, it triggers an installation command to call the package management tool. The package management tool obtains its input parameter string based on the configuration file. The management tool creates the plugin resource in the preset cluster based on the input parameter string.
[0006] Optionally, the step of invoking the package management tool and creating the plugin resources in the preset cluster according to the configuration file includes: Before creating the plugin resource corresponding to the plugin in the preset cluster, the network hook service determines whether the plugin has pre-installation preparation business logic based on the installation request; If the pre-installation preparation business logic exists, then the pre-installation preparation business logic is executed, and the execution of the pre-installation preparation business logic is determined based on the verification network hook pre-deployed in the network hook service. If the pre-installation preparation business logic is executed normally, then after the pre-installation preparation business logic is completed, the package management tool is invoked, and the package management tool creates the plugin resources in the preset cluster according to the configuration file. If the pre-installation preparation business logic does not exist, the package management tool is invoked, and the plugin resources are created in the preset cluster according to the configuration file.
[0007] Optionally, the step of invoking the package management tool and creating the plugin resources in the preset cluster according to the configuration file further includes: If the pre-installation preparation business logic fails, the package management tool will be stopped from being called, the installation of the plugin will be stopped, and an error message will be output.
[0008] Optionally, after installing the plugin using the package management tool based on the plugin resources created in the preset cluster, the process further includes: When the network hook service receives a request to update plugin resources, it determines whether the plugin has post-installation processing business logic based on the request. If the post-installation processing business logic exists, then the post-installation processing business logic is executed, and the execution of the post-installation processing business logic is determined based on the verification network hook pre-deployed in the network hook service. If the post-installation processing business logic executes normally, then after the post-installation processing business logic is completed, the plugin resources are updated based on the update plugin resource request.
[0009] Optionally, the step of executing the post-installation processing business logic if it exists includes: If the post-installation processing business logic exists, then determine whether the plugin resource was in a running state before the update; If the plugin resources were running before the update, then the post-installation processing business logic is executed.
[0010] Optionally, the step of executing the post-installation processing business logic if it exists further includes: If the plugin resources were not running before the update, the post-installation processing business logic will not be executed, and a prompt message will be output to the cluster console.
[0011] Secondly, embodiments of the present invention provide a plug-in installation apparatus, the apparatus comprising: The cluster deployment module is used to deploy a preset cluster and deploy a network hook service within the preset cluster. The controller invocation module is used to invoke the plugin controller when the network hook service obtains the plugin installation request sent by the cluster console; The resource acquisition module is used to acquire the plugin resources and package management tool configuration files corresponding to the plugin through the plugin controller; The resource creation module is used to call the package management tool, and through the package management tool, create the plugin resources in the preset cluster according to the configuration file; The plugin installation module is used to install the plugin based on the plugin resources created in the preset cluster using the package management tool.
[0012] Optionally, the resource creation module includes: The listening submodule is used to listen for changes in the state of plugin resources through the tuning mechanism of the plugin controller; The submodule is called to trigger the installation command to call the package management tool when the plugin controller detects that it has acquired new plugin resources. The acquisition submodule is used to obtain the input parameter string of the package management tool based on the configuration file; The first creation submodule is used to create the plugin resources in the preset cluster based on the input parameter string using the management tool.
[0013] Optionally, the resource creation module includes: The first judgment submodule is used to determine whether the plugin has pre-installation preparation business logic based on the installation request before creating the plugin resource corresponding to the plugin in the preset cluster. The first execution submodule is used to execute the pre-installation preparation business logic if it exists, and to determine whether the pre-installation preparation business logic is executed normally based on the verification network hook pre-deployed in the network hook service. The second creation submodule is used to call the package management tool after the pre-installation preparation business logic is completed if the pre-installation preparation business logic is executed normally. The package management tool then creates the plugin resources in the preset cluster according to the configuration file. The third creation submodule is used to call the package management tool if the pre-installation preparation business logic does not exist, and to create the plugin resources in the preset cluster according to the configuration file.
[0014] Optionally, the resource creation module further includes: The first output submodule is used to stop calling the package management tool and stop the installation of the plugin if the pre-installation preparation business logic fails, and to output the exception information.
[0015] Optionally, the device further includes: The judgment module is used to determine whether the plugin has post-installation processing business logic based on the update plugin resource request when the network hook service obtains the update plugin resource request. The determination module is used to execute the post-installation processing business logic if it exists, and to determine whether the execution of the post-installation processing business logic is normal based on the verification network hook pre-deployed in the network hook service. The update module is used to update the plugin resources based on the update plugin resource request after the post-installation processing business logic has been completed, if the post-installation processing business logic is executed normally.
[0016] Optionally, the determining module includes: The second judgment submodule is used to determine whether the plugin resources before the update are in a running state if the post-installation processing business logic exists. The second execution submodule is used to execute the post-installation processing business logic if the plugin resource before the update is in a running state.
[0017] Optionally, the determining module further includes: The second output submodule is used to prevent the execution of the post-installation processing business logic and output a prompt message to the cluster console if the plugin resource before the update is not in a running state.
[0018] Thirdly, embodiments of the present invention provide an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the plug-in installation method as described in the first aspect.
[0019] Fourthly, embodiments of the present invention provide a readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the plug-in installation method as described in the first aspect.
[0020] The embodiments of the present invention have the following advantages: In this embodiment of the invention, a preset cluster is first deployed, and a network hook service is deployed within the preset cluster. Then, when the network hook service receives a plugin installation request sent by the cluster control platform, it calls the plugin controller. The plugin controller then obtains the plugin resources and package management tool configuration files corresponding to the plugin, and calls the package management tool. Based on the configuration files, the package management tool creates the plugin resources in the preset cluster. Finally, the package management tool installs the plugin based on the plugin resources created in the preset cluster. Thus, for different plugins, the package management tool creates plugin resources in the preset cluster and installs the plugin based on these resources, ensuring a consistent installation process for all plugins and achieving general applicability of cluster plugin installation. This also makes subsequent plugin maintenance and iteration easier. Attached Figure Description
[0021] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a flowchart illustrating the steps of a plugin installation method provided in an embodiment of the present invention; Figure 2 This is a flowchart of the steps involved in preparing for plugin installation according to an embodiment of the present invention. Figure 3 This is a flowchart of another plugin installation method provided in an embodiment of the present invention; Figure 4 This is a flowchart of the steps of a method for post-installation processing of a plug-in provided by an embodiment of the present invention; Figure 5 This is a structural block diagram of a plug-in installation device provided in an embodiment of the present invention. Detailed Implementation
[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] The terms "first," "second," etc., used in the specification and claims of this invention are used to distinguish similar objects and are not used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0025] like Figure 1 The diagram illustrates a flowchart of a plugin installation method according to an embodiment of the present invention. The method may specifically include the following steps: Step 101: Deploy a preset cluster and deploy a network hook service in the preset cluster.
[0026] In this invention, when installing a plugin on a cluster, a preset cluster can be deployed first, which can be a Kubernetes cluster. For example, if a plugin needs to be installed on a Kubernetes cluster, the Kubernetes cluster can be deployed first, and then a network hook service can be deployed on the preset cluster. The network hook service in this invention can be a webhook service.
[0027] A Kubernetes cluster is a platform consisting of multiple computers (physical or virtual machines) connected together for the automated deployment, management, and scaling of containerized applications.
[0028] Kubernetes clusters are a powerful, scalable, and highly available distributed system engine. It abstracts a group of computing resources into a unified, powerful pool of computing resources, enabling the easy management of complex applications across hundreds or thousands of servers, much like managing a supercomputer, and providing the immense convenience of automated operations and maintenance. It is the cornerstone of modern cloud-native application architectures.
[0029] Step 102: When the network hook service receives the plugin installation request sent by the cluster console, it calls the plugin controller.
[0030] In this invention, after deploying the preset cluster and network hook service, the plugin can be installed. During installation, the user can send an installation request to the network hook service in the preset cluster through the cluster console. After receiving the installation request, the network hook service can respond to the installation request and call the plugin controller. In this invention, the plugin controller can be an addon-operator. The addon-operator can be an abstract, standalone addon-operator.
[0031] Addon-Operator is an operator specifically designed for managing, installing, and lifecycle-managing "plugins" in Kubernetes clusters. Addon-Operator is a classic application of the "Operator pattern" in the Kubernetes ecosystem. It elevates the management of cluster plugins from manual, imperative, and error-prone operations to an automated, declarative, and self-healing level, making it a key component for building mature and maintainable Kubernetes platforms. Essentially, it's a component specifically designed to manage other components.
[0032] Step 103: Obtain the configuration file of the plugin resource and package management tool corresponding to the plugin through the plugin controller.
[0033] In this invention, after invoking the plugin controller, the plugin controller can obtain the plugin resources corresponding to the plugin and the configuration file corresponding to the package management tool. Users can input the plugin resources and configuration file through the cluster console, and then send them to the plugin controller through the cluster console. Alternatively, the plugin resources and configuration file corresponding to the plugin and package management tool can be pre-stored, and the plugin controller can retrieve these pre-stored configuration files.
[0034] Step 104: Invoke the package management tool and, according to the configuration file, create the plugin resources in the preset cluster using the package management tool.
[0035] In this invention, after the plugin controller obtains the plugin resources corresponding to the plugin and the configuration file corresponding to the package management tool, it can call the package management tool. The management tool in this invention can be Helm, which allows the installation of multiple resource objects at once, i.e., the installation of multiple plugins simultaneously. Plugin resources can be created in a preset cluster using Helm.
[0036] In one embodiment, invoking a package management tool to create plugin resources in a preset cluster according to a configuration file may include: before creating the plugin resources corresponding to the plugin in the preset cluster, a network hook service determines whether the plugin has pre-installation preparation business logic based on the installation request; if pre-installation preparation business logic exists, it is executed, and the execution of the pre-installation preparation business logic is determined based on the verification network hooks pre-deployed in the network hook service; if the pre-installation preparation business logic executes normally, the package management tool is invoked after the pre-installation preparation business logic has been executed, and the plugin resources are created in the preset cluster according to the configuration file; if no pre-installation preparation business logic exists, the package management tool is invoked, and the plugin resources are created in the preset cluster according to the configuration file.
[0037] In this invention, plugins can be categorized into several types: those with pre-installation preparation and post-installation processing; those with pre-installation preparation but no post-installation processing; those with no pre-installation preparation but with post-installation processing; and those with neither pre-installation preparation nor post-installation processing. Therefore, when creating plugin resources in a preset cluster in this invention, it is necessary to first determine whether the plugin has pre-installation preparation. At this point, the network hook service can determine whether the plugin has pre-installation preparation business logic based on the installation request.
[0038] In this invention, the webhook service can be a pre-defined service, with the specific code logic pre-deployed by the user, and its caller is the Kubernetes apiserver. When deploying the webhook service, a validation webhook can be deployed within it. This validation webhook is used for logic verification. In this invention, the webhook service has a separate API route. For plugins requiring pre-installation preparation, the apiserver only listens to the `operation` and `addon cr` resource objects in the `CREATE` method. Therefore, before creating the plugin resource, a webhook service can be invoked. When creating the plugin resource, an annotation can be used to include the corresponding plugin identifier. When the apiserver detects the `CREATE` action of the plugin resource, it calls the webhook service to read the identifier from the plugin resource's annotation. This identifier identifies which plugin is being installed. It then checks if the corresponding pre-installation preparation business logic is found. If it is, the plugin has pre-installation business logic; otherwise, it does not. Once the pre-installation business logic is obtained, it is executed. The validating webhook verifies whether the pre-installation business logic executes correctly. If it does, after the pre-installation business logic completes, the installation package tool is invoked. This tool then creates the plugin resource in the preset cluster according to the configuration file. If there is no pre-installation preparation business logic, then the pre-installation preparation business logic needs to be executed. This can be done by directly calling the package management tool, which will create the plugin resources in the preset cluster according to the configuration file.
[0039] In one embodiment, the package management tool is invoked, and the plugin resources are created in a preset cluster according to the configuration file. The method may also include: if the pre-installation business logic execution fails, the invocation of the package management tool is stopped, the installation of the plugin is stopped, and the exception information is output.
[0040] In this invention, if an execution exception occurs during the execution of business logic before installation, the package management tool is stopped from being called, the installation of the plugin is stopped, and the exception information is output to the cluster console so that the user is aware of the installation exception.
[0041] like Figure 2 The diagram illustrates a flowchart of a method for preparing a plugin before installation, as provided in an embodiment of the present invention. This method is for plugins requiring pre-installation preparation. Users can send a request to a preset cluster to create plugin resources via the cluster console. Upon receiving the plugin resources, the preset cluster invokes a webhook service. The webhook service executes the plugin pre-installation preparation business logic. After the business logic is completed, it sends an execution completion signal to the preset cluster. Upon receiving the execution completion signal, the preset cluster can create the plugin resources within the cluster. Once the plugin resources are created, the preset cluster can send a successful creation message to the cluster console so that the user is aware that the plugin resources have been successfully created.
[0042] In one embodiment, invoking a package management tool and creating plugin resources in a preset cluster according to a configuration file may include: listening to changes in the status of plugin resources through the tuning mechanism of the plugin controller; triggering an installation command to invoke the package management tool when the plugin controller detects that it has acquired new plugin resources; obtaining the input parameter string of the package management tool based on the configuration file; and creating the plugin resources in the preset cluster based on the input parameter string.
[0043] In this invention, the addon-operator can continuously monitor the status changes of plugin resources through a tuning mechanism. When a newly created plugin resource is detected, that is, when the addon-operator detects that a new plugin resource has been acquired, an installation command is triggered to call the package management tool. The package management tool can obtain the input parameter string based on the configuration file. For example, the package management tool helm obtains the required values.yaml string, and helm creates the plugin resource in the Kubernetes cluster based on the values.yaml string.
[0044] Step 105: Install the plugin using the package management tool based on the plugin resources created in the preset cluster.
[0045] In this invention, after creating plugin resources in a preset cluster, the package management tool can trigger a Kubernetes job to execute an installation command, thereby installing the plugin based on the plugin resources in the preset cluster. In this invention, when it is necessary to delete a plugin in the preset cluster, an uninstallation command can be executed by triggering a Kubernetes job when the plugin resource is deleted.
[0046] In this embodiment of the invention, a preset cluster is deployed, and a network hook service is deployed within the preset cluster. When the network hook service receives an installation request for a plugin from the cluster console, it calls the plugin controller. The plugin controller obtains the plugin resources and package management tool configuration files corresponding to the plugin. The package management tool is then called, and based on the configuration files, it creates the plugin resources in the preset cluster. Finally, the package management tool installs the plugin based on the plugin resources created in the preset cluster. Thus, for different plugins, the package management tool creates plugin resources in the preset cluster, and the plugin is installed based on these resources. This ensures a consistent installation process for all plugins, achieving general applicability for cluster plugin installation and facilitating easier maintenance and iteration of plugins in the future.
[0047] like Figure 3 The diagram illustrates a flowchart of another plugin installation method provided by an embodiment of the present invention. The method may specifically include the following steps: Step 301: Deploy a preset cluster and deploy a network hook service in the preset cluster.
[0048] In this invention, when installing a plugin on a cluster, a preset cluster can be deployed first, which can be a Kubernetes cluster. For example, if a plugin needs to be installed on a Kubernetes cluster, the Kubernetes cluster can be deployed first, and then a network hook service can be deployed on the preset cluster. The network hook service in this invention can be a webhook service.
[0049] Step 302: When the network hook service receives the plugin installation request sent by the cluster console, it calls the plugin controller.
[0050] In this invention, after deploying the preset cluster and network hook service, the plugin can be installed. During installation, the user can send an installation request to the network hook service in the preset cluster through the cluster console. After receiving the installation request, the network hook service can respond to the installation request and call the plugin controller. In this invention, the plugin controller can be an addon-operator. The addon-operator can be an abstract, standalone addon-operator.
[0051] Step 303: Obtain the configuration file of the plugin resource and package management tool corresponding to the plugin through the plugin controller.
[0052] In this invention, after invoking the plugin controller, the plugin controller can obtain the plugin resources corresponding to the plugin and the configuration file corresponding to the package management tool. Users can input the plugin resources and configuration file through the cluster console, and then send them to the plugin controller through the cluster console. Alternatively, the plugin resources and configuration file corresponding to the plugin and package management tool can be pre-stored, and the plugin controller can retrieve these pre-stored configuration files.
[0053] Step 304: Invoke the package management tool and, according to the configuration file, create the plugin resources in the preset cluster using the package management tool.
[0054] In this invention, after the plugin controller obtains the plugin resources corresponding to the plugin and the configuration file corresponding to the package management tool, it can call the package management tool. The management tool in this invention can be Helm, which allows the installation of multiple resource objects at once, i.e., the installation of multiple plugins simultaneously. Plugin resources can be created in a preset cluster using Helm.
[0055] Step 305: Install the plugin using the package management tool based on the plugin resources created in the preset cluster.
[0056] In this invention, after creating plugin resources in a preset cluster, the package management tool can trigger a Kubernetes job to execute an installation command, thereby installing the plugin based on the plugin resources in the preset cluster. In this invention, when it is necessary to delete a plugin in the preset cluster, an uninstallation command can be executed by triggering a Kubernetes job when the plugin resource is deleted.
[0057] Step 306: When the network hook service obtains an update plugin resource request, it determines whether the plugin has post-installation processing business logic based on the update plugin resource request.
[0058] In this invention, after a plugin is installed using a package management tool based on plugin resources created in a preset cluster, if the network hook service receives a request to update plugin resources, the network hook service can determine whether the plugin has post-installation processing business logic based on the update plugin resource request.
[0059] Step 307: If the post-installation processing business logic exists, execute the post-installation processing business logic and determine whether the execution of the post-installation processing business logic is normal based on the verification network hook pre-deployed in the network hook service.
[0060] In this invention, when determining whether a plugin has post-installation processing business logic based on the plugin resource update request, if it is determined that post-installation processing business logic exists, then the post-installation processing business logic is executed, and the execution of the post-installation processing business logic is determined based on the verification network hook pre-deployed in the network hook service.
[0061] Step 308: If the post-installation processing business logic is executed normally, then after the post-installation processing business logic is completed, update the plugin resources based on the update plugin resource request.
[0062] In this invention, when determining whether the post-installation processing business logic is executed normally, if it is determined that the post-installation processing business logic is executed normally, then after the post-installation processing business logic is completed, the plugin resources can be updated based on the plugin resource update request.
[0063] In this invention, after installing a plugin using a package management tool based on plugin resources created in a preset cluster, the process may further include: when the network hook service receives a request to update plugin resources, determining whether the plugin has post-installation processing business logic based on the request; if post-installation processing business logic exists, executing the post-installation processing business logic, and determining whether the execution of the post-installation processing business logic is normal based on a pre-deployed verification network hook in the network hook service; if the post-installation processing business logic executes normally, updating the plugin resources based on the update plugin resource request after the post-installation processing business logic has been completed.
[0064] In this invention, after the plugin is installed, it can be determined whether the plugin has post-installation processing. The webhook service can listen for UPDATE actions. When an UPDATE action occurs, the webhook service will also obtain a request to update plugin resources. The response to the update request determines whether the plugin has post-installation processing business logic based on the plugin identifier, and which post-installation processing business logic needs to be executed. If post-installation processing business logic exists, it can be executed, and the validating webhook is used to determine whether the execution of the post-installation processing business logic is normal. If it is normal, the plugin resources are updated after the post-installation processing business logic has been executed.
[0065] In one embodiment, if post-installation processing business logic exists, the post-installation processing business logic is executed, including: if post-installation processing business logic exists, determining whether the plugin resources before the update are in a running state; if the plugin resources before the update are in a running state, then executing the post-installation processing business logic.
[0066] In this invention, if there is post-installation processing business logic, then it can first determine whether the plugin resources before the update are running, that is, whether the current plugin resources in the preset cluster are running. If the current plugin resources are running, then the post-installation business logic is executed.
[0067] In one embodiment, if post-installation processing business logic exists, then executing the post-installation processing business logic may further include: if the plugin resources before the update are not in a running state, then not executing the post-installation processing business logic and outputting a prompt message to the cluster console.
[0068] In this invention, if there is post-installation processing business logic, it is possible to first determine whether the plugin resources before the update, i.e., whether the current plugin resources in the preset cluster are running, is in a running state. If the current plugin resources are not running, the post-installation business logic is not executed, and success is directly output to the cluster console.
[0069] like Figure 4The diagram illustrates a flowchart of a plugin post-installation processing method according to an embodiment of the present invention. This method is for plugins that require post-installation processing. The plugin controller sends updated plugin resources to a preset cluster. Upon receiving the updated plugin resources, the preset cluster calls a webhook service. The webhook service determines whether the plugin resources are running. If they are running, the post-installation processing business logic is executed; otherwise, a success message is returned directly. The webhook service sends an execution completion signal to the preset cluster. After receiving the execution completion signal, the preset cluster updates the plugin resources. After the update is complete, the preset cluster sends a plugin resource update success message to the plugin controller.
[0070] In this invention, the design of code layering and decoupling is used in scenarios where the business logic of installing different plugins is different. The complex business logic and general installation logic are abstracted and extracted, so that each individual component in the whole process performs its own function and is not coupled with the business logic of other links.
[0071] In this embodiment of the invention, a preset cluster is deployed, and a network hook service is deployed within the preset cluster. When the network hook service receives an installation request for a plugin from the cluster console, it calls the plugin controller. The plugin controller obtains the plugin resources and package management tool configuration files corresponding to the plugin. The package management tool is then called, and based on the configuration files, it creates the plugin resources in the preset cluster. Finally, the package management tool installs the plugin based on the plugin resources created in the preset cluster. Thus, for different plugins, the package management tool creates plugin resources in the preset cluster, and the plugin is installed based on these resources. This ensures a consistent installation process for all plugins, achieving general applicability for cluster plugin installation and facilitating easier maintenance and iteration of plugins in the future.
[0072] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0073] like Figure 5 The diagram shows a structural block diagram of a plug-in installation device provided by an embodiment of the present invention. The device may specifically include the following modules: Cluster deployment module 501 is used to deploy a preset cluster and deploy a network hook service in the preset cluster; The controller calling module 502 is used to call the plugin controller when the network hook service obtains the plugin installation request sent by the cluster console; The resource acquisition module 503 is used to acquire the plugin resources and package management tool configuration files corresponding to the plugin through the plugin controller; The resource creation module 504 is used to call the package management tool and, according to the configuration file, create the plugin resources in the preset cluster. The plugin installation module 505 is used to install the plugin based on the plugin resources created in the preset cluster through the package management tool.
[0074] In one embodiment, the resource creation module 504 includes: The listening submodule is used to listen for changes in the state of plugin resources through the tuning mechanism of the plugin controller; The submodule is called to trigger the installation command to call the package management tool when the plugin controller detects that it has acquired new plugin resources. The acquisition submodule is used to obtain the input parameter string of the package management tool based on the configuration file; The first creation submodule is used to create the plugin resources in the preset cluster based on the input parameter string using the management tool.
[0075] In one embodiment, the resource creation module 504 includes: The first judgment submodule is used to determine whether the plugin has pre-installation preparation business logic based on the installation request before creating the plugin resource corresponding to the plugin in the preset cluster. The first execution submodule is used to execute the pre-installation preparation business logic if it exists, and to determine whether the pre-installation preparation business logic is executed normally based on the verification network hook pre-deployed in the network hook service. The second creation submodule is used to call the package management tool after the pre-installation preparation business logic is completed if the pre-installation preparation business logic is executed normally. The package management tool then creates the plugin resources in the preset cluster according to the configuration file. The third creation submodule is used to call the package management tool if the pre-installation preparation business logic does not exist, and to create the plugin resources in the preset cluster according to the configuration file.
[0076] In one embodiment, the resource creation module 504 further includes: The first output submodule is used to stop calling the package management tool and stop the installation of the plugin if the pre-installation preparation business logic fails, and to output the exception information.
[0077] In one embodiment, the device further includes: The judgment module is used to determine whether the plugin has post-installation processing business logic based on the update plugin resource request when the network hook service obtains the update plugin resource request. The determination module is used to execute the post-installation processing business logic if it exists, and to determine whether the execution of the post-installation processing business logic is normal based on the verification network hook pre-deployed in the network hook service. The update module is used to update the plugin resources based on the update plugin resource request after the post-installation processing business logic has been completed, if the post-installation processing business logic is executed normally.
[0078] In one embodiment, the determining module includes: The second judgment submodule is used to determine whether the plugin resources before the update are in a running state if the post-installation processing business logic exists. The second execution submodule is used to execute the post-installation processing business logic if the plugin resource before the update is in a running state.
[0079] In one embodiment, the determining module further includes: The second output submodule is used to prevent the execution of the post-installation processing business logic and output a prompt message to the cluster console if the plugin resource before the update is not in a running state.
[0080] In this embodiment of the invention, a cluster deployment module is used to deploy a preset cluster and a network hook service within the preset cluster; a controller invocation module is used to invoke the plugin controller when the network hook service receives an installation request for a plugin sent from the cluster console; a resource acquisition module is used to acquire the plugin resources corresponding to the plugin and the configuration file of the package management tool through the plugin controller; a resource creation module is used to invoke the package management tool and create the plugin resources in the preset cluster according to the configuration file; and a plugin installation module is used to install the plugin based on the plugin resources created in the preset cluster through the package management tool. Thus, for different plugins, the package management tool creates plugin resources in the preset cluster and installs the plugin based on the created plugin resources, thereby ensuring a consistent installation process for all plugins, achieving specific universality in cluster plugin installation, and making subsequent maintenance and iteration of plugins easier.
[0081] As the apparatus embodiment is basically similar to the method embodiment, it is described in a relatively simple manner. For relevant details, please refer to the description of the method embodiment.
[0082] This invention also provides an electronic device, including a processor, a memory, and a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, they implement the various processes of the above-described plug-in installation method embodiments and achieve the same technical effects. To avoid repetition, they will not be described again here.
[0083] This invention also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described plug-in installation method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0084] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0085] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0086] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0087] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0088] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0089] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0090] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.
[0091] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0092] The above provides a detailed description of a plug-in installation method, a plug-in installation device, an electronic device, and a readable storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method of installing a plug-in, characterized by, The method includes: Deploy a preset cluster, and deploy a network hook service within the preset cluster; When the network hook service receives a plugin installation request sent from the cluster console, it calls the plugin controller; The plugin controller obtains the plugin resources and package management tool configuration files corresponding to the plugin. The package management tool is invoked, and the plugin resources are created in the preset cluster according to the configuration file. The plugin is installed using the package management tool based on the plugin resources created in the preset cluster.
2. The method of mounting an insert according to claim 1, wherein The package management tool, based on the configuration file, creates the plugin resources in the preset cluster, including: The state changes of the plugin resources are monitored through the tuning mechanism of the plugin controller. When the plugin controller detects that it has acquired new plugin resources, it triggers an installation command to call the package management tool. The package management tool obtains its input parameter string based on the configuration file. The management tool creates the plugin resource in the preset cluster based on the input parameter string.
3. The method of mounting an insert according to claim 1, wherein The step of invoking the package management tool, and using the package management tool to create the plugin resources in the preset cluster according to the configuration file, includes: Before creating the plugin resource corresponding to the plugin in the preset cluster, the network hook service determines whether the plugin has pre-installation preparation business logic based on the installation request; If the pre-installation preparation business logic exists, then the pre-installation preparation business logic is executed, and the execution of the pre-installation preparation business logic is determined based on the verification network hook pre-deployed in the network hook service. If the pre-installation preparation business logic is executed normally, then after the pre-installation preparation business logic is completed, the package management tool is invoked, and the package management tool creates the plugin resources in the preset cluster according to the configuration file. If the pre-installation preparation business logic does not exist, the package management tool is invoked, and the plugin resources are created in the preset cluster according to the configuration file.
4. The method of mounting an insert according to claim 3, wherein The step of invoking the package management tool and creating the plugin resources in the preset cluster according to the configuration file also includes: If the pre-installation preparation business logic fails, the package management tool will be stopped from being called, the installation of the plugin will be stopped, and an error message will be output.
5. The method of mounting an insert of claim 1, wherein, After installing the plugin using the package management tool based on the plugin resources created in the preset cluster, the process further includes: When the network hook service receives a request to update plugin resources, it determines whether the plugin has post-installation processing business logic based on the request. If the post-installation processing business logic exists, then the post-installation processing business logic is executed, and the execution of the post-installation processing business logic is determined based on the verification network hook pre-deployed in the network hook service. If the post-installation processing business logic executes normally, then after the post-installation processing business logic is completed, the plugin resources are updated based on the update plugin resource request.
6. The method of mounting an insert according to claim 5, wherein, If the post-installation processing business logic exists, then executing the post-installation processing business logic includes: If the post-installation processing business logic exists, then determine whether the plugin resource was in a running state before the update; If the plugin resources were running before the update, then the post-installation processing business logic is executed.
7. The method of mounting an insert according to claim 6, wherein The step of executing the post-installation processing business logic if it exists further includes: If the plugin resources were not running before the update, the post-installation processing business logic will not be executed, and a prompt message will be output to the cluster console.
8. An apparatus for mounting a plug-in, characterized by The device includes: The cluster deployment module is used to deploy a preset cluster and deploy a network hook service within the preset cluster. The controller invocation module is used to invoke the plugin controller when the network hook service obtains the plugin installation request sent by the cluster console; The resource acquisition module is used to acquire the plugin resources and package management tool configuration files corresponding to the plugin through the plugin controller; The resource creation module is used to call the package management tool, and through the package management tool, create the plugin resources in the preset cluster according to the configuration file; The plugin installation module is used to install the plugin based on the plugin resources created in the preset cluster using the package management tool.
9. An electronic device, comprising: It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the plug-in installation method as described in claims 1-7.
10. A readable storage medium, characterized by, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the plug-in installation method as described in claims 1-7.