Automatic deployment method and system for container arrangement platform and electronic equipment
By dividing the deployment solution into independently manageable process function modules and using parameterized scripts, the problems of time-consuming, labor-intensive and high error rates in automated deployment in the existing technology are solved, and rapid automated deployment and multi-version of containerized applications are achieved. Support, improving the efficiency and reliability of the production environment.
Patent Information
- Application Number
- CN202410488762.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-23
- Publication Date
- 2024-08-23
AI Technical Summary
The existing automated deployment methods of container orchestration platforms are time-consuming and labor-intensive, have high error rates, are difficult to adapt to multi-node and multi-version deployments, are complex to maintain, have poor flexibility and reliability, and are limited to a single version of the production environment.
By dividing the deployment solution into process function modules that can be independently managed and expanded, using configuration files and parameterized scripts, automated deployment is achieved, multi-version deployment is supported, certificates are automatically issued and renewed, manual intervention is reduced, and deployment efficiency and maintainability are improved. sex.
It achieves rapid automated deployment of containerized applications, improves the efficiency, reliability and security of the production environment, reduces maintenance complexity, supports multi-version parallel deployment, adapts to diverse application scenarios, and lowers the threshold for use.
Smart Images

Figure CN118535169A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer technology, and in particular relates to an automated deployment method and deployment system for a container orchestration platform and corresponding electronic equipment. Background Art
[0002] With the rise of microservice architecture, a single application is split into multiple independent services, which makes container orchestration platforms indispensable. Enterprises are gradually adopting multi-cloud strategies to deploy applications in the environments of multiple cloud service providers. Container orchestration platforms provide standardized solutions for cross-cloud deployment. Among them, Kubernetes (k8s), as the de facto standard for container orchestration platforms, has been widely recognized and adopted. Other orchestration platforms such as Docker Swarm and Amazon ECS have also been used in specific scenarios. It can be seen that the relevant technical solutions for the automated deployment method of the container orchestration platform are very important in the application of the container orchestration platform. The automated deployment method of the container orchestration platform has become the core technology for modern application development and deployment. In the future, with the continuous development of cloud native technology, it will continue to play a key role in enterprises.
[0003] In the prior art, taking Kubernetes (k8s) as an example, the necessary steps for automated deployment are as follows: the first step is to install the operating system, install basic dependency packages, and set network parameters; the second step is to set initialization parameters including system parameters, time zone, time, number of system connections, host name, etc.; the third step is to prepare deployment packages (including multiple versions of deployment packages); the fourth step is to install the basic container environment, unzip the specified directory, set directory permissions and start the service; the fifth step is to generate master, node, and etcd node certificates; the sixth step is to copy the node certificate and deployment package to the directory of the specified node machine; the seventh step is to install the etcd cluster database and verify the cluster availability status; the eighth step is to install the master component node, modify the configuration file and start the service; the ninth step is to install the node component node, modify the configuration file and start the service; the tenth step is to install the network component, modify the configuration file and start the service; the eleventh step is to install the dns resolution component, modify the configuration file and start the service; the twelfth step is to query and verify the k8s cluster status. The existing automated deployment methods have the following defects: time-consuming and labor-intensive. If there are multiple environments, different versions, and multiple computing nodes with different operating systems, the workload is huge; manually modifying the configuration file has a very high error rate and is prone to configuration omissions. In addition, if problems arise, it is difficult to troubleshoot; issuing certificates manually is prone to errors or omissions, and the number of certificates issued is relatively large, and the operation steps are relatively cumbersome; each different service component needs to modify the configuration file separately, and manual modification is prone to errors.
[0004] It can be seen that due to the limitations of existing technologies, deployment has problems such as inability to dynamically match versions, configuration errors, and cumbersome steps. The flexibility and reliability are poor, and it is only suitable for scenarios in production environments where only a single version needs to be maintained and managed. The application scenarios have obvious limitations.
[0005] Therefore, there is an urgent need to develop an automated deployment method, system and corresponding electronic equipment for a container orchestration platform to simplify and optimize the deployment process of containerized applications, achieve rapid automated deployment of multiple nodes and improve efficiency, reliability and security in the production environment, so as to promote the in-depth application of computer technology. Summary of the invention
[0006] The present invention is to solve all or part of the problems of the above-mentioned prior art. On the one hand, the present invention proposes a method for automatic deployment of a container orchestration platform, which can improve the efficiency and reliability of the deployment process of the entire containerized application and reduce the complexity of maintenance. On the other hand, the present invention provides an automatic deployment system for a container orchestration platform, which improves the degree of automation and centralized management, thereby making the deployment of the container orchestration platform more efficient, maintainable and reliable. The present invention also provides corresponding electronic devices and readable storage media.
[0007] On one hand, the present invention provides a method for automated deployment of a container orchestration platform, wherein the container orchestration platform includes multiple computing nodes; deployment is performed based on the container orchestration platform, and the method includes: step S1. defining a deployment plan, dividing the deployment plan into different process function modules, for respectively executing different predefined automated deployment tasks; wherein the process function modules include multiple different components; the process function modules can be independently managed and expanded; step S2. creating a configuration file based on the deployment plan and the different process function modules; the configuration file includes configuration parameters; step S3. writing a parameterized script based on the configuration parameters; step S4. running the parameterized script to read the configuration parameters to obtain global configuration information; step S5. based on the global configuration information, the parameterized script executes the different automated deployment tasks to complete the automated deployment.
[0008] The automated deployment method of the container orchestration platform provided by the present invention supports multi-version deployment functions through modularization, parameterization, etc. By flexibly configuring components and parameters of different versions, the system can realize parallel deployment of multiple versions in the same environment, which provides great convenience for version iteration and testing. By realizing automated batch deployment of the container orchestration platform and multi-version deployment of the container orchestration platform, the container orchestration platform can better adapt to the ever-changing business needs and technical environment, improve deployment efficiency and maintainability, and can effectively solve the problems of cumbersomeness and dependency management that are difficult to avoid in the existing automated deployment process.
[0009] In some embodiments, in step S2, the configuration parameters include deployment configuration parameters and certificate configuration parameters; the information represented by the deployment configuration parameters includes: node information of the computing node, component version of the component, and system configuration of the deployment environment; the information represented by the certificate configuration parameters includes: the terminal of the certificate authority, the subject of the certificate, and the expiration time; the parameterized script in step S3 includes a certificate script dedicated to certificate management; and step S5 includes the certificate script executing automatic issuance or renewal of certificates according to the certificate configuration parameters.
[0010] By automating certificate management, the certificate script can automatically issue and renew certificates, reducing the work of users manually preparing large deployment packages. Automatic renewal of certificates also avoids problems caused by expired certificates.
[0011] In some embodiments, in step S5, the certificate script further includes, according to the certificate configuration parameters: importing the issued or renewed certificate into the component, revoking an invalid certificate, and / or providing a notification that the certificate is about to expire.
[0012] In some embodiments, in step S5, the certificate script further includes: backing up expired certificates according to the certificate configuration parameters, supporting automatic renewal of certificates, and backing up old certificates.
[0013] In some embodiments, in step S2, the configuration parameters also include conditional parameters; the information indicated by the conditional parameters includes: whether to enable or disable the process function module, or whether to enable or disable the installation of the component; in step S5, the parameterized script executes the automated deployment task, including determining whether to execute the installation of the process function module or the component.
[0014] In the parameterized script execution automated deployment, by reading the conditional parameters in the configuration file, it can be determined whether to execute the installation of a certain process function module or component according to the value of the conditional parameters. The management method of enabling or disabling modules through configuration files improves the maintainability of the entire deployment system. System administrators can adjust the behavior of the system by editing configuration files without modifying the scripts, without having to delve into the script code.
[0015] In some embodiments, in step S5, the process of executing the automated deployment task and completing the automated deployment includes: obtaining the version information of the current operating system running on the computing node, and executing the initialized automated deployment task; confirming the version of the component, and building the automated deployment task to add the permissions required for the component to run; building the automated deployment task to handle the certificate issuance process, generate a certificate request, issue a certificate, and configure the certificate to the component; building the automated deployment task to configure and start the component; wherein the component includes an application, a service, and a library.
[0016] In some embodiments, the step S5 includes: monitoring the execution status of the automated deployment task in real time during the deployment process, and recording detailed log information; the process of completing the automated deployment also includes: verifying the availability of the cluster status.
[0017] In some embodiments, the step of verifying the availability of the cluster status includes: monitoring and detecting the status and performance indicators of the components to confirm that the components are in normal operation; checking network connections and firewall rules to verify whether the communication between the computing nodes is normal; reading the log information for analysis to see if there are any abnormal or erroneous records.
[0018] In some embodiments, the version information of the current operating system includes: the kernel version of the current operating system, the operating system type; before executing initialization, the following is also performed: based on the version information, verifying whether the version of the current operating system meets expectations, and checking whether there are specific patches or updates; executing initialization includes: installing required software packages and dependencies; based on the global configuration information, adjusting the configuration parameters of the current operating system; creating or configuring a user of the current operating system, and setting the user's access rights.
[0019] In some embodiments, confirming the component version includes: obtaining the current version information of the component and comparing it with the preset version; constructing the automated deployment task to add the permissions required for the component to run includes: determining the permission requirements of the component; based on the permission requirements, constructing the automated deployment task to configure the computing node to add the required permissions; wherein the required permissions include: file system permissions, network permissions, and database access permissions.
[0020] In some embodiments, the step of issuing a certificate includes: sending a generated certificate request to a certificate authority to request issuance of a certificate; waiting for a response from the certificate authority, and when the issued certificate is received, acquiring it and storing it in the computing node.
[0021] In some embodiments, the step of constructing the automated deployment task to configure the component includes: the parameterized script reads the global configuration information to obtain deployment context information; wherein the deployment context information includes: connection information, port configuration, certificate path and the component version.
[0022] On the other hand, the present invention provides a container orchestration platform automated deployment system, which executes automated deployment of multiple computing nodes based on the container orchestration platform automated deployment method provided on the first aspect of the present invention; it includes: a deployment plan definition unit, a configuration file creation unit, a parameterized script writing unit, a running script unit, and an automated deployment execution unit; the deployment plan definition unit is configured to define the structure and functional division of the entire deployment plan, and divide the deployment process into independently manageable and expandable process function modules, each of which is used to execute different set automated deployment tasks; the configuration file creation unit is configured to create a configuration file; the parameterized script writing unit is configured to write a parameterized script; the running script unit is configured to run the parameterized script, read configuration parameters, and obtain global configuration information; the automated deployment execution unit is configured to execute the automated deployment task according to the global configuration information.
[0023] In some embodiments, the configuration file includes deployment configuration parameters and certificate configuration parameters; the deployment configuration parameters are used to characterize information including: node information, component version, system configuration; the certificate configuration parameters are used to characterize information including: the terminal of the certificate authority, the subject of the certificate, and the expiration time; the parameterized script includes: a certificate script dedicated to certificate management.
[0024] In some embodiments, the process function module includes: a certificate management module; the certificate management module is configured to process the certificate issuance process, including generating a certificate request, sending it to a certificate authority, waiting for a response, obtaining the issued certificate and storing it in a corresponding computing node in the container orchestration platform.
[0025] In some embodiments, the process function module includes: a system initialization module, a version confirmation module, a component deployment module, and a cluster status verification module; the system initialization module is configured to obtain the version information of the current operating system and execute the initialized automated deployment task; the version confirmation module is configured to obtain the current version information of the component and compare it with the preset version; the component deployment module is configured to dynamically fill the placeholders of the configuration file or update the values in the configuration file based on the global configuration information, configure the component and start the component; the cluster status verification module is configured to monitor and detect the status and performance indicators of the component to confirm that the component is in normal operation; check network connections and firewall rules to verify whether the communication between the computing nodes in the container orchestration platform is normal; read log information for analysis to see if there are any abnormal or erroneous records.
[0026] On the other hand, the present invention provides an electronic device, comprising a memory, a processor, and one or more computer programs, wherein the computer program is stored in the memory and is configured to be executed by several of the processors to execute the container orchestration platform automated deployment method provided on the one hand of the present invention.
[0027] The present invention also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method for automated deployment of a container orchestration platform as provided in one aspect of the present invention are implemented.
[0028] Compared with the prior art, the main beneficial effects of the present invention are:
[0029] 1. The present invention provides an automated deployment method for a container orchestration platform. By dividing the deployment plan into different process function modules that can be managed and expanded independently, using a configuration file to include configuration parameters, and writing a parameterized script based on the relevant parameters, the deployment plan can be flexibly adjusted through the configuration file. The maintainability and scalability of the automated deployment of the container orchestration platform can be continuously optimized. It can reliably meet the scenario of processing multiple different versions of container orchestration platforms for automated deployment at the same time without relying on specific configuration management tools. It has advantages in the automated deployment of large-scale and complex systems.
[0030] 2. The present invention provides an automated deployment system for a container orchestration platform, which is highly scalable through the modular design of process function modules. Through the design of configuration files and parameterized scripts, users can flexibly customize deployment plans to adapt to diverse application scenarios without in-depth understanding of the underlying script implementation, thereby lowering the usage threshold of the automated deployment system for the container orchestration platform and enhancing ease of use.
[0031] 3. The electronic device and readable storage medium provided by the present invention can be used to automatically implement the automated deployment method of the container orchestration platform of the present invention, have corresponding advantages, and are conducive to further promotion in practical applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 Schematic diagram of an automated deployment method for a container orchestration platform according to an embodiment of the present invention.
[0033] Figure 2 The present invention is a flowchart of an implementation method for automated deployment of a container orchestration platform according to an embodiment of the present invention.
[0034] Figure 3 This is a schematic diagram of the k8s deployment and management solution for an embodiment of the present invention.
[0035] Figure 4 Schematic diagram of an automated deployment system for a container orchestration platform according to an embodiment of the present invention.
[0036] Figure 5 It is a schematic diagram of the functional modules of the division process of an embodiment of the present invention. DETAILED DESCRIPTION
[0037] The technical solutions in the specific embodiments of the present invention will be described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments.
[0038] The present invention illustrates, through the following embodiments, that the present invention relates to a method, system and electronic device for automated deployment of a container orchestration platform. Through the method, system and electronic device for automated deployment of a container orchestration platform provided in this embodiment, automated deployment is achieved, the work of manual intervention by users is reduced, and users can customize different deployment schemes to adapt to different environments and requirements by simply adjusting the parameter values in the configuration file without having to have an in-depth understanding of the implementation of the underlying script, thereby improving the practicality of automated deployment in diversified application scenarios and further improving the efficiency and consistency of deployment.
[0039] The automatic deployment method of the container orchestration platform provided in this embodiment can be implemented by the electronic device of this embodiment. The exemplary electronic device includes a memory, a processor, and one or more computer programs, wherein the computer program is stored in the memory and is configured to be executed by one or more processors. The specific automatic deployment method of the container orchestration platform provided in this embodiment.
[0040] Automated deployment of container orchestration platforms refers to the use of container orchestration platforms (such as Kubernetes, DockerSwarm) to automate the deployment and management of applications. Automated deployment methods of container orchestration platforms refer to the specific steps and processes of automated deployment of applications using container orchestration platforms, and the centralized management, automated scheduling and operation of applications are achieved through automated deployment methods.
[0041] The container orchestration platform automated deployment method and system provided in this embodiment have significant application potential in complex system deployment scenarios that require automation, flexibility and maintainability. For example, it is suitable for applications using a microservice architecture, and can quickly and controllably deploy and upgrade each microservice component to ensure high availability and scalability; it is used in scenarios for managing large-scale clusters, and can implement a unified deployment process in a complex cluster environment to ensure the consistency and stability of each node and component in the cluster; it is suitable for scenarios for implementing continuous integration and continuous deployment (CI / CD), and can quickly and automatically deploy new code to test, pre-production and production environments to achieve the goals of rapid delivery and continuous integration; it is used to deploy and manage complex systems, and through the design of configuration files and parameterized scripts, it can easily manage the configuration information of the system and realize flexible customization of various aspects of the system; it is suitable for deploying applications between different cloud service providers or in a hybrid cloud environment, and can unify the deployment process, improve the consistency of deployment, and reduce the complexity of deployment in a multi-cloud environment. The specific situation is not limited here, and there may be other application scenarios.
[0042] The container orchestration platform in this embodiment is illustrated by taking Kubernetes (k8s) as an example, but it is not limited. The container orchestration platform automatic deployment method and system provided in this embodiment are compatible with various container orchestration platforms, such as Docker Swarm, OpenShift, etc., and the container orchestration platform can be selected according to the actual user's needs, environment and preferences, without limitation.
[0043] In actual applications, manufacturers provide two different Kubernetes (k8S) deployment methods, namely container-based deployment and binary deployment. The container-based deployment method relies on the Docker container service, and has the following disadvantages: container service (Docker) downtime will cause k8s to be unavailable, because the operation of Kubernetes depends on the underlying container service; it does not support automatic renewal of certificates, and the certificate update problem needs to be handled manually; the maintenance and management of k8s is relatively inconvenient, especially the dependence on the underlying container service increases the complexity of deployment. The binary deployment method simplifies the deployment process, improves the efficiency by 50% compared to manual deployment, and supports the maintenance and management of k8s clusters. Specifically, the binary deployment method of k8s has the following advantages: the components and directory structure are clear, and they can be maintained according to specific usage requirements, which improves the flexibility of deployment; later maintenance and management are more convenient, including data backup, configuration file modification and other operations are more intuitive and easy to perform; support automatic renewal of k8s certificates, reducing the burden of certificate management; with support for k8s version upgrades, you can easily upgrade the version to obtain new features and security fixes; support for deploying k8s according to roles (master nodes and node nodes), making the deployment more in line with actual usage scenarios; support for dynamic expansion of the number of nodes, for example, in an existing k8s cluster, the number of nodes can be dynamically expanded according to demand, whether it is for master or node nodes. The binary deployment method of k8s is suitable for production environments that require higher customization and control.
[0044] In an example case, the binary deployment process is as follows: Step 1, install the operating system and execute system initialization (initialization script); Step 2, modify the initialization configuration file, set the node-associated IP, deployed version, node role, and certificate validity period; Step 3, the script pushes the uploaded deployment package and unzips it to the specified machine and directory; Step 4, issue the node certificate and automatically distribute it to all nodes through the script; Step 5, generate the master and node configuration files and upload them to the specified machine; Step 6, install the etcd cluster database, modify the configuration file, and load the certificate; Step 7, start the k8s cluster, observe the cluster status information, and verify the environment availability.
[0045] The automated deployment of container orchestration platforms involves the collaborative work of a large number of components, configurations, and tasks. Effective management and coordination is a challenge, especially in large-scale and diverse environments. The difficulties mainly lie in dealing with complexity, ensuring security and reliability, and effectively managing dynamic configurations.
[0046] In the above example, there are the following aspects that can be further optimized: 1. Configuration file modification and script processing reduce a lot of workload, but the script calls have a dependent sequence relationship; 2. The initialization configuration file needs to be edited in advance, and the dependent correspondence between IP and nodes needs to be sorted out; 3. The deployment package is still very large, and it is time-consuming to upload it to the machine, so it needs to be prepared in advance.
[0047] refer to Figure 1 As shown, an example of an automated deployment method for a container orchestration platform in an embodiment of the present invention, the container orchestration platform includes multiple computing nodes; deployment is performed based on the container orchestration platform, and the method includes: step S1. defining a deployment plan, dividing the deployment plan into different process function modules, which are used to respectively execute different predefined automated deployment tasks; wherein the process function module includes multiple different components; the process function module can be independently managed and expanded; step S2. creating a configuration file based on the deployment plan and different process function modules; the configuration file includes configuration parameters; step S3. writing a parameterized script based on the configuration parameters; step S4. running the parameterized script to read the configuration parameters to obtain global configuration information; step S5. based on the global configuration information, the parameterized script executes different automated deployment tasks to complete the automated deployment.
[0048] Through modular design, each process function module can independently execute predefined tasks. Through modular design, the order of script execution is ensured to be automated, and users do not need to manually manage the order of script calls, which is convenient for management and maintenance. Parameterized scripts are used to dynamically read and apply parameters in the configuration file, introducing configurability, allowing users to specify node information, component versions, certificate configuration, etc. through configuration files. Parameterized scripts allow users to provide corresponding parameters at runtime without manually editing complex configuration files. Parameterized scripts are written based on the parameters in the configuration file, and automated deployment tasks are automatically executed by running the script, achieving consistency and repeatability of the deployment process, which is particularly beneficial for different versions, roles, and nodes, so that the script can adapt to various deployment scenarios. The script is adapted to the process function module of the deployment container orchestration platform to simplify the deployment process and make the deployment more controllable and maintainable.
[0049] In some embodiments, in step S2, the configuration parameters include deployment configuration parameters and certificate configuration parameters; the information represented by the deployment configuration parameters includes: node information of the computing node, component version of the component, and system configuration of the deployment environment; the information represented by the certificate configuration parameters includes: the terminal of the certificate authority, the subject of the certificate, and the expiration time; the parameterized script in step S3 includes a certificate script dedicated to certificate management; step S5 includes the certificate script executing automatic issuance and renewal of certificates according to the certificate configuration parameters.
[0050] In some embodiments, in step S2, the configuration parameters also include conditional parameters; the information indicated by the conditional parameters includes: whether to enable or disable the installation of the process function module or component; in step S5, the parameterized script executes the automated deployment task, including determining whether to execute the installation of the process function module or component. When deploying Kubernetes, it is provided to flexibly customize, enable or disable the installation of specific process function modules or components through configuration file items. The introduction of configuration file items allows users to customize the deployment of Kubernetes, allowing users to selectively enable or disable different function modules according to specific business scenarios or requirements to meet the customization requirements in different environments. For example, the conditional parameter can be a Boolean value, such as true for installation and false for non-installation. The conditional parameter can represent a configuration item. By setting the configuration item to true, it means installing the log system; setting it to false means not installing it. By setting the configuration item, the user can decide whether to install the monitoring system to meet different monitoring requirements. The example configuration file also supports the customization of other process function modules, and the user can add more configuration items as needed to control the installation or disabling of other specific functions or components. This embodiment provides a highly configurable deployment solution, so that the Kubernetes deployment process is more in line with the actual needs of users, and improves the maintainability and adaptability of the Kubernetes cluster and its operating environment.
[0051] In some embodiments, in step S5, the certificate script further includes, according to the certificate configuration parameters: importing the issued or renewed certificate into the component, revoking the invalid certificate, and / or sending a notification that the certificate is about to expire.
[0052] In some embodiments, in step S5, the certificate script further includes: backing up expired certificates according to the certificate configuration parameters.
[0053] In some embodiments, in step S5, an automated deployment task is executed, and the process of completing the automated deployment includes: obtaining the version information of the current operating system running on the computing node of the container orchestration platform, and executing the initialization task; confirming the component version, building an automated deployment task to add the permissions required for the component to run; building an automated deployment task to handle the certificate issuance process, generate a certificate request, issue a certificate, and configure the certificate to the component; building an automated deployment task to configure and start the component; wherein the components include applications, services, and libraries.
[0054] In some embodiments, step S5 includes: monitoring the execution status of the automated deployment task in real time during the entire deployment process, and recording detailed log information; the process of completing the automated deployment also includes: verifying the availability of the cluster status.
[0055] In some embodiments, the step of verifying the availability of the cluster status includes: monitoring and detecting the status and performance indicators of the components to confirm that the components are in normal operation; checking the network connection and firewall rules to verify whether the communication between the computing nodes is normal; reading the log information for analysis to see if there are any abnormal or erroneous records.
[0056] In some embodiments, the version information of the current operating system includes: the kernel version of the current operating system, the operating system type; before performing initialization: based on the version information, verify whether the version of the current operating system meets expectations, and check whether there are specific patches or updates; performing initialization includes: installing required software packages and dependencies; based on global configuration information, adjusting the configuration parameters of the current operating system; creating or configuring users of the current operating system, and setting user access rights.
[0057] In some embodiments, confirming the component version includes: obtaining the current version information of the component and comparing it with the preset version; building an automated deployment task to add the permissions required for component operation includes: determining the permission requirements of the component; based on the permission requirements, building an automated deployment task to configure the permissions required for adding computing nodes; wherein the required permissions include: file system permissions, network permissions, and database access permissions.
[0058] In some embodiments, the step of issuing a certificate includes: sending a generated certificate request to a certificate authority to request issuance of a certificate; waiting for a response from the certificate authority, and when the issued certificate is received, acquiring it and storing it in a computing node.
[0059] In some embodiments, the step of building an automated deployment task to configure a component includes: a parameterized script reads global configuration information to obtain deployment context information; based on the deployment context information, the parameterized script dynamically fills in the placeholders of the configuration file or updates the values in the configuration file; wherein the deployment context information includes: connection information, port configuration, certificate path, and component version. The example deployment context information together constitutes the context environment of the deployment, provides the necessary guidance and basis for the parameterized script, and ensures that the containerized application can be correctly and efficiently deployed to the target environment.
[0060] Combined with reference Figure 2 As shown, the steps for implementing automated deployment in this embodiment include triggering deployment process A and certificate issuance process B by user P. The method for automated deployment in the example case includes: script adaptation deployment k8S process function module, and the process of completing automated deployment includes: obtaining the operating system version; confirming the operating system version information, initializing the system; confirming the package version, building the permission adding task; building the certificate issuance process task; building the component deployment task; and verifying the availability of the cluster status.
[0061] Specifically, the version information of the running operating system, confirm whether the version meets expectations, and perform automated deployment tasks for system initialization, including installing required software packages and dependencies, adjusting the configuration parameters of the operating system, and creating or configuring users. Confirm the version information of the required package (or packages), and build tasks to ensure the correct installation of related packages to meet the runtime environment and dependency requirements of the component. In the Kubernetes environment, components can include various core components (such as API Server, Controller Manager, Scheduler) and user-defined workloads (such as application containers). At the same time, confirm the component version, build permissions to add automated deployment tasks to ensure that the permissions required by the component are properly configured during the deployment process. Build tasks to handle the certificate issuance process, including generating certificate requests, sending requests to certificate authorities, waiting for responses and obtaining issued certificates, and finally configuring certificates to related components. Build tasks to configure and start various components of the container orchestration platform. Example components include applications, services, libraries, etc. The build task needs to ensure the correct deployment of components and include the configuration of permissions required for component operation. In the example, after the entire automated deployment is executed, an automated deployment task is built to verify the availability of the cluster status, including monitoring and detecting the status of components, performance indicators, checking network connections and firewall rules, and reading log information for analysis to ensure that the entire cluster is in normal operation.
[0062] like Figure 2 As shown, deployment process A includes the following processes: Prepare the basic configuration file in advance, including system configuration, node information, etc. At the same time, prepare the deployment package of Kubernetes (k8S deployment package). Output the basic configuration file and k8S deployment package. Execute the system initialization script on the target computing node, including installing the required software packages, adjusting the system configuration parameters, etc. The output result is that the initialized system is in a state where Kubernetes can run. Use the script tool to generate parameterized configuration files based on the basic configuration file and other related information, including deployment configuration parameters and certificate configuration parameters. Get the created configuration file, which contains the parameters of various deployment and certificate configurations. Use the script tool to perform automated deployment tasks, including component version confirmation, permission addition task construction, certificate issuance process task construction, component deployment task construction, etc. Each service component is configured and deployed to the corresponding computing node. Use the script tool to perform the automated deployment task of starting the service to ensure that each service component is started and running. Each service component is in a running state. Use the script tool to perform the task of verifying the cluster status. Figure 2In the example, the script tool has the ability to support multi-version and multi-role deployment. Through the parameters in the configuration file, you can flexibly choose to deploy components of different versions and configure computing nodes of different roles.
[0063] The certificate request (CSR) includes information related to the certificate, such as the key, subject, organization, etc. The certificate request needs to be sent to the certificate authority (CA, a trusted entity responsible for issuing digital certificates). The certificate authority verifies the information in the certificate request and decides whether to issue the certificate. Figure 2 As shown, in the certificate issuance process B of the example, a CA certificate is generated, and then the CA certificate generates a CA CSR file and a CA private key. The CACSR file contains information about the CA, such as the name and key of the CA. The CA private key is used to sign and verify the CSR file. A Server certificate is generated, and then a Server private key and a Server CSR file are generated. The server generates a Server CSR file (Server CSR file), which contains information about the server, such as the server's domain name, public key, etc. The server generates a server private key (Server private key) for encryption and digital signature of communications. The server sends the generated Server CSR file to the CA to request a digital certificate issued by the CA. After receiving the server's CSR file, i.e., the Server CSR file, the CA performs verification, such as verifying the identity of the server. If the verification is successful, the CA signs the CSR file with the CA private key and generates a digital certificate (Server certificate). The CA sends the issued digital certificate to the server, which contains the server's public key, subject information, and the CA's signature. After receiving the issued digital certificate, the server installs it to the corresponding certificate storage location. The server can use the certificate for secure communication, and the client can also verify the identity of the server. Through digital certificates, communicating parties can verify each other's identities and ensure the security of communication.
[0064] Combined with reference Figure 2 and Figure 3, the example k8s deployment and management solution covers configuration management, node management, plug-in management, node operations (installation, upgrade, backup), installation of core components, and integration with other system management tools. By reading the configuration file, flexible configuration of the Kubernetes cluster is achieved, including but not limited to node information, network configuration, certificate information, plug-in options, etc. This enables users to customize the cluster according to actual needs. Node management provides full life cycle management of nodes, including operations such as adding, removing, upgrading, and backing up nodes, and covers the maintenance of k8s master nodes and node nodes to ensure high availability and stability of the entire cluster. For all aspects of the k8s cluster, plug-in installation, upgrade, and custom configuration are provided. Plug-ins include network plug-ins, storage plug-ins, monitoring plug-ins, etc., and users can select and customize them according to their needs. Plug-ins include network plug-ins, storage plug-ins, monitoring plug-ins, etc., and users can select and customize specific plug-ins according to their needs to meet the needs of different scenarios.
[0065] Figure 3 In the example, node operations include node installation, node upgrade, and node backup. Node installation includes installing k8s master nodes and installing k8s node nodes. Node upgrade upgrades k8s nodes, and node backup supports node backup operations. Node upgrade also involves installing k8s master nodes and node nodes. Core component operations include installing k8s master nodes, installing node nodes, backing up k8s programs, backing up k8s configuration files, and backing up etcd data. Plugin management covers plugin installation, plugin upgrades, and customizing other plugins. Component installation includes: installing CoreDNS, installing distributed file systems, and installing monitoring systems. By installing the monitoring system, integration and installation of the monitoring system are provided to achieve real-time monitoring of cluster performance and health status.
[0066] Figure 3 The example automated deployment solution provides users with a comprehensive, flexible, and scalable Kubernetes deployment and management solution, making it easy to deploy and maintain k8s clusters in different environments and requirements.
[0067] Combination Figure 3 , the usage document of the example k8s automated deployment tool is as follows:
[0068] #master1 node operation
[0069] 1. Unzip the compressed package
[0070] unzip install-k8s.zip
[0071] 2. Enter the directory and install ansible
[0072] cd install-k8s
[0073] cat for file in$(ls ansible-rpm / *.rpm); do rpm-ivh"$file"> / dev / null; done
[0074] 3. Create ansible directory and host file
[0075] mkdir / etc / ansible
[0076] vi / etc / ansible / hosts
[0077] [k8s-master1]
[0078] 192.***.**.**
[0079] [k8s-master]
[0080] 192.***.**.*5
[0081] 192.***.**.*6
[0082] 192.***.**.*7
[0083] [k8s-node]
[0084] 192.***.**.*8
[0085] 192.***.**.*9
[0086] [k8s:children]
[0087] k8s-master8
[0088] k8s-node
[0089] [k8s:vars]
[0090] ansible_ssh_user=root
[0091] ansible_ssh_pass=*****
[0092] ansible_ssh_port=22
[0093] #If you don't use password-free, you need to manually connect to each host once
[0094] 4. Create a host file
[0095] cat< <eof>promess / init / files / hosts
[0096] 192.***.**.*5k8s-master1
[0097] 192.***.**.*6k8s-master2
[0098] 192.***.**.*7k8s-master3
[0099] 192.***.**.*8k8s-node1
[0100] 192.***.**.*9k8s-node2
[0101] EOF
[0102] cat< <eof>process / install-etcd / files / etcd-hosts
[0103] 192.***.**.*5etcd01
[0104] 192.***.**.*6etcd02
[0105] 192.***.**.*7etcd03
[0106] EOF
[0107] 5. Modify the incoming variable parameters
[0108] vi process / group_vars / vars.yml
[0109] #Generate a trust ip for the self-signed certificate. Generally, fill in the first ipk8s_nodes of all master nodes and service network segments:
[0110] -192.***.**.*5
[0111] -192.***.**.*6
[0112] -192.***.**.*7
[0113] -10.**.*.*
[0114] #Fill in the pod network segment service address and port range
[0115] pod_range:10.***.*.* / 16
[0116] service_range:10.**.*.* / 16
[0117] port_range:30000-50000
[0118] #Fill in the apiserver service and port of the master node connected to the etcd cluster
[0119] kubeconfig_server:"192.***.**.*5:6443"
[0120] #Fill in etcd node name and address
[0121] etcd_list:
[0122] -etcd01=https: / / 192.***.**.*5:2380
[0123] -etcd02=https: / / 192.***.**.*6:2380
[0124] -etcd03=https: / / 192.***.**.*7:2380
[0125] #Fill in the etcd node address
[0126] etcd_endpoints:
[0127] -https: / / 192.***.**.*5:2379
[0128] -https: / / 192.***.**.*6:2379
[0129] -https: / / 192.***.**.*7:2379
[0130] #Fill in the DNS IP address
[0131] dns_ip:10.**.*.2
[0132] 6. Install k8s cluster
[0133] . / deploy.sh
[0134] Execute in sequence 1-8
[0135] 7. Notes
[0136] 1. Format and mount the disk, soft-link the data directory, and do manual operations in advance
[0137] 2. Initialization step 1: file descriptor optimization takes effect. Restart needs to be performed manually. The host name takes effect after restart. ansible k8s-m shell-a reboot
[0138] 3. The default apiserver node uses hostname-i to connect to the local
[0139] 4. After re-executing the self-signed certificate, you need to delete the kubelet-related certificate files of all nodes
[0140] 5. All steps can be repeated, but they must be performed in order
[0141] In the above code involving IP addresses and secrets, "*" refers to specific numbers. IP addresses and passwords can be set accordingly according to actual conditions and are not limited. The above content is a series of steps for deploying master nodes in Kubernetes (k8s) clusters, covering the initialization, configuration and installation processes. The above series of steps are to deploy master nodes in Kubernetes clusters, in which Ansible is used to automate the deployment process and configure some parameters to meet the needs of Kubernetes clusters. In addition, the precautions section provides some matters that need to be handled manually to ensure the smooth deployment of the cluster. Specifically: 1. Unzip the compressed package: Unzip the compressed package named install-k8s.zip, which contains the necessary files for Kubernetes deployment. 2. Install Ansible: Enter the unzipped directory and install Ansible, which may be installed through the RPM package. Ansible is usually used for automated deployment and configuration, and the configuration of Kubernetes clusters can be completed through Ansible scripts. 3. Create Ansible directory and Host file: Create / etc / ansible directory, and edit / etc / ansible / hosts file, specify the IP address of each node in the cluster, and classify them into k8s-master1, k8s-master, k8s-node, and variable settings of k8s:children and k8s:vars. 4. Create Host file and etcd Host file: Configure host name and etcd node information for each node in the cluster by creating promess / init / files / hosts and process / install-etcd / files / etcd-hosts files. 5. Modify the incoming variable parameters: Edit process / group_vars / vars.yml file to configure relevant parameters for Kubernetes cluster, including node information, Pod network segment, Service network segment, etcd node information, etc. 6. Install k8s cluster: Execute . / deploy.sh, and perform corresponding operations according to the sequence number (1-8) to complete the installation of Kubernetes cluster. 7. Notes: Provides relevant notes, including disk formatting and mounting, file descriptor optimization, host name restart and other related operations.
[0142] Combined with reference Figure 2 and Figure 4 , an example provides a container orchestration platform automated deployment system 10, which performs automated deployment of multiple computing nodes based on any container orchestration platform automated deployment method provided in the above embodiments; including: a deployment plan definition unit 101, a configuration file creation unit 102, a parameterized script writing unit 103, a running script unit 104, and an automated deployment execution unit 105. The deployment plan definition unit 101 is configured to define the structure and functional division of the entire deployment plan, and divide the deployment process into independently manageable and scalable process function modules, each of which is used to execute different set automated deployment tasks; the configuration file creation unit 102 is configured to create a configuration file; the parameterized script writing unit 103 is configured to write a parameterized script; the running script unit 104 is configured to run the parameterized script, read the configuration parameters, and obtain the global configuration information; the automated deployment execution unit 105 is configured to execute the automated deployment task according to the global configuration information.
[0143] In some embodiments, the configuration file includes deployment configuration parameters and certificate configuration parameters; the deployment configuration parameters are used to characterize information including: node information, component version, system configuration; the certificate configuration parameters are used to characterize information including: the terminal of the certificate authority, the subject of the certificate, and the expiration time; the parameterized script includes: a certificate script dedicated to certificate management. Through the example configuration file, users can flexibly specify node information, component version, system configuration, etc. (deployment configuration parameters), and can also customize information such as the certificate authority, certificate subject, and validity period (certificate configuration parameters).
[0144] Figure 5 In the example case, the divided process functional modules are: certificate management module 201; certificate management module 201 is configured to handle the certificate issuance process, including generating a certificate request, sending it to the certificate authority, waiting for a response, obtaining the issued certificate and storing it in the corresponding computing node in the container orchestration platform.
[0145] Figure 5 In the example case, the divided process function modules are: system initialization module 202, version confirmation module 203, component deployment module 204, cluster status verification module 205; the system initialization module 202 is configured to obtain the version information of the current operating system and perform the initialization automated deployment task; the version confirmation module 203 is configured to obtain the current version information of the component and compare it with the preset version; the component deployment module 204 is configured to dynamically fill in the configuration file based on the global configuration information, configure the component and start it; the cluster status verification module 205 is configured to monitor and detect the status and performance indicators of the component to confirm that the component is in normal operation; check the network connection and firewall rules to verify whether the communication between the various computing nodes in the container orchestration platform is normal; read the log information for analysis to see if there are any abnormal or erroneous records.
[0146] A readable storage medium is also provided in the embodiment, and the readable storage medium stores a program or instruction that, when executed by a processor, implements the method for automated deployment of a container orchestration platform as provided in any of the above embodiments. Therefore, it has all the beneficial effects of the method for automated deployment of a container orchestration platform as provided in any of the above embodiments.
[0147] In order to facilitate the description, some common English nouns or letters and concepts used in the present invention are only used for exemplary reference rather than restrictive interpretation or specific usage, and the protection scope of the present invention should not be limited by their Chinese translation or specific letters.
[0148] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solutions provided in the embodiments of the present invention are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.
[0149] In this document, the terms "comprises", "includes" or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device that includes a list of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of additional identical elements in the process, method, article, or device that includes the element.
[0150] The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features applied herein.< / eof> < / eof>
Claims
1. A method for automatic deployment of a container orchestration platform, characterized in that: The container orchestration platform includes multiple computing nodes; and the method for deploying based on the container orchestration platform includes: Step S1. Define a deployment plan, divide the deployment plan into different process function modules, which are used to respectively execute different predefined automated deployment tasks; wherein the process function module includes a plurality of different components; the process function module can be independently managed and expanded; Step S2. Create a configuration file based on the deployment scheme and the different process function modules; the configuration file includes configuration parameters; Step S3. Write a parameterized script based on the configuration parameters; Step S4. Run the parameterized script to read the configuration parameters to obtain global configuration information; Step S5. Based on the global configuration information, the parameterized script executes the different automated deployment tasks to complete the automated deployment.
2. The method for automatic deployment of a container orchestration platform according to claim 1, characterized in that: In the step S2, the configuration parameters include deployment configuration parameters and certificate configuration parameters; The information represented by the deployment configuration parameters includes: node information of the computing node, component version of the component, and system configuration of the deployment environment; The information represented by the certificate configuration parameters includes: the terminal of the certificate issuing authority, the subject of the certificate, and the expiration date; The parameterized script in step S3 includes a certificate script dedicated to certificate management; and step S5 includes the certificate script executing automatic issuance or renewal of a certificate according to the certificate configuration parameters.
3. The method for automatic deployment of a container orchestration platform according to claim 2, characterized in that: In step S5, the certificate script further includes: Importing issued or renewed certificates into the component, revoking expired certificates, and / or providing notification of impending certificate expiration.
4. The method for automatic deployment of a container orchestration platform according to claim 3, characterized in that: In the step S5, the certificate script further includes: backing up expired certificates according to the certificate configuration parameters.
5. The method for automatic deployment of a container orchestration platform according to claim 2, characterized in that: In the step S2, the configuration parameters also include conditional parameters; the information indicated by the conditional parameters includes: whether to enable or disable the process function module, or whether to enable or disable the installation of the component; in the step S5, the parameterized script executes the automated deployment task, including determining whether to execute the installation of the process function module or the component.
6. The method for automatic deployment of a container orchestration platform according to any one of claims 2 to 5, characterized in that: In step S5, the process of executing the automated deployment task and completing the automated deployment includes: Obtaining version information of the current operating system running on the computing node, and executing the initialized automated deployment task; Confirm the version of the component, build the automated deployment task and add the permissions required for the component to run; Building the automated deployment task to handle the certificate issuance process, generate certificate requests, issue certificates, and configure certificates to the components; The automated deployment task is constructed to configure and start the components; wherein the components include applications, services, and libraries.
7. The method for automatic deployment of a container orchestration platform according to claim 6, characterized in that: The step S5 includes: monitoring the execution status of the automated deployment task in real time during the deployment process and recording detailed log information; The process of completing the automated deployment also includes: verifying the availability of the cluster status.
8. The method for automatic deployment of a container orchestration platform according to claim 6, characterized in that: The step of verifying the availability of the cluster status includes: Monitor and detect the status and performance indicators of the components to confirm that the components are in normal operation; Check network connections and firewall rules to verify whether the communication between the computing nodes is normal; Read the log information and analyze it to see if there are any abnormal or erroneous records.
9. The method for automatic deployment of a container orchestration platform according to claim 6, characterized in that: The version information of the current operating system includes: the kernel version and the operating system type of the current operating system; Before the initialization is performed, the following is also performed: based on the version information of the current operating system, verifying whether the version of the current operating system meets expectations, and checking whether there is a specific patch or update; The execution initialization includes: installing the required software packages and dependencies; adjusting the configuration parameters of the current operating system based on the global configuration information; creating or configuring a user of the current operating system and setting the access rights of the user.
10. The method for automatic deployment of a container orchestration platform according to claim 6, characterized in that: The confirming the component version includes: obtaining current version information of the component and comparing it with a preset version; The step of constructing the automated deployment task to add the permissions required for the component to run includes: determining the permission requirements of the component; and based on the permission requirements, constructing the automated deployment task to configure the computing node to add the required permissions; The required permissions include: file system permissions, network permissions, and database access permissions.
11. The method for automatic deployment of a container orchestration platform according to claim 6, characterized in that: The issuing step includes: sending the generated certificate request to the certificate issuing authority to request the issuance of a certificate; waiting for a response from the certificate issuing authority, and when the issued certificate is received, acquiring it and storing it in the computing node.
12. The method for automatic deployment of a container orchestration platform according to claim 6, characterized in that: The step of constructing the automated deployment task to configure the component includes: The parameterized script reads the global configuration information to obtain deployment context information; Based on the deployment context information, the parameterized script dynamically fills the placeholders of the configuration file or updates the values in the configuration file; The deployment context information includes: connection information, port configuration, certificate path and the component version.
13. A container orchestration platform automated deployment system, characterized in that: The method for automated deployment of a container orchestration platform according to any one of claims 1 to 12 performs automated deployment of multiple computing nodes; comprising: a deployment plan definition unit, a configuration file creation unit, a parameterized script writing unit, a running script unit, and an automated deployment execution unit; The deployment scheme definition unit is configured to define the structure and functional division of the entire deployment scheme, and divide the deployment process into process function modules that can be independently managed and expanded, each of which is used to execute different set automated deployment tasks; the process function module includes multiple components; The configuration file creation unit is configured to create a configuration file; The parameterized script writing unit is configured to write a parameterized script; The script running unit is configured to run the parameterized script, read the configuration parameters, and obtain the global configuration information; The automated deployment execution unit is configured to execute the automated deployment task according to global configuration information.
14. The container orchestration platform automated deployment system according to claim 13, characterized in that: The configuration file includes deployment configuration parameters and certificate configuration parameters; The information used to characterize the deployment configuration parameters includes: node information, component version, system configuration; the information used to characterize the certificate configuration parameters includes: the terminal of the certificate authority, the subject of the certificate, and the expiration time; the parameterized script includes: a certificate script dedicated to certificate management.
15. The container orchestration platform automatic deployment system according to claim 14, characterized in that: The process function module includes: a certificate management module; the certificate management module is configured to process the certificate issuance process, including generating a certificate request, sending it to a certificate authority, waiting for a response, obtaining the issued certificate and storing it in a corresponding computing node in the container orchestration platform.
16. The container orchestration platform automatic deployment system according to claim 14, characterized in that: The process function modules include: system initialization module, version confirmation module, component deployment module, and cluster status verification module; The system initialization module is configured to obtain the version information of the current operating system and execute the automated deployment task of initialization; The version confirmation module is configured to obtain the current version information of the component and compare it with the preset version; The component deployment module is configured to dynamically fill the placeholders of the configuration file or update the values in the configuration file based on the global configuration information, configure the component and start the component; The cluster status verification module is configured to monitor and detect the status and performance indicators of the components to confirm that the components are in normal operation; check network connections and firewall rules to verify whether the communication between the various computing nodes in the container orchestration platform is normal; read log information for analysis to see if there are any abnormal or erroneous records.
17. An electronic device, characterized in that: The system comprises a memory, a processor, and a plurality of computer programs, wherein the computer programs are stored in the memory and are configured so that the plurality of processors execute the method for automatic deployment of a container orchestration platform according to any one of claims 1 to 12.
18. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the method for automated deployment of a container orchestration platform as claimed in any one of claims 1 to 12 are implemented.
Citation Information
Cited By
Intelligent operation and maintenance system and method based on database virtual software
CN119473371A
Trusted component division and automatic deployment method of trusted DCS (Distributed Control System) controller
CN119861940A
