An ssh channel-based automatic service rapid deployment upgrade method
By using an automated service deployment and upgrade method based on SSH channels, the time-consuming and error-prone issues in the deployment and upgrade process of cloud computing platforms are resolved. This achieves efficient and stable deployment and upgrades, improves the flexibility and compatibility of cloud platforms, reduces the risk of business interruption, and provides flexible detection modes and a user-friendly experience.
Patent Information
- Application Number
- CN202411002562.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2026-01-20
- Estimated Expiration
- 2044-07-25
AI Technical Summary
The deployment and upgrade process of existing cloud computing platforms is time-consuming and error-prone, requiring manual intervention. Automation tools offer limited improvement, especially in terms of rapid response to service changes and business continuity. Furthermore, different service products require different deployment and upgrade methods, lacking flexibility and compatibility.
An automated service deployment and upgrade method based on SSH channels is adopted. Through a custom deployment and upgrade framework, fine-grained resource monitoring, environment detection, and component dependency judgment are achieved. The core template of the serviceTask is customized, and combined with cluster, nodeSelector, and dependency items, it provides a collection of environment information and node selection to ensure high availability and stability.
It has improved the convenience and stability of cloud platform deployment and upgrade operations, reduced manual intervention, improved deployment and upgrade efficiency, enhanced the flexibility and compatibility of component access, reduced the risk of business interruption, and provided flexible detection modes and a user-friendly experience.
Smart Images

Figure CN119030872B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of cloud computing, and particularly relates to a method for automatically deploying and upgrading services based on an SSH channel. BACKGROUND
[0002] The implementation of the deployment and upgrading framework based on the protocol channel mainly includes the expression, analysis and implementation of the deployment and upgrading strategy. The deployment and upgrading template defines the target requirement of the deployment and upgrading, the deployment and upgrading strategy abstracts and describes the application and implementation of the deployment and upgrading, and the deployment and upgrading framework describes the specific implementation, component architecture and interaction process between components of the deployment and upgrading command.
[0003] The wave cloud provides a plurality of services for users and provides the upgrading and updating of the component services. However, the deployment and upgrading is not fast, safe and stable enough. Therefore, it is necessary to provide an automatic, fast and stable deployment and upgrading scheme. The scheme can be standardized to adapt to various environments and various products and provide the desired service operation. SUMMARY
[0004] In order to solve the above technical problems, the present application provides a method for automatically deploying and upgrading services based on an SSH channel, which improves the speed of cloud service deployment, reduces the time and errors of manual intervention, ensures the continuity and stability of services during the upgrading process, reduces the risk of business interruption, optimizes the resource utilization rate and provides automatic compatibility.
[0005] The present application realizes fine-grained resource monitoring, environment detection, component dependency judgment and the like through a self-defined deployment and upgrading framework. Through the complex combination of cluster, nodeSelect and command, the deployment and upgrading requirements of more complexity and higher customization can be met.
[0006] The command is extensible, which makes the deployment and upgrading mode more diversified.
[0007] The program has built-in basic detection, which provides the most basic hard detection of the environment. The environment can be judged in advance whether there is a blocking error for the component deployment and upgrading, and the environment state can be accurately and stably judged.
[0008] The serviceTash is used to define the deployment and upgrading item, the user deployment and upgrading operation is more flat, and the cloud platform service product component can be more flexibly and efficiently deployed and upgraded, and the environment diversity and stability are improved.
[0009] The application provides an automatic service quick deployment upgrade method based on an SSH channel, and the definition of a serviceTask self-defined deployment task core template is used to realize compatibility of a plurality of deployment components and deployment tasks, and realize the same execution process of different implementation modes.
[0010] A depence dependency item is used to solve the dependency relationship between components and components, and the dependency mode is defined clearly.
[0011] A site is used to provide a collection of basic environment information, and different cloud platforms are distinguished.
[0012] A nodeSelector is used to customize a running node, and a plurality of node selectors can be used to refine the granularity.
[0013] A cluster mode is used to ensure the high availability of a product environment.
[0014] Further,
[0015] serviceTask execution logic:
[0016] a) first read the deployment upgrade requirement template to obtain the deployment or upgrade requirement to be executed;
[0017] b) according to the requirement, a series of internal method operations are used to generate the deployment or upgrade file to be executed;
[0018] c) read the site configuration information of the corresponding environment to screen out the cluster nodes meeting the execution condition;
[0019] d) use the certificate to remotely detect the running state of the dependent component from the master node to the cluster node to be run;
[0020] e) automatically upload the execution file from the master node to the node to be run;
[0021] f) automatically run the execution file and detect the execution completion result.
[0022] Further,
[0023] After receiving the user request, first, according to the site information of the current execution environment, the resource information of the current environment is obtained, and then the basic detection of the current cluster or node environment is carried out; after the basic detection, the user-provided custom deployment upgrade file is loaded, the cluster node information to be executed is obtained according to the cluster, nodeSelect parameter, the user custom corresponding deployment upgrade method is generated according to the command parameter, then the runtime dependency and the deployment dependency of the user specified node are detected, and according to the operation type, the deployment or upgrade operation to be performed is judged, the custom deployment upgrade command is executed, and the result is obtained.
[0024] Further,
[0025] The basic detection of the current cluster or node environment includes whether the cluster node running state is normal, whether the network information configuration is accurate, and whether the cluster node quantity is matched.
[0026] After the detection of the dependency is executed, if the state is normal, the corresponding deployment upgrade operation is performed; after the file execution is completed, the execution result detection is performed in several ways.
[0027] The execution result is judged by using the return value built in the framework.
[0028] The result detection is performed by using the custom command in the serviceTask.
[0029] The health interface detection is performed by using curl or other commands.
[0030] The application can set two detection modes of customization and default, and provide user experience.
[0031] The application has the advantages that
[0032] By using the application, the deployment and upgrade operation of the cloud platform is more convenient, fast and stable, the judgment of the environment state is more convenient and flexible, the custom deployment upgrade framework is created, the strategy more suitable for the environment demand is created, the fixed and rigid manual steps in the past are abandoned, and various component deployment and upgrade requirements can be well compatible, so that the cloud platform and subsequent upgrade operation of the component are more flattened, the stability, convenience and compatibility involved in the version upgrade process are more direct and efficient, more possibilities are provided for the component access, and a clearer and simpler dependency relationship bridge is established between the components. BRIEF DESCRIPTION OF DRAWINGS
[0033] Figure 1 is a detection flowchart of the application;
[0034] Figure 2 is a serviceTask execution logic schematic diagram. DETAILED DESCRIPTION
[0035] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some embodiments but not all embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0036] In the existing various cloud computing platforms, service product components are diversified and complicated, the traditional cloud platform deployment and upgrade process is time-consuming and prone to errors, and manual intervention is required, which is particularly inconvenient in a large-scale cluster environment. Although the existing automation tools have been improved, there is still room for improvement, especially in terms of rapid response to service changes and guaranteeing business continuity. And various service products often require different deployment and upgrade methods, which reflects the orchestratability and compatibility of the framework. Therefore, the ssh channel-based automatic service rapid deployment and upgrade framework can be more widely applied. Only by providing information files conforming to the deployment and upgrade templates can automatic deployment and upgrade be realized, greatly improving the use efficiency, reducing manual operation, effectively reducing exceptions and avoiding risks. And the framework structure can effectively accommodate different needs of various component deployment and upgrade, improving the deployment and upgrade speed.
[0037] Through the definition of the serviceTask self-defined deployment task core template, the compatibility of various deployment components and deployment tasks is realized, and the deployment methods with different implementation manners but the same execution process are achieved. The depence dependency item is used to solve the dependency relationship between components and components, and the dependency method is defined, which can better solve the abnormal problems caused by the coupling between components. The site intervention effectively provides a collection of basic environment information, and can be distinguished in detail corresponding to different cloud platforms. The nodeSelector node selector can be used to customize the running node in detail, and the multi-node selector can be used to refine the granularity and more accurately realize the deployment action allocation. The cluster mode guarantees the high availability of the product environment, ensures the stability of the environment, and provides a high-quality customer experience. The key points in the technical solutions will be explained in detail as follows.
[0038] 1) site: site, configured with basic information of the environment (cluster, node, network configuration, etc.), required chart collection.
[0039] 2)serviceTask: service item, defines a component, in the text it is actually a deployment or upgrade requirement, which belongs to the custom yaml file of the service product. The framework will implement the corresponding operation on the cloud platform environment according to the file.
[0040] 3)type: defines the operation type, deployment or upgrade
[0041] 4)depence: dependency, because a component may depend on one or more other components, it is necessary to detect the health of the dependent component during deployment and upgrade, in the text, dependency includes runtime dependency and deployment dependency.
[0042] 5)cluster: cluster, k8s cluster, contains one or more nodes (node).
[0043] 6)nodeSelector: node selector, its value is the label of the node, and the node information that meets the requirements is obtained through this parameter.
[0044] 7)command: specific operation on cluster or node resources.
[0045] serviceTask template:
[0046]
[0047]
[0048] serviceTask execution logic, as shown in Figure 2
[0049] 1) First, read the deployment and upgrade requirement template to get the deployment or upgrade requirement to be executed.
[0050] 2) According to the requirement, a series of internal methods are used to generate the deployment or upgrade file to be executed.
[0051] 3) Read the site configuration information of the corresponding environment to filter out the cluster nodes that meet the execution conditions.
[0052] 4) Use the certificate to remotely access the cluster nodes to be run from the master node to detect the running state of the dependent components.
[0053] 5) Automatically upload the execution file from the master node to the node to be run.
[0054] 6) Automatically run the execution file and detect the execution completion result.
[0055] Design idea:
[0056] 1. Generation of deployment and upgrade items
[0057] The program will preset some deployment, upgrade items for general public scenario deployment and upgrade. For example, node system vulnerability upgrade, automation tool deployment, etc.
[0058] Users can create the required deployment and upgrade request according to their needs. The created detection items need to contain name (component name), cluster, command, and optional nodeSelect content. Among them, nodeSelect represents one or a kind of node resource, supports using null for full node matching; command represents the operation on this resource or this resource, supports using the program built-in parameters to get simple cluster environment information.
[0059] Technical key points:
[0060] 1) command condition is rich and expandable. command not only supports custom deployment and upgrade items. It also supports using the program's built-in upgrade items, including but not limited to, node time synchronization, node label modification, system tool upgrade, etc., and supports subsequent expansion.
[0061] 2) serviceTask is a custom template, product parties can freely configure according to their own product needs. As long as the deployment or upgrade needs that meet the template format can be realized, which greatly reduces the work of configuring the upgrade and deployment steps once for each new component in the past. Using automation to achieve, reduces the risk of human intervention errors, and also greatly improves the deployment and upgrade efficiency.
[0062] 3) Through the reasonable combination of cluster, nodeSelect, command, the user can flexibly define the required deployment and upgrade scene, the demand coverage is extensive, the deployment and upgrade command access is diversified, etc. For example, you can use "empty" to match all clusters and nodes, you can use the program's built-in conditions, etc.
[0063] 2. Execution of deployment and upgrade items
[0064] After receiving the user request, first, according to the site information of the current execution environment, the resource information of the current environment is obtained, including but not limited to, node name, network information, label, belonging cluster, node role, etc. Then the basic detection of the current cluster or node environment is carried out, including but not limited to, whether the cluster node running state is normal, whether the network information configuration is accurate, whether the cluster node quantity is matched, etc. After the basic detection, the user-provided custom deployment upgrade file is loaded, the cluster node information to be executed is obtained according to the cluster, nodeSelect and other parameters, the user-defined corresponding deployment upgrade method is generated according to the command parameter, then the runtime dependency and deployment dependency of the user-specified node are detected, and according to the operation type, the deployment or upgrade operation to be performed is judged, the custom deployment upgrade command is executed, and the result is obtained.
[0065] 3. Judgment of deployment upgrade item
[0066] After the detection of the dependency is executed, if the state is normal, the corresponding deployment upgrade operation is performed. After the execution file is executed, the execution result detection is carried out in multiple ways, the return value judgment execution result can be used. The result detection can also be carried out through the custom command in serviceTask; the health interface detection can also be carried out through curl or other commands. Flexible custom judgment makes the access deployment upgrade detection condition diversified, the custom and default two detection modes can provide more convenient user experience.
[0067] The above only describes the preferred embodiments of the present application, which are used to illustrate the technical solutions of the present application, and are not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. within the spirit and principles of the present application is included in the protection scope of the present application.
Claims
1. A method for rapid deployment and upgrade of automated services based on SSH channels, characterized in that, By defining the core template for custom deployment tasks using serviceTask, we can achieve compatibility among several deployment components and tasks, enabling deployment methods with different implementations but the same execution process. Depence dependencies are used to resolve dependencies between components and to explicitly define the dependency methods. By leveraging the site, a collection of basic environmental information is provided, and differentiating it for different cloud platforms; Customize the running node using the nodeSelector node selector, and multiple node selectors can share a finer granularity; Use cluster mode to ensure high availability of the product environment.
2. The method according to claim 1, characterized in that, serviceTask execution logic: a) First, read the deployment and upgrade requirement template to obtain the deployment or upgrade requirements to be executed; b) Based on requirements, generate the necessary deployment or upgrade files through internal operations; c) Read the site configuration information of the corresponding environment and filter out the cluster nodes that meet the execution conditions; d) Use certificates to remotely access the cluster nodes to be run from the master node and check the running status of dependent components; e) Automatically upload the executable file from the master node to the node to be run; f) Automatically run the executable file and check the execution result.
3. The method according to claim 2, characterized in that, Upon receiving a user request, the system first retrieves the resource information of the current environment based on the site information of the current execution environment. Then, it performs basic checks on the current cluster or node environment. After passing the basic checks, it loads the user-provided custom deployment and upgrade file, obtains the cluster node information to be deployed and upgraded based on the cluster and nodeSelect parameters, generates the user-defined deployment and upgrade method based on the command parameter, then checks the runtime and deployment dependencies on the user-specified node, determines the deployment or upgrade operation to be performed based on the operation type, executes the custom deployment and upgrade command, and obtains the results.
4. The method according to claim 3, characterized in that, Perform basic checks on the current cluster or node environment, including whether the cluster nodes are running normally, whether the network information configuration is accurate, and whether the number of cluster nodes is appropriate.
5. The method according to claim 3, characterized in that, After the dependency check is completed, if the status is normal, the corresponding deployment and upgrade operations will be performed; after the executable file is run, the execution result will be checked in several ways.
6. The method according to claim 5, characterized in that, Use the framework's built-in return value to determine the execution result.
7. The method according to claim 5, characterized in that, Result detection is performed using custom commands in the serviceTask.
8. The method according to claim 5, characterized in that, Perform health checks on the interface using curl or other commands.
9. The method according to claim 5, characterized in that, It allows users to set both custom and default detection modes to improve user experience.
Citation Information
Patent Citations
Automatic deployment method and terminal
CN106104467A
Automatic deployment method for distributed cloud system
CN108924217A