Method and system for deploying OpenShift cluster based on cloud platform

Automatically create and configure nodes of OpenShift clusters through the cloud platform, solving the cumbersome and complex deployment process in the existing technology, improving deployment efficiency and reducing difficulty, and realizing the automated configuration of OpenShift clusters.

CN119232570APending Publication Date: 2024-12-31HUNAN KYLIN XINAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411250718.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

In the prior art, the deployment process of OpenShift clusters is complicated and complicated, and is prone to errors, which requires manual configuration and deployment, resulting in low efficiency and high difficulty.

Method used

Obtain user configuration information through the cloud platform, automatically create and configure bastion machines, boot nodes, master nodes and work nodes, realize the automatic deployment of OpenShift clusters, and simplify the deployment process.

Benefits of technology

Improve the efficiency of OpenShift cluster deployment, reduce deployment difficulty, realize automated configuration, and reduce the possibility of human error.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119232570A_ABST
    Figure CN119232570A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a system for deploying an OpenShift cluster based on a cloud platform. The method comprises the following steps: acquiring configuration information which is submitted by a user on a customized page of a cloud platform source console and is used for configuring a bastion host, an OpenShift guide node, a main node and a working node through the cloud platform; and automatically creating a virtual machine and configuring the bastion host, the OpenShift guide node, the main node and the working node through the cloud platform according to configuration information required for configuring the bastion host, the OpenShift guide node, the main node and the working node, thereby completing automatic configuration of the OpenShift cluster. The invention aims to realize automatic deployment of the OpenShift cluster, improve the deployment efficiency of the OpenShift cluster and reduce the deployment difficulty of the OpenShift cluster.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of deployment of distributed clusters, and in particular to a method and system for deploying an OpenShift cluster based on a cloud platform. Background Art

[0002] OpenShift is a container-based application platform that provides a complete environment for developing, deploying and managing enterprise-level applications. OpenShift uses Docker containers to package and run applications, ensuring application portability and consistency. OpenShift is based on Kubernetes (K8s), an open source container orchestration platform that provides features such as automatic expansion, rolling updates, and self-healing. In OpenShift, a cluster consists of a group of worker nodes, which can be physical servers or virtual machines. The nodes in the cluster run multiple containerized applications. OpenShift supports a multi-tenant architecture, allowing multiple projects to run in the same cluster, each with its own resource quotas and security policies. OpenShift provides an automated deployment process that supports continuous integration and continuous deployment (CI / CD) from source code to running applications. OpenShift clusters are ideal for enterprise-level application development and deployment, especially for scenarios that require high availability, scalability, and security. With OpenShift, enterprises can quickly build, deploy, and manage complex applications while reducing operational complexity and costs.

[0003] In the prior art, when deploying OpenShift, you first need a bastion server, deploy a load balancer, DNS, http server, and private image repository in the bastion server, configure the deployment list of OpenShift, and then use the OpenShift-install command to generate the ignition file required by coreos. When installing the boot node and master or worker node of OpenShift, you need to enter the livecd mode and use coreos-installer to specify the ignition file to install the operating system. The whole process is cumbersome and complicated, and if any key link in the middle has an error, it needs to be redeployed. Among them, the bastion refers to a collection of resources required to install the OpenShift cluster, including a load balancer, DNS resolution, http server, and private image repository, as well as the ignition files required by coreos; the bootstrap refers to the boot node when installing OpenShift, which is mainly used to create a temporary control plane. When the master node is deployed, the temporary control plane is transferred to the master node, and the control plane is transferred to the master node; the master node is the management node of the OpenShift cluster, responsible for managing the entire OpenShift cluster; the worker node is the working node of the OpenShift cluster, and all business pods run on the worker node. Summary of the invention

[0004] Technical problem to be solved by the present invention: In view of the above-mentioned problems in the prior art, a method and system for deploying an OpenShift cluster based on a cloud platform are provided. The present invention aims to realize automatic deployment of an OpenShift cluster, improve the efficiency of OpenShift cluster deployment, and reduce the difficulty of OpenShift cluster deployment.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is: A method for deploying an OpenShift cluster based on a cloud platform includes the following steps: Obtain the configuration information required for configuring the bastion host, OpenShift boot node, master node, and worker node submitted by the user on the cloud platform page through the cloud platform; The cloud platform automatically creates and configures the bastion host, OpenShift boot node, master node, and worker node according to the configuration information to complete the automatic configuration of the OpenShift cluster.

[0006] Optionally, the configuration information required to configure the bastion host includes a cluster domain name customized by the OpenShift cluster and an IP address of the bastion host; the automatically creating and configuring the bastion host according to the configuration information by the cloud platform includes: The cloud platform creates a bastion host based on the user-defined cluster domain name of the OpenShift cluster and the IP address of the bastion host filled in on the cloud platform page, combined with the default virtual machine template for creating a bastion host. The virtual machine template has built-in HAProxy load balancer, DNS server, HTTP server and private image warehouse, and the private image warehouse contains the container images required by OpenShift. After successfully creating the bastion host, the cloud platform uses the libvirt feature to update the IP information to the configuration of each server in the bastion host, including the haproxy load balancer, dns server, http server and private image repository; after the bastion host is started, the system of the bastion host calls the script by default to run each server to enable it to provide services to the outside.

[0007] Optionally, the configuration information required to configure the OpenShift boot node includes the version of the OpenShift cluster and the IP address of the OpenShift boot node. Automatically creating and configuring the OpenShift boot node according to the configuration information by the cloud platform includes: Request the ignition file corresponding to the version of the OpenShift cluster from the http server in the bastion host through the backend server of the cloud platform; After requesting the ignition file, a new ignition file containing the configuration items of the IP address of the OpenShift boot node is generated using the butane container according to the IP address of the OpenShift boot node, and the new ignition file is injected into the image file ISO of the boot node using the core-installer command to generate a new image file ISO. The cloud platform uses the new image file ISO to create a virtual machine of the OpenShift boot node. Control the startup of the virtual machine of the OpenShift boot node so that the virtual machine of the OpenShift boot node automatically installs the operating system after startup, automatically sets the network information according to the configuration items in the new ignition file, and automatically deploys the OpenShift boot node.

[0008] Optionally, the configuration information required to configure the master node includes the version of the OpenShift cluster and the IP address and number of nodes of the master node. The cloud platform automatically creates and configures a single master node according to the configuration information, including: Request the ignition file corresponding to the version of the OpenShift cluster from the http server in the bastion host through the backend server of the cloud platform; After requesting the ignition file, a new ignition file containing the configuration items of the IP address of the master node is generated by using the butane container according to the IP address of the master node, and the new ignition file is injected into the image file ISO of the boot node using the core-installer command to generate a new image file ISO. The cloud platform uses the new image file ISO to create a virtual machine of the master node; Control the startup of the virtual machine of the master node so that the virtual machine of the master node automatically installs the operating system after startup, automatically sets the network information according to the configuration items in the new ignition file, and automatically deploys the master node.

[0009] Optionally, the configuration information required to configure the worker node includes the version of the OpenShift cluster and the IP address and number of the worker node. The cloud platform automatically creates and configures a single worker node according to the configuration information, including: Request the ignition file corresponding to the version of the OpenShift cluster from the http server in the bastion host through the backend server of the cloud platform; After requesting the ignition file, a new ignition file containing the configuration items of the IP address of the worker node is generated by using the butane container according to the IP address of the worker node, and the new ignition file is injected into the image file ISO of the boot node using the core-installer command to generate a new image file ISO. The cloud platform uses the new image file ISO to create a virtual machine of the worker node. Control the startup of the virtual machine of the worker node so that the virtual machine of the worker node automatically installs the operating system after startup, automatically sets the network information according to the configuration items in the new ignition file, and automatically deploys the worker node.

[0010] Optionally, after automatically creating and configuring the bastion host, OpenShift boot node, master node and worker node according to the configuration information through the cloud platform, it also includes reading the configuration information of the bastion host, OpenShift boot node, master node and worker node to confirm whether the bastion host, OpenShift boot node, master node and worker node are created successfully.

[0011] Optionally, the cloud platform is an openstack cloud platform.

[0012] In addition, the present invention also provides a system for deploying an OpenShift cluster based on a cloud platform, comprising a microprocessor and a memory connected to each other, wherein the microprocessor is programmed or configured to execute the method for deploying an OpenShift cluster based on a cloud platform.

[0013] In addition, the present invention also provides a computer-readable storage medium, in which a computer program or instruction is stored. The computer program or instruction is programmed or configured to execute the method of deploying an OpenShift cluster based on a cloud platform through a processor.

[0014] In addition, the present invention also provides a computer program product, including a computer program or instructions, which are programmed or configured to execute the method of deploying an OpenShift cluster based on a cloud platform through a processor.

[0015] Compared with the prior art, the present invention mainly has the following advantages: the method for deploying an OpenShift cluster based on a cloud platform of the present invention comprises the following steps: obtaining, through the cloud platform, the configuration information necessary for configuring a bastion host, an OpenShift boot node, a master node, and a worker node, which is submitted by a user on a custom page of a cloud platform source console; automatically creating a virtual machine and configuring the bastion host, an OpenShift boot node, a master node, and a worker node according to the configuration information necessary for configuring the bastion host, an OpenShift boot node, a master node, and a worker node, so as to complete the automatic configuration of the OpenShift cluster. The present invention can realize the automatic deployment of the OpenShift cluster, improve the efficiency of the OpenShift cluster deployment, and reduce the difficulty of the OpenShift cluster deployment. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 Schematic diagram of the basic flow of the method of the embodiment of the present invention.

[0017] Figure 2 The figure is a flowchart of creating and configuring a bastion host in an embodiment of the present invention.

[0018] Figure 3 A schematic diagram of a process for creating and configuring an OpenShift boot node in an embodiment of the present invention.

[0019] Figure 4 The figure is a flow chart of creating and configuring a master node master in an embodiment of the present invention.

[0020] Figure 5 The figure is a flow chart of creating and configuring a worker node in an embodiment of the present invention. DETAILED DESCRIPTION

[0021] The following will take the open source version of the OpenShift cluster deployed on the openstack cloud platform as an example to further explain in detail the method and system for deploying the OpenShift cluster based on the cloud platform of the present invention. It should be noted that the method and system for deploying the OpenShift cluster based on the cloud platform of the present invention do not depend on the openstack cloud platform, and other cloud platforms can also be used as needed. The OpenShift cluster mentioned below refers to the open source version of the OpenShift cluster.

[0022] like Figure 1 As shown, the method for deploying an OpenShift cluster based on a cloud platform in this embodiment includes the following steps: S1, obtains the configuration information required for configuring the bastion host, OpenShift boot node, master node, and worker node submitted by the user on the cloud platform page through the cloud platform; S2, through the cloud platform according to the configuration information automatically create and configure the bastion host, OpenShift boot node, master node and worker node worker, to complete the automatic configuration of the OpenShift cluster.

[0023] In step S1, the cloud platform page refers to a web page provided by the cloud platform, which has a form for configuring the configuration information required for the bastion host, OpenShift boot node, master node and worker node, and can transfer the information submitted by the form to the cloud platform for automatic creation and configuration of the bastion host, OpenShift boot node, master node and worker node according to the configuration information through the cloud platform to complete the automatic configuration of the OpenShift cluster.

[0024] In this embodiment, the configuration information required to configure the bastion host includes the cluster domain name customized by the OpenShift cluster and the IP address of the bastion host; Figure 2 As shown in the figure, the cloud platform automatically creates and configures the bastion host based on the configuration information, including: S101, creating a bastion host through the cloud platform according to the user's customized cluster domain name of the OpenShift cluster filled in on the cloud platform page, and the IP address of the bastion host, combined with the default virtual machine template for creating a bastion host. The virtual machine template has built-in haproxy load balancer, dns server, http server and private image warehouse, and the private image warehouse contains the container image required by OpenShift; S102, after successfully creating the bastion host, the cloud platform uses the libvirt feature to update the IP information to the configuration of each server in the bastion host, and the servers include the haproxy load balancer, dns server, http server and private image repository; after the bastion host is powered on, the system of the bastion host calls the script by default to run each server to enable it to provide services to the outside.

[0025] like Figure 3 As shown, the configuration information required to configure the OpenShift boot node in this embodiment includes the version of the OpenShift cluster and the IP address of the OpenShift boot node. Automatically creating and configuring the OpenShift boot node according to the configuration information by the cloud platform includes: S201, requesting the ignition file corresponding to the version of the OpenShift cluster from the http server in the bastion host through the backend server of the cloud platform; S202, after requesting the ignition file, using the butane container to generate a new ignition file containing the configuration item of the IP address of the OpenShift boot node according to the IP address of the OpenShift boot node, and injecting the new ignition file into the image file ISO of the boot node using the core-installer command to generate a new image file ISO, and the cloud platform uses the new image file ISO to create a virtual machine of the OpenShift boot node; S203, controlling the virtual machine of the OpenShift boot node to start up, so that the virtual machine of the OpenShift boot node automatically installs the operating system after starting up, automatically sets the network information according to the configuration items in the new ignition file, and automatically deploys the OpenShift boot node.

[0026] Similar to creating and configuring an OpenShift boot node, Figure 4 As shown, the configuration information required to configure the master node master in this embodiment includes the version of the OpenShift cluster and the IP address and number of nodes of the master node master. The cloud platform automatically creates and configures a single master node master according to the configuration information, including: S301, requesting the ignition file corresponding to the version of the OpenShift cluster from the http server in the bastion host through the backend server of the cloud platform; S302, after requesting the ignition file, a new ignition file containing the configuration items of the IP address of the master node is generated by using the butane container according to the IP address of the master node, and the new ignition file is injected into the image file ISO of the boot node using the core-installer command to generate a new image file ISO, and the cloud platform uses the new image file ISO to create a virtual machine of the master node; S303, controlling the virtual machine of the master node to start up, so that the virtual machine of the master node automatically installs the operating system after starting up, automatically sets the network information according to the configuration items in the new ignition file, and automatically deploys the master node.

[0027] Similar to creating and configuring an OpenShift boot node, Figure 5 As shown, the configuration information required to configure the worker node in this embodiment includes the version of the OpenShift cluster and the IP address and number of nodes of the worker node. The cloud platform automatically creates and configures a single worker node according to the configuration information, including: S401, requesting the ignition file corresponding to the version of the OpenShift cluster from the http server in the bastion host through the backend server of the cloud platform; S402, after requesting the ignition file, a new ignition file including the configuration item of the IP address of the working node worker is generated by using the butane container according to the IP address of the working node worker, and the new ignition file is injected into the image file ISO of the boot node using the core-installer command to generate a new image file ISO, and the cloud platform uses the new image file ISO to create a virtual machine of the working node worker; S403, controlling the startup of the virtual machine of the worker node, so that the virtual machine of the worker node automatically installs the operating system after startup, automatically sets the network information according to the configuration items in the new ignition file, and automatically deploys the worker node.

[0028] In order to improve the reliability of the method of this embodiment, as an optional implementation method, after the bastion host, OpenShift boot node, master node and worker node are automatically created and configured according to the configuration information by the cloud platform in step S2 of this embodiment, it also includes reading the configuration information of the bastion host, OpenShift boot node, master node and worker node to confirm whether the bastion host, OpenShift boot node, master node and worker node are created successfully. If the creation is unsuccessful, the node that failed to be created can be recreated.

[0029] In summary, the core idea of ​​the method for deploying an OpenShift cluster based on a cloud platform in this embodiment is that the user submits the configuration information required for configuring the bastion host, OpenShift boot node, master node, and worker node on the custom page of the cloud platform source console, and the cloud platform automatically creates a virtual machine. After the virtual machine is created, the configuration of each OpenShift node is read, and then the OpenShift cluster is automatically deployed. The user can choose the installation version of OpenShift, as well as the number of master nodes and worker nodes. The method in this embodiment can realize the automatic deployment of the OpenShift cluster, improve the efficiency of the OpenShift cluster deployment, and reduce the difficulty of the OpenShift cluster deployment.

[0030] In addition, this embodiment also provides a system for deploying an OpenShift cluster based on a cloud platform, including a microprocessor and a memory connected to each other, and the microprocessor is programmed or configured to execute the method for deploying an OpenShift cluster based on a cloud platform.

[0031] In addition, this embodiment also provides a computer-readable storage medium, in which a computer program or instruction is stored. The computer program or instruction is programmed or configured to execute the method of deploying an OpenShift cluster based on a cloud platform through a processor.

[0032] In addition, this embodiment also provides a computer program product, including a computer program or instructions, which are programmed or configured to execute the method of deploying an OpenShift cluster based on a cloud platform through a processor.

[0033] Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the process Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0034] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A method for deploying an OpenShift cluster based on a cloud platform, characterized in that: The steps include: Obtain the configuration information required for configuring the bastion host, OpenShift boot node, master node, and worker node submitted by the user on the cloud platform page through the cloud platform; The cloud platform automatically creates and configures the bastion host, OpenShift boot node, master node, and worker node according to the configuration information to complete the automatic configuration of the OpenShift cluster.

2. The method for deploying an OpenShift cluster based on a cloud platform according to claim 1, characterized in that: The configuration information required to configure the bastion host includes the cluster domain name customized by the OpenShift cluster and the IP address of the bastion host; the automatic creation and configuration of the bastion host according to the configuration information by the cloud platform includes: The cloud platform creates a bastion host based on the user-defined cluster domain name of the OpenShift cluster and the IP address of the bastion host filled in on the cloud platform page, combined with the default virtual machine template for creating a bastion host. The virtual machine template has built-in HAProxy load balancer, DNS server, HTTP server and private image warehouse, and the private image warehouse contains the container images required by OpenShift. After successfully creating the bastion host, the cloud platform uses the libvirt feature to update the IP information to the configuration of each server in the bastion host, including the haproxy load balancer, dns server, http server and private image repository; after the bastion host is started, the system of the bastion host calls the script by default to run each server to enable it to provide services to the outside.

3. The method for deploying an OpenShift cluster based on a cloud platform according to claim 1, characterized in that: The configuration information required to configure the OpenShift boot node includes the version of the OpenShift cluster and the IP address of the OpenShift boot node. The cloud platform automatically creates and configures the OpenShift boot node based on the configuration information, including: Request the ignition file corresponding to the version of the OpenShift cluster from the http server in the bastion host through the backend server of the cloud platform; After requesting the ignition file, a new ignition file containing the configuration items of the IP address of the OpenShift boot node is generated using the butane container according to the IP address of the OpenShift boot node, and the new ignition file is injected into the image file ISO of the boot node using the core-installer command to generate a new image file ISO. The cloud platform uses the new image file ISO to create a virtual machine of the OpenShift boot node. Control the startup of the virtual machine of the OpenShift boot node so that the virtual machine of the OpenShift boot node automatically installs the operating system after startup, automatically sets the network information according to the configuration items in the new ignition file, and automatically deploys the OpenShift boot node.

4. The method for deploying an OpenShift cluster based on a cloud platform according to claim 1, characterized in that: The configuration information required to configure the master node includes the version of the OpenShift cluster and the IP address and number of nodes of the master node. The cloud platform automatically creates and configures a single master node based on the configuration information, including: Request the ignition file corresponding to the version of the OpenShift cluster from the http server in the bastion host through the backend server of the cloud platform; After requesting the ignition file, a new ignition file containing the configuration items of the IP address of the master node is generated by using the butane container according to the IP address of the master node, and the new ignition file is injected into the image file ISO of the boot node using the core-installer command to generate a new image file ISO. The cloud platform uses the new image file ISO to create a virtual machine of the master node; Control the startup of the virtual machine of the master node so that the virtual machine of the master node automatically installs the operating system after startup, automatically sets the network information according to the configuration items in the new ignition file, and automatically deploys the master node.

5. The method for deploying an OpenShift cluster based on a cloud platform according to claim 1, characterized in that: The configuration information required to configure the worker node includes the version of the OpenShift cluster and the IP address and number of the worker node. The cloud platform automatically creates and configures a single worker node based on the configuration information, including: Request the ignition file corresponding to the version of the OpenShift cluster from the http server in the bastion host through the backend server of the cloud platform; After requesting the ignition file, a new ignition file containing the configuration items of the IP address of the worker node is generated by using the butane container according to the IP address of the worker node, and the new ignition file is injected into the image file ISO of the boot node using the core-installer command to generate a new image file ISO. The cloud platform uses the new image file ISO to create a virtual machine of the worker node. Control the startup of the virtual machine of the worker node so that the virtual machine of the worker node automatically installs the operating system after startup, automatically sets the network information according to the configuration items in the new ignition file, and automatically deploys the worker node.

6. The method for deploying an OpenShift cluster based on a cloud platform according to claim 1, characterized in that: After automatically creating and configuring the bastion host, OpenShift boot node, master node and worker node according to the configuration information through the cloud platform, it also includes reading the configuration information of the bastion host, OpenShift boot node, master node and worker node to confirm whether the bastion host, OpenShift boot node, master node and worker node are created successfully.

7. The method for deploying an OpenShift cluster based on a cloud platform according to claim 1, characterized in that: The cloud platform is an openstack cloud platform.

8. A system for deploying an OpenShift cluster based on a cloud platform, comprising a microprocessor and a memory connected to each other, characterized in that: The microprocessor is programmed or configured to execute the method for deploying an OpenShift cluster based on a cloud platform as described in any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program or instruction stored therein, characterized in that: The computer program or instruction is programmed or configured to execute the method for deploying an OpenShift cluster based on a cloud platform as described in any one of claims 1 to 7 through a processor.

10. A computer program product comprising a computer program or instructions, characterized in that The computer program or instruction is programmed or configured to execute the method for deploying an OpenShift cluster based on a cloud platform as described in any one of claims 1 to 7 through a processor.