CN115857955A - Method, device and equipment for offline deployment of K8S cluster and storage medium - Google Patents

Method, device and equipment for offline deployment of K8S cluster and storage medium Download PDF

Info

Publication number
CN115857955A
CN115857955A CN202211475931.8A CN202211475931A CN115857955A CN 115857955 A CN115857955 A CN 115857955A CN 202211475931 A CN202211475931 A CN 202211475931A CN 115857955 A CN115857955 A CN 115857955A
Authority
CN
China
Prior art keywords
cluster
mirror image
offline
deploying
predefined
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211475931.8A
Other languages
Chinese (zh)
Inventor
周婷婷
陶高峰
侯晓晖
秦树鑫
朱静
罗永璨
王丹
邢凯
陈力
孙仕康
黄超
孙羽
夏丹丹
刘杨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Network Communication and Security Zijinshan Laboratory
Original Assignee
Network Communication and Security Zijinshan Laboratory
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Network Communication and Security Zijinshan Laboratory filed Critical Network Communication and Security Zijinshan Laboratory
Priority to CN202211475931.8A priority Critical patent/CN115857955A/en
Publication of CN115857955A publication Critical patent/CN115857955A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method, a device, equipment and a readable storage medium for deploying a K8S cluster, which are applied to the technical field of computers and comprise the steps of obtaining offline installation script information; the offline installation script information comprises a deployment installation package and a cluster compression package mirror image; establishing Openstack resources according to the Terraform and predefined configuration information to obtain a returned resource configuration file; and acquiring a predefined mirror image warehouse project, and deploying the K8S cluster according to the offline installation script information, the resource configuration file and the predefined mirror image warehouse project. The invention generates a resource configuration file by using terraform of Kubespray. The method is fused with the cluster compression package mirror image, the advantage that the Kubespray can generate the cluster in an off-line mode is combined with the advantage that the cluster compression package mirror image can install the K8S cluster quickly, and one-click deployment of the K8S cluster can be achieved as long as predefined configuration information is input.

Description

Method, device and equipment for offline deployment of K8S cluster and storage medium
Technical Field
The invention relates to the technical field of computers, in particular to a method, a device, equipment and a storage medium for deploying a K8S cluster offline.
Background
In the prior art, the kubernets (K8S) cluster is generally deployed manually, for example, the K8S cluster is deployed based on a Breeze open source tool (kubernets graphical deployment tool), an installer runs the tool in a Breeze-installed machine through a graphical operation interface, and performs related operations in sequence according to official document steps in a browser. When an installer interacts with a machine with Breeze through a graphical operation interface, operation leakage or misoperation can occur, and therefore the deployment efficiency of the Kubernetes cluster is low.
Disclosure of Invention
In view of this, the present invention provides a method, an apparatus, a device, and a storage medium for offline deployment of a K8S cluster, which solve the technical problem of low efficiency in deploying K8S in the prior art.
In order to solve the technical problem, the invention provides a method for deploying a K8S cluster offline, which comprises the following steps:
acquiring offline installation script information; the offline installation script information comprises a deployment installation package and a cluster compression package mirror image;
establishing Openstack resources according to the Terraform and predefined configuration information to obtain a returned resource configuration file;
and acquiring a predefined mirror image warehouse project, and deploying the K8S cluster according to the offline installation script information, the resource configuration file and the predefined mirror image warehouse project.
Optionally, before the obtaining the predefined mirrored warehouse item, the method further includes:
generating a system configuration file by using a system configuration template according to the cluster compression package mirror image;
generating a mirror image warehouse according to the deployment installation package and the system configuration file;
generating a mirror image warehouse file by using a mirror image warehouse template;
creating the predefined mirror repository item from the mirror repository and the mirror repository file.
Optionally, after the Openstack resource is created according to the terraflorm and the predefined configuration information and a returned resource configuration file is obtained, the method further includes:
and sending the resource configuration file, the deployment installation package and the cluster compression package mirror image to a board jump machine so as to execute the action of deploying the K8S cluster.
Optionally, after the obtaining the predefined mirror image warehouse item and deploying the K8S cluster according to the offline installation script information, the resource configuration file, and the predefined mirror image warehouse item, the method further includes:
and calling an automatic operation and maintenance tool to obtain a configuration file corresponding to the K8S cluster.
Optionally, the method for deploying the K8S cluster offline further includes:
and displaying the real-time log generated in the K8S cluster deploying process through remote process call.
Optionally, the method for deploying the K8S cluster offline further includes:
and monitoring the deployment progress of the K8S cluster, and returning prompt information of successful deployment.
The invention also provides a device for deploying the K8S cluster offline, which comprises the following components:
the offline installation script information acquisition module is used for acquiring offline installation script information; the offline installation script information comprises a deployment installation package and a cluster compression package mirror image;
the resource configuration file acquisition module is used for creating Openstack resources according to the Terraform and predefined configuration information to obtain a returned resource configuration file;
and the K8S cluster deployment module is used for acquiring a predefined mirror image warehouse project and deploying the K8S cluster according to the offline installation script information, the resource configuration file and the predefined mirror image warehouse project.
Optionally, the apparatus for deploying the K8S cluster offline further includes:
the system configuration file generation module is used for generating a system configuration file by utilizing a system configuration template according to the cluster compressed package mirror image;
the mirror image warehouse generating module is used for generating a mirror image warehouse according to the deployment installation package and the system configuration file;
the mirror image warehouse file generation module is used for generating a mirror image warehouse file by using a mirror image warehouse template;
and the predefined mirror image warehouse item creating module is used for creating the predefined mirror image warehouse item according to the mirror image warehouse and the mirror image warehouse file.
The invention also provides a device for deploying the K8S cluster offline, which comprises the following components:
a memory for storing a computer program;
and the processor is used for executing the computer program to realize the steps of the method for deploying the K8S cluster offline.
The present invention also provides a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the above-mentioned method for deploying a K8S cluster offline.
Therefore, the invention obtains the offline installation script information; the offline installation script information comprises a deployment installation package and a cluster compression package mirror image; establishing Openstack resources according to the Terraform and predefined configuration information to obtain a returned resource configuration file; and acquiring a predefined mirror image warehouse project, and deploying the K8S cluster according to the offline installation script information, the resource configuration file and the predefined mirror image warehouse project. The invention generates a resource configuration file with terraform of Kubespray. The method is fused with the cluster compression package mirror image, so that the advantage that the Kubespray can generate the cluster in an off-line mode is combined with the advantage that the cluster compression package mirror image can rapidly install the K8S cluster, and the K8S cluster can be deployed as long as predefined configuration information is input. Compared with the prior art that the K8S cluster needs to be deployed manually in a step-by-step mode according to the installation files, the method for deploying the K8S cluster offline can call offline installation script information to achieve one-click deployment of the K8S cluster, namely, installer only needs to input predefined configuration information to achieve one-click deployment of the K8S cluster, and deployment efficiency of the K8S cluster is greatly improved.
In addition, the invention also provides a device, equipment and a readable storage medium for deploying the K8S cluster offline, and the beneficial effects are also achieved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for deploying a K8S cluster offline according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a method for deploying a K8S cluster offline according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an apparatus for deploying a K8S cluster offline according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an apparatus for deploying a K8S cluster offline according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart of a method for deploying a K8S cluster offline according to an embodiment of the present invention. The method can comprise the following steps:
s100, acquiring offline installation script information; the offline installation script information comprises a deployment installation package and a cluster compression package mirror image.
The execution subject of this embodiment is a terminal. The present embodiment is not limited to the type of the terminal, and may be any terminal as long as it can complete the operation of resuming the file transmission after the file is powered off in the present embodiment, and for example, the terminal may be a general-purpose terminal or a dedicated terminal. The offline script information in this embodiment includes a deployment installation package (binary installation package generated by kubbekey) and a cluster compression package mirror (tar package mirror packaged by kubbesphere source cluster). The deployment installation package Kubekey in this embodiment provides a method for quickly and efficiently installing a Kubesphere (container management platform) cluster.
S101, establishing Openstack resources according to the Terraform and predefined configuration information, and obtaining a returned resource configuration file.
In the embodiment, through a terrafrorm (terrraform is an orchestration tool for safely and effectively constructing, changing and versioning infrastructure automation) related file in a kubestrack (kubestrack is an open source project of a kubernets server cluster at a deployment production level of Google open source, and integrates an ibse as a deployment tool), an Openstack (Openstack provides an operation platform or a tool set of a deployment cloud) resource is created according to predefined configuration information, and after the Openstack resource is created, the resource configuration file is returned. The OpenStack in this embodiment is an open-source cloud computing management platform project, and is a combination of a series of software open-source projects, and the OpenStack can provide scalable and flexible cloud computing services for private clouds and public clouds. The project aims to provide a cloud computing management platform which is simple to implement, can be expanded in a large scale, is rich and has a unified standard. OpenStack is a cloud platform managed item, which is not software. The project is combined by several main components to complete specific work, and the OpenStack is an open source project aiming at providing software for the construction and management of public and private clouds. The embodiment does not limit the specific content of the predefined configuration information, as long as the configuration information defined by the user is acquired. For example, the configuration information may include an IP Address (Internet Protocol Address), a route name, private repository, authentication information, and the like; or the configuration information may include a pod (pod is the smallest unit of deployment in a k8s system), authentication information, mirroring information, private warehouse, and the like. This embodiment does not limit the specific name of the resource profile. For example, the name of the resource configuration file (tfstate file) is nginx-deployment. Yaml; or the name of the resource profile is nginx-service.
S102, acquiring a predefined mirror image warehouse project, and deploying the K8S cluster according to the offline installation script information, the resource configuration file and the predefined mirror image warehouse project.
The embodiment does not limit the specific forming manner of the predefined mirror image warehouse items, and the predefined mirror image warehouse items generated according to the mirror image warehouse template can be used. For example, predefined mirror warehouse items may be generated from mirror warehouse templates in a Docker Hub (Docker Hub is used for source code management integration, as well as for building and testing tools to accelerate deployment cycles, which decrease from days to minutes); alternatively, predefined mirror warehouse items may be generated from mirror warehouse templates in Github (GitHub is an open source and proprietary software project oriented hosting platform, since only Git is supported for hosting as the only version library format).
Further, in order to obtain the predefined mirror image warehouse item quickly, before the obtaining the predefined mirror image warehouse item, the method may further include:
generating a system configuration file by using a system configuration template according to the cluster compression package mirror image;
generating a mirror image warehouse according to the deployment installation package and the system configuration file;
generating a mirror image warehouse file by using a mirror image warehouse template;
creating the predefined mirror repository item from a mirror repository and a mirror repository file.
This embodiment generates a system configuration file (config-sample. Yaml file) using a system configuration template (config-sample. Yaml. J2 template) according to a cluster compressed package image (kubsphere. Tar. Gz); generating a mirror image warehouse according to a deployment installation package (binary installation package generated by kubekey) and a system configuration file; generating a mirror image warehouse file by using a mirror image warehouse template; the predefined mirror repository item is created from the mirror repository and the mirror repository file (create _ project _ harbor. According to the embodiment, the predefined mirror image warehouse item can be directly generated by using the cluster compression package mirror image, the system configuration template and the deployment installation package, and a user does not need to obtain the predefined mirror image warehouse item according to an operation manual.
Further, in order to deploy the K8S cluster according to the resource configuration file, the deployment installation package, and the cluster compression package image, after the Openstack resource is created according to the terrafrorm and the predefined configuration information and the returned resource configuration file is obtained, the method may further include:
and sending the resource configuration file, the deployment installation package and the cluster compression package mirror image to a board jump machine so as to execute the action of deploying the K8S cluster.
The embodiment copies the resource configuration file, deploys the installation package, and mirrors the cluster compression package to the springboard to perform the action of deploying the K8S cluster. The embodiment does not limit the specific kind and installation position of the trigger. For example, the springboard may be puppet (puppet is a centralized configuration management system under Linux/Unix platform, using its own puppet description language); or the jumper can also be a SaltStack (the SaltStack is a centralized management platform of a server infrastructure and has the functions of configuration management, remote execution, monitoring and the like); or the gangboard machine can also be an as-ible (the as-ible is an automatic platform for opening sources and is a configuration management tool); or the springboard machine can be a bag ion (a container used for management by the bag ion). This embodiment does not limit the specific mounting location of the trigger. The springboard machine can be arranged at the terminal or at the other terminal.
Further, in order to configure relevant parameters of the K8S cluster, after obtaining the predefined mirror image warehouse item and deploying the K8S cluster according to the offline installation script information, the resource configuration file, and the predefined mirror image warehouse item, the method may further include:
and calling an automatic operation and maintenance tool to obtain a configuration file corresponding to the K8S cluster.
The embodiment does not limit the specific type of the automation operation and maintenance tool, as long as the configuration file corresponding to the K8S cluster can be obtained and the parameters can be modified. For example, the automated operation and maintenance tool may be Puppet (Puppet is a centralized configuration management system under Linux/Unix platform); or the automation operation and maintenance tool can also be Saltstack (SaltStack is an automation tool for infrastructure management); or the automation operation and maintenance tool can also be an enterprise (the enterprise is an opening automation platform, a configuration management tool and an automation operation and maintenance tool). After the deployment of the K8S cluster is completed, when the related configuration information needs to be acquired and modified, an automated operation and maintenance tool may be used for processing.
Further, in order to obtain log information generated by deploying the K8S cluster in real time, the method for deploying the K8S cluster offline may further include:
and displaying the real-time log generated in the K8S cluster deploying process through remote process call.
This embodiment does not limit the specific remote procedure call framework that makes the remote procedure call. For example, the remote procedure call framework may be an RPC (remote procedure call); or the remote procedure call framework can also be a Dubbo remote call service framework; or the remote procedure call framework may also be a gRPC (high performance remote procedure call framework). The embodiment calls a remote procedure call framework to display the real-time logs generated in the K8S cluster deploying process so as to obtain the real-time logs generated in the K8S cluster deploying process in real time and discover problems occurring in the K8S cluster deploying process in real time.
Further, in order to obtain the deployment progress of the K8S cluster in time, the method for deploying the K8S cluster offline may further include:
and monitoring the deployment progress of the K8S cluster, and returning prompt information of successful deployment.
The embodiment does not limit the specific main body for monitoring the K8S cluster, as long as the main body can be located inside the device for deploying the K8S cluster offline, and is used as a part of the device for deploying the K8S cluster offline. For example, the main body for monitoring the deployment progress of the K8S cluster may be Prometheus (an open source system monitoring and alarm system); or the main body for monitoring the deployment progress of the K8S cluster may also be a cluster manager, for example, the cluster manager may be a Spark (independent cluster manager (standard), a simple Spark cluster manager, which is easy to establish a cluster and is based on a Master-Worker cluster of the Spark itself); or, the cluster manager may also be a Hadoop YARN (Spark may be integrated with Hadoop, and resource scheduling is performed by using YARN). In the embodiment, the cluster manager is used for monitoring the deployment progress of the K8S cluster and returning the prompt information of successful deployment, so that the prompt information of successful deployment can be timely returned after the deployment is finished, and the smooth execution of the subsequent operation is ensured.
By applying the method for deploying the K8S cluster offline provided by the embodiment of the invention, offline installation script information is obtained; the offline installation script information comprises a deployment installation package and a cluster compression package mirror image; establishing Openstack resources according to the Terraform and predefined configuration information to obtain a returned resource configuration file; and acquiring a predefined mirror image warehouse project, and deploying the K8S cluster according to the offline installation script information, the resource configuration file and the predefined mirror image warehouse project. Embodiments of the present invention use terraform in Kubespray to generate resource profiles. The method is fused with the cluster compression package mirror image, so that the advantage that the Kubespray can generate the cluster in an off-line mode is combined with the advantage that the cluster compression package mirror image can rapidly install the K8S cluster, and the K8S cluster can be deployed as long as predefined configuration information is input. Compared with the prior art that the K8S cluster needs to be deployed manually in a step-by-step mode according to the installation files, the method for deploying the K8S cluster offline can call offline installation script information to achieve one-click deployment of the K8S cluster, namely, installer only needs to input predefined configuration information to achieve one-click deployment of the K8S cluster, and deployment efficiency of the K8S cluster is greatly improved. In addition, the embodiment of the invention can call an automatic operation and maintenance tool, so that the configuration file corresponding to the K8S cluster can be obtained in time, and the parameters can be modified; in addition, the embodiment of the invention can call a remote procedure call frame to display the real-time log generated in the K8S cluster deploying process, thereby realizing log display service and tracing the problem according to the log; in addition, the embodiment of the invention can utilize the cluster manager to monitor the deployment progress of the K8S cluster and return prompt information of successful deployment, so that the information of successful deployment of the K8S cluster can be quickly obtained, and the follow-up work can be quickly carried out.
In order to make the present invention more easily understood, please refer to fig. 2 specifically, where fig. 2 is a flowchart illustrating a method for deploying a K8S cluster offline according to an embodiment of the present invention, specifically, the method may include: acquiring kubsphere.tar.gz (a cluster compression package mirror image) and kk (a deployment installation package); establishing Openstack resources according to the Terraform and the predefined configuration information to obtain a returned tfstat file (resource configuration file); save tfstat file, kubsphere.tar.gz and kk, and connect to base (springboard machine); calling kubes sphere. Tar. Gz and config-sample. Yaml. J2 template (system configuration template) to generate a config-sample. Yaml file (system configuration file); generating a mirror image warehouse according to the kk and the config-sample. Calling the create _ project _ harbor.sh.2 template (mirror warehouse template) to generate a create _ project _ harbor.sh file (mirror warehouse file); sh file and mirror image warehouse to generate predefined mirror image warehouse item; deploying the K8S cluster according to the tfsite file, the predefined mirror image warehouse item, kubes sphere, tar, gz and kk one-key type; a terminal that outputs a kubecect command (command line tool) and a K8S login URL (Uniform Resource Locator).
In the following, the device for deploying a K8S cluster offline provided by the embodiment of the present invention is introduced, and the device for deploying a K8S cluster offline described below and the method for deploying a K8S cluster offline described above may be referred to correspondingly.
Referring to fig. 3 specifically, fig. 3 is a schematic structural diagram of an apparatus for offline deploying a K8S cluster according to an embodiment of the present invention, where the apparatus may include:
an offline installation script information obtaining module 100, configured to obtain offline installation script information; the offline installation script information comprises a deployment installation package and a cluster compression package mirror image;
a resource configuration file obtaining module 200, configured to create an Openstack resource according to the terrafrorm and predefined configuration information, and obtain a returned resource configuration file;
and the K8S cluster deployment module 300 is configured to acquire a predefined mirror image warehouse project and deploy the K8S cluster according to the offline installation script information, the resource configuration file and the predefined mirror image warehouse project.
Further, based on the foregoing embodiment, the apparatus for deploying a K8S cluster offline may further include:
the system configuration file generation module is used for generating a system configuration file by utilizing a system configuration template according to the cluster compressed packet mirror image;
the mirror image warehouse generating module is used for generating a mirror image warehouse according to the deployment installation package and the system configuration file;
the mirror image warehouse file generation module is used for generating a mirror image warehouse file by using the mirror image warehouse template;
and the predefined mirror image warehouse item creating module is used for creating the predefined mirror image warehouse item according to the mirror image warehouse and the mirror image warehouse file.
Further, based on any of the above embodiments, the apparatus for deploying a K8S cluster offline may further include:
and the copying module is used for sending the resource configuration file, the deployment installation package and the cluster compression package mirror image to a board jump machine so as to execute the action of deploying the K8S cluster.
Further, based on any of the above embodiments, the apparatus for deploying a K8S cluster offline may further include:
and the automatic operation and maintenance tool calling module is used for calling the automatic operation and maintenance tool and acquiring the configuration file corresponding to the K8S cluster.
Further, based on any of the above embodiments, the apparatus for deploying a K8S cluster offline may further include:
and the real-time log display module is used for displaying the real-time log generated in the K8S cluster deployment process through remote process call.
Further, based on any of the above embodiments, the apparatus for deploying a K8S cluster offline may further include:
and the cluster manager calling module is used for monitoring the deployment progress of the K8S cluster and returning prompt information of successful deployment.
It should be noted that, the order of the modules in the apparatus for deploying the K8S cluster offline may be changed before and after without affecting logic.
The device for deploying the K8S cluster offline provided by the embodiment of the invention comprises the following components: an offline installation script information obtaining module 100, configured to obtain offline installation script information; the offline installation script information comprises a deployment installation package and a cluster compression package mirror image; a resource configuration file obtaining module 200, configured to create an Openstack resource according to the terrafrorm and predefined configuration information, and obtain a returned resource configuration file; and the K8S cluster deployment module 300 is configured to acquire a predefined mirror image warehouse project and deploy the K8S cluster according to the offline installation script information, the resource configuration file and the predefined mirror image warehouse project.
The device for deploying the K8S cluster offline provided by the embodiment of the invention can use terraform in Kubespray to generate a resource configuration file. The method is fused with the cluster compression package mirror image, so that the advantage that the Kubespray can generate the cluster in an off-line mode is combined with the advantage that the cluster compression package mirror image can rapidly install the K8S cluster, and the K8S cluster can be deployed as long as predefined configuration information is input. Compared with the prior art that the K8S cluster needs to be deployed manually in a step-by-step mode according to the installation files, the device for deploying the K8S cluster offline provided by the invention can call offline installation script information to achieve one-click deployment of the K8S cluster, namely, an installer only needs to input predefined configuration information to achieve one-click deployment of the K8S cluster, and deployment efficiency of the K8S cluster is greatly improved. In addition, the embodiment of the invention can call an automatic operation and maintenance tool, so that the configuration file corresponding to the K8S cluster can be obtained in time, and the parameters can be modified; in addition, the embodiment of the invention can call a remote procedure call frame to display the real-time log generated in the K8S cluster deploying process, thereby realizing log display service and tracing the problem according to the log; in addition, the embodiment of the invention can utilize the cluster manager to monitor the deployment progress of the K8S cluster and return prompt information of successful deployment, so that the information of successful deployment of the K8S cluster can be quickly obtained, and the follow-up work can be quickly carried out.
In the following, the device for deploying the K8S cluster offline provided by the embodiment of the present invention is introduced, and the device for deploying the K8S cluster offline described below and the method for deploying the K8S cluster offline described above may be referred to correspondingly.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an apparatus for offline deploying a K8S cluster according to an embodiment of the present invention, where the apparatus may include:
a memory 10 for storing a computer program;
a processor 20 configured to execute a computer program to implement the steps of the method for deploying the K8S cluster offline described above.
The memory 10, the processor 20 and the communication interface 31 all communicate with each other via a communication bus 32.
In the embodiment of the present invention, the memory 10 is used for storing one or more programs, the program may include program codes, the program codes include computer operation instructions, and in the embodiment of the present application, the memory 10 may store a program for implementing the following functions:
acquiring offline installation script information; the offline installation script information comprises a deployment installation package and a cluster compression package mirror image;
establishing Openstack resources according to the Terraform and the predefined configuration information to obtain a returned resource configuration file;
and acquiring a predefined mirror image warehouse project, and deploying the K8S cluster according to the offline installation script information, the resource configuration file and the predefined mirror image warehouse project.
In one possible implementation, the memory 10 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created during use.
Further, memory 10 may include both read-only memory and random access memory and provide instructions and data to the processor. The portion of memory may also include NVRAM. The memory stores an operating system and operating instructions, executable modules or data structures, or a subset or an expanded set thereof, where the operating instructions can include various operating instructions for performing various operations. The operating system may include various system programs for performing various basic tasks and for handling hardware-based tasks.
The processor 20 may be a Central Processing Unit (CPU), an application specific integrated circuit, a digital signal processor, a field programmable gate array, or other programmable logic device, and the processor 20 may be a microprocessor or any conventional processor. Processor 20 may call a program stored in memory 10.
The communication interface 31 may be an interface of a communication module for connecting with other devices or systems.
Of course, it should be noted that the structure shown in fig. 4 does not constitute a limitation on the device for deploying the K8S cluster offline in the embodiment of the present application, and in practical applications, the device for deploying the K8S cluster offline may include more or less components than those shown in fig. 4, or may combine some components.
The following describes a computer-readable storage medium provided by an embodiment of the present invention, and the readable storage medium described below and the method for deploying the K8S cluster offline described above may be referred to correspondingly.
The invention further provides a readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the above method for deploying the K8S cluster offline.
The readable storage medium may include: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
Finally, it should also be noted that, herein, relationships such as first and second, etc., are intended only to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
The method, the apparatus, the device and the readable storage medium for offline deployment of the K8S cluster provided by the present invention are described in detail above, and a specific example is applied in the present document to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A method for deploying K8S clusters off line is characterized by comprising the following steps:
acquiring offline installation script information; the offline installation script information comprises a deployment installation package and a cluster compression package mirror image;
establishing Openstack resources according to the Terraform and predefined configuration information to obtain a returned resource configuration file;
and acquiring a predefined mirror image warehouse project, and deploying the K8S cluster according to the offline installation script information, the resource configuration file and the predefined mirror image warehouse project.
2. The method for deploying K8S clusters offline as recited in claim 1, further comprising, prior to said obtaining predefined mirrored warehouse items:
generating a system configuration file by using a system configuration template according to the cluster compression package mirror image;
generating a mirror image warehouse according to the deployment installation package and the system configuration file;
generating a mirror image warehouse file by using a mirror image warehouse template;
creating the predefined mirror repository item from the mirror repository and the mirror repository file.
3. The method for deploying a K8S cluster offline as claimed in claim 1, wherein after the creating an Openstack resource according to terraflom and predefined configuration information and obtaining a returned resource configuration file, the method further comprises:
and sending the resource configuration file, the deployment installation package and the cluster compression package mirror image to a board jump machine so as to execute the action of deploying the K8S cluster.
4. The method for deploying the K8S cluster offline as recited in any one of claims 1 to 3, wherein after the obtaining the predefined mirror repository item and deploying the K8S cluster according to the offline installation script information, the resource configuration file and the predefined mirror repository item, the method further comprises:
and calling an automatic operation and maintenance tool to obtain a configuration file corresponding to the K8S cluster.
5. The method for deploying K8S clusters offline as recited in claim 1, further comprising:
and displaying the real-time log generated in the K8S cluster deploying process through remote process call.
6. The method for deploying K8S clusters offline as recited in claim 1, further comprising:
and monitoring the deployment progress of the K8S cluster, and returning prompt information of successful deployment.
7. An apparatus for deploying a K8S cluster offline, comprising:
the offline installation script information acquisition module is used for acquiring offline installation script information; the offline installation script information comprises a deployment installation package and a cluster compression package mirror image;
the resource configuration file acquisition module is used for creating Openstack resources according to the Terraform and predefined configuration information to obtain a returned resource configuration file;
and the K8S cluster deployment module is used for acquiring a predefined mirror image warehouse project and deploying the K8S cluster according to the offline installation script information, the resource configuration file and the predefined mirror image warehouse project.
8. The apparatus for deploying K8S cluster offline as claimed in claim 7, further comprising:
the system configuration file generation module is used for generating a system configuration file by utilizing a system configuration template according to the cluster compressed package mirror image;
the mirror image warehouse generating module is used for generating a mirror image warehouse according to the deployment installation package and the system configuration file;
the mirror image warehouse file generation module is used for generating a mirror image warehouse file by using a mirror image warehouse template;
and the predefined mirror image warehouse item creating module is used for creating the predefined mirror image warehouse item according to the mirror image warehouse and the mirror image warehouse file.
9. An apparatus for deploying a K8S cluster offline, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method of offline deploying a K8S cluster according to any of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored thereon, which, when being executed by a processor, carries out the steps of the method of offline deploying a K8S cluster according to any one of claims 1 to 6.
CN202211475931.8A 2022-11-23 2022-11-23 Method, device and equipment for offline deployment of K8S cluster and storage medium Pending CN115857955A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211475931.8A CN115857955A (en) 2022-11-23 2022-11-23 Method, device and equipment for offline deployment of K8S cluster and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211475931.8A CN115857955A (en) 2022-11-23 2022-11-23 Method, device and equipment for offline deployment of K8S cluster and storage medium

Publications (1)

Publication Number Publication Date
CN115857955A true CN115857955A (en) 2023-03-28

Family

ID=85665471

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211475931.8A Pending CN115857955A (en) 2022-11-23 2022-11-23 Method, device and equipment for offline deployment of K8S cluster and storage medium

Country Status (1)

Country Link
CN (1) CN115857955A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117908904A (en) * 2024-03-19 2024-04-19 麒麟软件有限公司 K8S cluster deployment and operation and maintenance management method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117908904A (en) * 2024-03-19 2024-04-19 麒麟软件有限公司 K8S cluster deployment and operation and maintenance management method and system

Similar Documents

Publication Publication Date Title
US10802906B2 (en) Monitoring method and apparatus of server, and storage medium
CN109976774B (en) Block link point deployment method, device, equipment and storage medium
CN111061491B (en) LXC container technology-based edge computing gateway management system and method
CN111930521A (en) Method and device for deploying application, electronic equipment and readable storage medium
CN105007323A (en) System and method for arranging cloud resources
CN111090423B (en) Webhook framework system and method for realizing active calling and event triggering
CN112925652B (en) Application resource deployment method, device, electronic equipment and medium
CN115292026A (en) Management method, device and equipment of container cluster and computer readable storage medium
CN107911467B (en) Service operation management system and method for scripted operation
CN110990026A (en) Automatic deployment method and system for PaaS platform
CN111611054A (en) Application deployment method and device
CN115857955A (en) Method, device and equipment for offline deployment of K8S cluster and storage medium
CN112328470A (en) Automatic operation and maintenance testing method, device, equipment and storage medium
CN113590595A (en) Database multi-writing method and device and related equipment
CN117112122A (en) Cluster deployment method and device
CN113127009A (en) Automatic deployment method and device for big data management platform
CN110677308A (en) Code automatic deployment method
CN117707702A (en) Method and system for realizing online IDE
CN111897565A (en) Data processing method, device and equipment based on Internet of things
CN115758334A (en) Cloud application access method and device, electronic equipment and storage medium
CN115865718A (en) Service arrangement control method and device based on Yaml template
CN115357258A (en) Application deployment method and device, storage medium and electronic device
CN115509545A (en) IOS application packaging construction method and device
CN113064827A (en) Test platform deployment method, device, equipment and storage medium
CN113708971A (en) Openstack cloud platform deployment method and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination