Automatic service rapid deployment upgrading method based on ssh channel
Patent Information
- Application Number
- CN202411002562.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2044-07-25
AI Technical Summary
但这种部署和升级并不够快速、安全、稳定
[0032] By using the present invention, the deployment and upgrade operation of the cloud platform can be made more convenient, faster and more stable. Makes the judgment of environmental status more convenient and flexible. Create a strategy that better meets the needs of the environment by customizing the deployment and upgrade framework. It abandons the fixed and rigid manual steps in the past, and is well compatible with the deployment and upgrade requirements of various components, without the need to adapt each component. This makes component access to the cloud platform and subsequent upgrade operations flatter, and the stability, convenience, and compatibility involved in the version upgrade process will be more direct and efficient. Not only does access to components provide more possibilities. It also establishes a clearer and simpler dependency bridge between components.
Smart Images

Figure CN119030872A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cloud computing, and in particular to an automated service rapid deployment and upgrade method based on an SSH channel. Background Art
[0002] The implementation of the deployment and upgrade framework based on the protocol channel is mainly based on the expression, analysis and implementation of the deployment and upgrade strategy. Among them, the deployment and upgrade template defines the target requirements of the deployment and upgrade, the deployment and upgrade strategy abstracts and describes the application and implementation of the deployment and upgrade, and the deployment and upgrade framework describes the specific implementation of the deployment and upgrade command, the composition architecture and the interaction process between components.
[0003] Inspur Cloud provides users with many services and upgrades and updates of component services. However, such deployment and upgrades are not fast, secure, and stable enough. This requires an automated, fast, and stable deployment and upgrade solution. Standardized adaptation can be performed for various environments and products, and the desired service operations can be provided. Summary of the invention
[0004] In order to solve the above technical problems, the present invention provides an automated service rapid deployment and upgrade method based on 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 upgrade process, reduces the risk of business interruption, optimizes resource utilization, and provides automated compatibility.
[0005] The present invention implements fine-grained resource monitoring, environment detection, component dependency judgment, etc. through a custom deployment and upgrade framework. Through a complex combination of cluster, nodeSelect, and command, more complex and customized deployment and upgrade requirements can be met.
[0006] Command is extensible, making deployment and upgrade more diverse.
[0007] The program has built-in basic detection, which provides the most basic hard detection of the environment. It can determine in advance whether there are blocking errors in the environment for component deployment and upgrade, and accurately and stably judge the environment status.
[0008] Through serviceTash custom deployment and upgrade items, user deployment and upgrade operations are more flat. Cloud platform service product components can be deployed and upgraded more flexibly and efficiently, improving the diversity and stability of the environment.
[0009] The present invention provides an automated service rapid deployment and upgrade method based on SSH channel, which realizes the compatibility of several deployment components and deployment tasks through the definition of serviceTask custom deployment task core template, and realizes the deployment method with different implementation methods but the same execution process;
[0010] Use depence dependencies to resolve dependencies between components and clearly define dependency methods;
[0011] Through the intervention of the site, a collection of basic environment information is provided, and it can be distinguished according to different cloud platforms;
[0012] The running node can be customized through the nodeSelector node selector, and multiple node selectors can be shared to refine the granularity;
[0013] Use cluster mode to ensure high availability of the product environment.
[0014] Furthermore,
[0015] ServiceTask execution logic:
[0016] a) First, read the deployment and upgrade requirement template to obtain the deployment or upgrade requirements to be executed;
[0017] b) Based on the requirements, a series of internal methods are used to generate the deployment or upgrade files that need to be executed;
[0018] c) Read the site configuration information of the corresponding environment and select the cluster nodes that meet the execution conditions;
[0019] d) Use the certificate to remotely detect the running status of dependent components 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] Going further,
[0023] After receiving the user's request, it will first obtain the various resource information of the current environment based on the site information of the current execution environment, and then perform basic detection on the current cluster or node environment; after passing the basic detection, it will load the custom deployment upgrade file provided by the user, obtain the cluster node information to be deployed and upgraded based on the cluster and nodeSelect parameters, generate the corresponding user-defined deployment upgrade method based on the command parameters, and then go to the user-specified node to detect runtime dependencies and deployment dependencies, and determine the deployment or upgrade operation to be performed based on the operation type, execute the custom deployment upgrade command, and obtain the result.
[0024] Going further,
[0025] Perform basic checks on the current cluster or node environment, including whether the cluster node operation status is normal, whether the network information configuration is accurate, and whether the number of cluster nodes matches.
[0026] After the dependency check is completed, if the status is normal, the corresponding deployment upgrade operation will be performed; after the execution file is completed, the execution result will be checked in several ways:
[0027] Use the framework's built-in return value to determine the execution result.
[0028] The result is detected through the custom command in the serviceTask.
[0029] Use curl or other commands to check the health interface.
[0030] The present invention can set two detection modes, custom and default, to provide user experience.
[0031] The beneficial effects of the present invention are
[0032] By using the present invention, the deployment and upgrade operations of the cloud platform can be made more convenient, fast and stable. The judgment of the environmental status can be made more convenient and flexible. By customizing the deployment and upgrade framework, a strategy that better meets the environmental requirements can be created. The previous fixed and rigid manual steps are abandoned, and it can be well compatible with the deployment and upgrade requirements of various components without the need to adapt each component. The component access to the cloud platform and the subsequent upgrade operations are made flatter, and the stability, convenience and compatibility involved in the version upgrade process will be more direct and efficient. Not only does it provide more possibilities for component access, but it also establishes a clearer and simpler dependency bridge between components. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a schematic diagram of the detection process of the present invention;
[0034] Figure 2 It is a serviceTask execution logic diagram. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0036] In the existing cloud computing platforms, service product components are diversified and complicated. The traditional cloud platform deployment and upgrade process is often time-consuming and error-prone, and requires manual intervention, which is particularly inconvenient in large-scale cluster environments. Although the existing automation tools have improved, there is still room for improvement, especially in terms of rapid response to service changes and ensuring business continuity. In addition, a variety of service products often require different deployment and upgrade methods, which reflects the orchestration and compatibility of the framework. Therefore, the remote automation service rapid deployment and upgrade framework based on SSH channels can be more widely used. Only by providing information files that conform to the deployment and upgrade templates can the automatic deployment and upgrade be realized, which greatly improves the efficiency of use, reduces manual operations, effectively reduces abnormalities, and avoids risks. In addition, the framework structure can effectively accommodate the different requirements of various component deployment and upgrades, and improve the deployment and upgrade speed.
[0037] Through the definition of the serviceTask custom deployment task core template, we can achieve compatibility of multiple deployment components and deployment tasks, and achieve the same deployment method with different implementation methods but the same execution process; using depence dependencies to solve the dependency relationship between components and clearly define the dependency method can better solve the abnormal problems caused by the coupling between components; the intervention of the site site effectively provides a collection of basic environment information, and can make detailed distinctions corresponding to different cloud platforms; the nodeSelector node selector can customize the running node in detail, and the sharing of multiple node selectors can refine the granularity and more accurately implement the deployment action allocation; the cluster cluster mode ensures the high availability of the product environment, ensures the stability of the environment, and provides a high-quality customer experience. The following is a detailed explanation of the key points in the technical solution.
[0038] 1) site: The site is configured with basic information of the environment (cluster, node, network configuration, etc.) and the required chart set.
[0039] 2) serviceTask: A service item that defines a component. In this article, it is actually a deployment or upgrade requirement, which is a custom YAML file of the service product. The framework will implement corresponding operations on the cloud platform environment based on this file.
[0040] 3) type: defines the type of operation, 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 dependent components during deployment and upgrade. In this article, dependency includes runtime dependency and deployment dependency.
[0042] 5)cluster: a k8s cluster consists of one or more nodes.
[0043] 6)nodeSelector: node selector, whose value is the node label. This parameter is used to obtain node information that meets the requirements.
[0044] 7) Command: Specific operations on cluster or node resources.
[0045] serviceTask template:
[0046]
[0047]
[0048] serviceTask executes logic, such as Figure 2 As shown:
[0049] 1) First, read the deployment and upgrade requirement template to obtain the deployment or upgrade requirements to be executed.
[0050] 2) Based on the requirements, a series of internal methods are used to generate the deployment or upgrade files that need to be executed.
[0051] 3) Read the site configuration information of the corresponding environment and filter out the cluster nodes that meet the execution conditions.
[0052] 4) Use the certificate to remotely check the running status of dependent components from the master node to the cluster node to be run.
[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 ideas:
[0056] 1. Generation of deployment and upgrade items
[0057] The program will preset some deployment and upgrade items for deployment and upgrade of common public scenarios, such as node system vulnerability upgrades and automated tool deployment.
[0058] Users can customize the deployment upgrade request based on their needs. The detection items created must include name (component name), cluster, command, and optional nodeSelect. NodeSelect represents one or a type of node resource, and supports the use of null values for full node matching; command represents the operation on this resource or this type of resource, and supports the use of some parameters preset by the program to obtain simple cluster environment information.
[0059] Key technical points:
[0060] 1) Command conditions are rich and extensible. Command not only supports custom deployment upgrade items, but also supports a variety of 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 that product developers can freely configure based on their own product requirements. As long as the deployment or upgrade requirements meet the template format, they can be implemented. This greatly reduces the need to configure the upgrade deployment steps separately for each new component. It is implemented automatically, reducing the risk of human intervention errors and greatly improving deployment and upgrade efficiency.
[0062] 3) Through the reasonable combination of cluster, nodeSelect, and command, the deployment and upgrade scenarios required by users can be flexibly defined, covering a wide range of requirements and providing diversified deployment and upgrade command access. For example, "empty" can be used to match all clusters and nodes, and the built-in conditions of the program can be used.
[0063] 2. Deployment and execution of upgrade items
[0064] After receiving the user's request, it will first obtain the various resource information of the current environment based on the site information of the current execution environment, including but not limited to the node name, network information, label, cluster, node role, etc. Then it will perform basic tests on the current cluster or node environment, including but not limited to whether the cluster node is running normally, whether the network information configuration is accurate, whether the number of cluster nodes matches, etc. After passing the basic test, it will load the custom deployment upgrade file provided by the user, obtain the cluster node information to be deployed and upgraded based on parameters such as cluster and nodeSelect, generate the corresponding user-defined deployment upgrade method based on the command parameter, and then go to the user-specified node to detect the runtime dependencies and deployment dependencies, and determine the deployment or upgrade operation to be performed based on the operation type, execute the custom deployment upgrade command, and obtain the result.
[0065] 3. Determine the deployment upgrade items
[0066] After the dependency detection is completed, if the status is normal, the corresponding deployment upgrade operation will be performed. After the execution file is completed, the execution result will be detected in a variety of ways. The built-in return value of the framework can be used to judge the execution result. The result can also be detected through custom commands in serviceTask; health interface detection can also be performed through curl or other commands. Flexible custom judgment makes the deployment upgrade detection conditions of access diversified, and the two detection modes of custom and default can provide a more convenient user experience.
[0067] The above description is only a preferred embodiment of the present invention, which is only used to illustrate the technical solution of the present invention, and is not used to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A method for rapid deployment and upgrade of automated services based on ssh channels, characterized in that: By defining the core template of the custom deployment task of serviceTask, we can achieve compatibility of several deployment components and deployment tasks, and achieve different deployment methods but the same execution process. Use depence dependencies to resolve dependencies between components and clearly define dependency methods; Through the intervention of the site, a collection of basic environment information is provided, and it can be distinguished according to different cloud platforms; The running node can be customized through the nodeSelector node selector, and multiple node selectors can share the same 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) Generate deployment or upgrade files that need to be executed through internal operations based on requirements; c) Read the site configuration information of the corresponding environment and select the cluster nodes that meet the execution conditions; d) Use the certificate to remotely detect the running status of dependent components from the master node to the cluster node to be run; e) Automatically upload the execution file from the master node to the node to be run; f) Automatically run the execution file and detect the execution completion result.
3. The method according to claim 2, characterized in that After receiving the user's request, it will first obtain the various resource information of the current environment based on the site information of the current execution environment, and then perform basic detection on the current cluster or node environment; after passing the basic detection, it will load the custom deployment upgrade file provided by the user, obtain the cluster node information to be deployed and upgraded based on the cluster and nodeSelect parameters, generate the corresponding user-defined deployment upgrade method based on the command parameters, and then go to the user-specified node to detect runtime dependencies and deployment dependencies, and determine the deployment or upgrade operation to be performed based on the operation type, execute the custom deployment upgrade command, and obtain the result.
4. The method according to claim 3, characterized in that Perform basic checks on the current cluster or node environment, including whether the cluster node operation status is normal, whether the network information configuration is accurate, and whether the number of cluster nodes matches.
5. The method according to claim 3, characterized in that: After the dependency detection is completed, if the status is normal, the corresponding deployment upgrade operation will be performed; after the execution file is completed, the execution result will be detected 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 The result is detected through the custom command in the serviceTask.
8. The method according to claim 5, characterized in that Use curl or other commands to check the health interface.
9. The method according to claim 5, characterized in that Two detection modes, custom and default, can be set to provide better user experience.
Citation Information
Patent Citations
Automatic deployment method and terminal
CN106104467A
Automatic deployment method for distributed cloud system
CN108924217A
Method for realizing adaptive deployment of cluster, method and system for adaptive deployment of large data cluster based on cloud platform
CN109104318A
Automatic service arrangement method and device based on parameter driving
CN110912724A
Service arrangement method and system based on application environment
CN111367534A
