Method, device and equipment for graphically deploying K8s cluster and storage medium
By building a local mirror warehouse and setting up graphical deployment software in Kubeclipper, the problem of being unable to independently select the K8S version in the existing technology is solved, and the function of selecting the K8S version according to business needs is realized to ensure the stable operation of the cluster and reduce security risks.
Patent Information
- Application Number
- CN202311329699.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-13
- Publication Date
- 2025-04-15
AI Technical Summary
In the prior art, when using Kubeclipper to deploy K8S clusters in graphical form, due to the specified K8S version provided by the application, the version number of K8S cannot be independently selected according to business needs, resulting in the inability to accurately realize business needs and hinder the subsequent working process.
By installing Kubeclipper graphical deployment software on the host, building a local mirror warehouse, calling the image file in the official K8S warehouse based on the K8S version information to be configured, and packaging it to the local mirror warehouse, setting up the graphical deployment software to support configurations of different K8S versions.
It realizes the independent selection of K8S version according to the user's business needs, ensuring that the cluster meets specific needs, avoids incompatible problems with tools, and reduces the occurrence of security vulnerabilities and other problems.
Smart Images

Figure CN119829189A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to communication technology, and in particular to a method, apparatus, device and storage medium for graphically deploying a K8s cluster. Background Art
[0002] Kubernetes, abbreviated as K8s, is an open source containerized application for managing multiple hosts in a cloud platform. The goal of Kubernetes is to make the deployment of containerized applications simple and efficient. Kubernetes provides a mechanism for application deployment, updating, and maintenance.
[0003] Kubeclipper is an open source tool for deploying, managing, and monitoring machine learning models. It is built on Kubernetes and aims to simplify the deployment and operation of machine learning models and achieve one-stop management of multiple K8s clusters across regions and infrastructures.
[0004] In the prior art, when Kubeclipper is used to graphically deploy a K8S cluster, it is limited by the specified K8S version provided by the application, and the K8S version number cannot be independently selected according to business needs, resulting in the inability to accurately meet business needs and hindering subsequent work processes. Summary of the invention
[0005] The present application provides a method, apparatus, device and storage medium for graphically deploying a K8s cluster, so as to solve the problem of being unable to independently select the K8s version according to business needs.
[0006] In a first aspect, the present application provides a method for graphically deploying a K8s cluster, including:
[0007] Install Kubeclipper graphical deployment software on the host;
[0008] For the graphical deployment software, build a local image repository of the host;
[0009] According to the K8s version information to be configured, call the image file corresponding to each K8s version in the official warehouse of the K8s; wherein the K8s version information includes the version number of at least one K8s version and the identifier of the required image file;
[0010] Package the image files corresponding to each K8s version, obtain the packaged files corresponding to each K8s and store them in the local image warehouse;
[0011] According to the local image repository, the graphical deployment software is set so that the graphical deployment software can be configured with different K8s versions.
[0012] Optionally, the graphical deployment software is set according to the local image repository so that the graphical deployment software can be configured with different K8s versions, including:
[0013] According to the package files of different K8s versions stored in the local image repository, a version resource option is added to the graphical deployment software, wherein the version resource option includes an option corresponding to each K8s;
[0014] Establish an association between each option and the package file of the corresponding K8s version in the local image repository.
[0015] Optionally, after the graphical deployment software is set according to the local image repository, the method further includes:
[0016] In response to the user's operation on the graphical deployment software, displaying a deployment interface of the graphical deployment software, wherein the version resource option is displayed in the deployment interface;
[0017] In response to the user's operation on the version resource option, obtaining the K8s version to be configured;
[0018] According to the association relationship, the package file corresponding to the K8s version to be configured is obtained, and the K8s cluster is deployed based on the obtained package file.
[0019] Optionally, the image files corresponding to each K8s version are packaged to obtain the packaged files corresponding to each K8s, including:
[0020] For each K8s version, the image file of the K8s version is packaged to obtain an image package;
[0021] Packaging the configuration files of the K8s version to obtain configuration packaging;
[0022] According to the image packaging and the configuration packaging, a corresponding packaging file is obtained and stored in a local image warehouse.
[0023] Optionally, before installing the Kubeclipper graphical deployment software on the host, the steps further include:
[0024] Upload the binary file packages of Kubeclipper and kcctl to the host through the CLI command, where the kcctl is used to manage the Kubeclipper cluster.
[0025] Optionally, after the K8s cluster deployment is performed based on the obtained packaged file, the following steps may also be included:
[0026] Obtain business requirements in the current scenario;
[0027] Determine whether the current cluster resources meet the business requirements;
[0028] If not, increase the number of cluster nodes as needed.
[0029] Optionally, installing the Kubeclipper graphical deployment software on the host includes:
[0030] Execute the kcctl deploy command on the host to install the Kubeclipper graphical deployment software on the host.
[0031] In a second aspect, the present application provides a device for graphically deploying a K8s cluster, including:
[0032] Installation module, used to install Kubeclipper graphical deployment software on the host;
[0033] A building module, used for building a local image repository of the host for the graphical deployment software;
[0034] A processing module, used to call the image file corresponding to each K8s version in the official warehouse of K8s according to the K8s version information to be configured; wherein the K8s version information includes the version number of at least one K8s version and the identifier of the required image file;
[0035] The processing module is also used to package the image files corresponding to each K8s version, obtain the packaged files corresponding to each K8s and store them in the local image warehouse;
[0036] The configuration module is used to set the graphical deployment software according to the local image repository so that the graphical deployment software can be configured with different K8s versions.
[0037] Optionally, the configuration module is specifically used to:
[0038] According to the package files of different K8s versions stored in the local image repository, a version resource option is added to the graphical deployment software, wherein the version resource option includes an option corresponding to each K8s;
[0039] Establish an association between each option and the package file of the corresponding K8s version in the local image repository.
[0040] Optionally, the configuration module is further configured to, after the graphical deployment software is set according to the local image repository,
[0041] In response to the user's operation on the graphical deployment software, displaying a deployment interface of the graphical deployment software, wherein the version resource option is displayed in the deployment interface;
[0042] In response to the user's operation on the version resource option, obtaining the K8s version to be configured;
[0043] According to the association relationship, the package file corresponding to the K8s version to be configured is obtained, and the K8s cluster is deployed based on the obtained package file.
[0044] Optionally, the processing module is specifically used to:
[0045] For each K8s version, the image file of the K8s version is packaged to obtain an image package;
[0046] Packaging the configuration files of the K8s version to obtain configuration packaging;
[0047] According to the image packaging and the configuration packaging, a corresponding packaging file is obtained and stored in a local image warehouse.
[0048] Optionally, the installation module is specifically used for, before installing the Kubeclipper graphical deployment software on the host,
[0049] Upload the binary file packages of Kubeclipper and kcctl to the host through the CLI command, where the kcctl is used to manage the Kubeclipper cluster.
[0050] Optionally, the configuration module is further used to, after the K8s cluster is deployed based on the obtained packaged file,
[0051] Obtain business requirements in the current scenario;
[0052] Determine whether the current cluster resources meet the business requirements;
[0053] If not, increase the number of cluster nodes as needed.
[0054] Optionally, the installation module is further used to:
[0055] Execute the kcctl deploy command on the host to install the Kubeclipper graphical deployment software on the host.
[0056] In a third aspect, the present application provides a device for graphically deploying a K8s cluster, comprising: a processor, and a memory communicatively connected to the processor;
[0057] Memory stores computer-executable instructions;
[0058] The processor executes the computer execution instructions stored in the memory to implement various optional methods for graphically deploying K8s clusters as in the first aspect.
[0059] In a fourth aspect, the present application provides a readable storage medium, including computer execution instructions. When a processor executes the computer execution instructions, it executes various optional methods for graphically deploying K8s clusters as in the first aspect.
[0060] In a fifth aspect, the present application provides a program product, which includes a computer program, and the computer program is executed by a processor to implement various optional methods for graphically deploying K8s clusters as in the first aspect.
[0061] The present application provides a method, device, equipment and storage medium for graphically deploying a K8s cluster, which is implemented by installing Kubeclipper graphical deployment software on a host; building a local image repository of the host for the graphical deployment software; calling the image file corresponding to each K8s version in the official repository of K8s according to the K8s version information to be configured; wherein the K8s version information includes at least one version number of a K8s version and an identifier of a required image file; mirroring and packaging the image file corresponding to each K8s version, obtaining the corresponding packaged file for each K8s and storing it in a local image repository; and setting the graphical deployment software according to the local image repository so that the graphical deployment software can be configured with different K8s versions. This achieves the technical effect of being able to select the version of K8s according to different business needs of users, ensuring stable operation in the tool, and preventing problems of incompatibility with the tool, thereby reducing possible security vulnerabilities and problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0063] Figure 1 The method flow of graphically deploying K8s cluster provided in the embodiment of this application Figure 1 ;
[0064] Figure 2 The method flow of graphically deploying K8s cluster provided in the embodiment of this application Figure 2 ;
[0065] Figure 3 The method flow of graphically deploying K8s cluster provided in the embodiment of this application Figure 3 ;
[0066] Figure 4The method flow of graphically deploying K8s cluster provided in the embodiment of this application Figure 4 ;
[0067] Figure 5 A schematic diagram of a device for graphically deploying a K8s cluster provided in an embodiment of the present application;
[0068] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0069] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0070] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0071] Although K8s provides powerful command line tools to perform various operations, these tools have complex configurations and obscure commands, and may have a certain learning curve. The importance of graphical K8s cluster management tools lies in simplifying and improving the management and operation of K8s clusters, and achieving one-stop management of multiple K8s clusters across regions and infrastructures.
[0072] In the prior art, when using the Kubeclipper tool to graphically deploy a K8S cluster, the tool generally only provides a specified K8s version, but different K8s versions may have different functions, fix different vulnerabilities, or integrate better with specific applications and tools. Providing only a specified K8s version cannot effectively help users ensure that their clusters meet their specific needs.
[0073] Based on this, this application proposes a method for graphically deploying a K8s cluster. By establishing a local image repository in Kubeclipper, obtaining the required K8s images and configuration files, and storing them in the local image repository for further settings, the graphical deployment of the K8S cluster is completed without being restricted to the defined version provided by the graphical tool. The availability of the K8S cluster deployment is improved, and it can be adjusted according to the performance and security requirements of the application. The cluster size can be expanded or reduced as needed, which increases the flexibility of operation.
[0074] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0075] Figure 1 The method flow of graphically deploying K8s cluster provided in the embodiment of this application Figure 1 .like Figure 1 As shown, the method includes:
[0076] S101. Install Kubeclipper graphical deployment software on the host;
[0077] In this embodiment, the installation of the Kubeclipper graphical deployment software is completed by executing the installation command according to the Kubeclipper installation package and the kcctl binary file package downloaded on the host.
[0078] S102. Build a local image repository on the host for graphical deployment software;
[0079] A local image repository is a place that stores and manages container images on a local computer.
[0080] In this embodiment, for the graphical deployment software, the local image warehouse is established by executing the deployment instruction and specifying the local warehouse port.
[0081] S103. According to the K8s version information to be configured, call the image file corresponding to each K8s version in the official warehouse of K8s; wherein the K8s version information includes the version number of at least one K8s version and the identifier of the required image file;
[0082] An image file is a software package required to run K8s. The image file identifier is a set of information or strings used to identify and recognize the container image so as to retrieve, deploy, and manage the image file.
[0083] In this embodiment, according to the K8s version configured as needed, the image file software package of the K8s version is called in the official warehouse of K8s for subsequent configuration in the graphical deployment software.
[0084] S104, image packaging the image files corresponding to each K8s version, obtain the packaged files corresponding to each K8s and store them in the local image warehouse;
[0085] Image packaging refers to packaging K8s components into a container image file.
[0086] In this embodiment, the image file corresponding to the required K8s version is packaged using a packaging tool, and the packaged custom image is pushed to the local image warehouse.
[0087] S105. According to the local image repository, the graphical deployment software is set so that the graphical deployment software can be configured for different K8s versions.
[0088] In this embodiment, the required K8s version is selected in the resource options of the graphical deployment software, and based on the selected K8s version, the association relationship between each option and the packaged file of the corresponding K8s version in the local image repository established in advance is used to obtain it in the local repository, and finally the configuration of different K8s versions is completed in the graphical deployment software.
[0089] The present application provides a method, device, equipment and storage medium for graphically deploying a K8s cluster, the method comprising: installing Kubeclipper graphical deployment software on a host; building a local image repository of the host for the graphical deployment software; calling the image file corresponding to each K8s version in the official repository of K8s according to the K8s version information to be configured; wherein the K8s version information includes the version number of at least one K8s version and the identifier of the required image file; mirroring and packaging the image file corresponding to each K8s version, obtaining the corresponding packaged file for each K8s and storing it in the local image repository; and setting the graphical deployment software according to the local image repository so that the graphical deployment software can configure different K8s versions. The method of the present application realizes the technical effect of selecting different versions of K8s configuration according to the user's business needs, and has completed the graphical deployment of the K8s cluster.
[0090] Figure 2 The method flow of graphically deploying K8s cluster provided in the embodiment of this application Figure 2 Based on the above embodiment, this embodiment describes in detail the process of establishing a local warehouse. The method includes:
[0091] S201. Upload the binary file packages of Kubeclipper and kcctl to the host through CLI commands. kcctl is used to manage the Kubeclipper cluster.
[0092] CLI commands refer to the command mode for users to interact with computer systems. Users can make the computer perform various operations and tasks by entering relevant instructions in the command line terminal.
[0093] In this embodiment, the user uploads the downloaded binary file packages of Kubeclipper and kcctl to the computer host through the CLI command.
[0094] S202. Execute the kcctl deploy command on the host to install the Kubeclipper graphical deployment software on the host.
[0095] In this embodiment, by entering the kcctl deploy command in the computer host, the Kubeclipper graphical deployment software can be installed in the host to provide a convenient Kubernetes application management interface, thereby simplifying the creation, deployment and monitoring of containerized applications.
[0096] S203. Build a local image repository on the host for graphical deployment software.
[0097] The present application provides a method, apparatus, device and storage medium for graphically deploying a K8s cluster. By downloading and installing the toolkit required by Kubeclippe and completing the construction of a local image repository, the ability to graphically deploy K8s for clustering in an offline environment is realized, network costs are saved, access rights and security of the local repository can be better controlled, and the need to download the same image multiple times is reduced, thereby improving the startup performance of the container.
[0098] Figure 3 The method flow of graphically deploying K8s cluster provided in the embodiment of this application Figure 3 Based on the above embodiment, this embodiment describes in detail the process of configuring the K8s version. The method includes:
[0099] S301. According to the K8s version information to be configured, call the image file corresponding to each K8s version in the official warehouse of K8s; wherein the K8s version information includes the version number of at least one K8s version and the identifier of the required image file;
[0100] S302. For each K8s version, package the image file of the K8s version to obtain an image package;
[0101] In this embodiment, the image file of the K8s version includes the CoreDNS server, kube-apiserver, kube-scheduler and kube-controller-manager control components, kube-proxy network agent, and Pause container.
[0102] S303. Package the configuration file of the K8s version to obtain a configuration package;
[0103] Configuration files are text files that contain settings, options, and parameters related to the K8s version. Configuration files mainly include kubeadm, kubelet, kubectl component tools, and Add-ons component tools.
[0104] In this embodiment, the configuration file of the K8s version obtained from the official warehouse of K8s is packaged using a packaging tool to obtain a configuration package.
[0105] S304: According to the image packaging and configuration packaging, the corresponding packaging file is obtained and stored in the local image warehouse.
[0106] In this embodiment, a package file is obtained by integrating the image package and the related configuration package, and then pushed to the local image warehouse for storage so as to be deployed in different environments.
[0107] The present application provides a method, apparatus, device and storage medium for graphically deploying a K8s cluster, thereby realizing file packaging and storage of the K8s version in a local warehouse to ensure that the same image version is used during the deployment process, thereby improving the stability and consistency of the application, while meeting specific K8s version requirements and improving the utilization rate of the Kubeclipper graphical tool.
[0108] Figure 4 The method flow of graphically deploying K8s cluster provided in the embodiment of this application Figure 3 Based on the above embodiment, this embodiment describes in detail the process of setting the K8s version in a graphical tool. The method includes:
[0109] S401. Add a version resource option in the graphical deployment software according to the package files of different K8s versions stored in the local image repository, wherein the version resource option includes an option corresponding to each K8s;
[0110] The version resource option refers to the selection of different version resources provided to users in the interface of the graphical deployment software, which can help users select and configure the required K8s version according to business needs.
[0111] In this embodiment, by adding a version resource option in the graphical deployment software, users are allowed to select different K8s versions according to business needs. These K8s versions will correspond to the package files of the corresponding K8s versions stored in the local image repository.
[0112] S402. Establish an association relationship between each option and the package file of the corresponding K8s version in the local image repository;
[0113] An association relationship refers to a mapping between version resource options and package files in the graphical deployment software, so that each K8s version option can be associated with the package file of the corresponding K8s version in the local image repository.
[0114] In this embodiment, by establishing an association relationship between each option and the package file of the corresponding K8s version in the local image repository, the user can select the required K8s version in the interface.
[0115] S403, in response to the user's operation on the graphical deployment software, displaying a deployment interface of the graphical deployment software, wherein a version resource option is displayed in the deployment interface;
[0116] The deployment interface is an interface used to help users configure and deploy K8s clusters.
[0117] In this embodiment, according to the user's operation request to the graphical deployment software, the deployment software will display a deployment interface with version resource options for the user to select.
[0118] S404. In response to the user's operation on the version resource option, obtain the K8s version to be configured;
[0119] In this embodiment, in the deployment interface with version resource options displayed by the software, the user can select the version of K8s, and then the software obtains the K8s version to be configured in the local image repository according to the K8s version selected by the user.
[0120] S405. According to the association relationship, obtain the package file corresponding to the K8s version to be configured, and perform K8s cluster deployment based on the obtained package file;
[0121] In this embodiment, according to the pre-established association relationship between each selection item and the package file of the corresponding K8s version in the local image repository, all package files corresponding to the K8s version to be configured are obtained in the local image repository, and according to the package file, the K8s cluster is deployed and installed in the graphical deployment software.
[0122] S406: Obtain the business requirements in the current scenario, and determine whether the current cluster resources meet the business requirements. If not, increase the number of cluster nodes as needed.
[0123] Cluster resources refer to the computing, storage, and network resources available in a computer cluster.
[0124] In this embodiment, the sufficiency of the current cluster resources is determined based on the business needs in the current scenario. If the current cluster resources cannot meet the business needs in the current scenario, the cluster is maintained based on the business needs and resource usage, and the number of cluster nodes is increased as needed.
[0125] The present application provides a method, apparatus, device and storage medium for graphically deploying a K8s cluster, thereby realizing the use of K8s versions according to business needs in the Kubeclipper graphical tool, simplifying cluster management, improving application flexibility and maintainability, and enabling businesses to adapt to different K8s versions and functions more quickly. At the same time, it lowers the technical threshold and allows more technical personnel to participate in cluster operations, thereby improving overall productivity and agility.
[0126] Figure 5 A schematic diagram of the device structure for graphically deploying a K8s cluster provided in an embodiment of the present application; Figure 5 As shown, the device comprises:
[0127] Installation module 501 is used to install Kubeclipper graphical deployment software on the host;
[0128] A building module 502 is used to build a local image repository of a host for graphical deployment software;
[0129] Processing module 503, used to call the image file corresponding to each K8s version in the official warehouse of K8s according to the K8s version information to be configured; wherein the K8s version information includes the version number of at least one K8s version and the identifier of the required image file;
[0130] The processing module 503 is also used to package the image files corresponding to each K8s version, obtain the packaged files corresponding to each K8s and store them in the local image warehouse;
[0131] The configuration module 504 is used to set the graphical deployment software according to the local image repository so that the graphical deployment software can be configured for different K8s versions.
[0132] In a possible implementation, the configuration module 504 is specifically configured to:
[0133] According to the package files of different K8s versions stored in the local image repository, add version resource options in the graphical deployment software, where the version resource options include options corresponding to each K8s;
[0134] Establish an association between each option and the package file of the corresponding K8s version in the local image repository.
[0135] In a possible implementation, the configuration module 504 is further configured to, after configuring the graphical deployment software according to the local image repository,
[0136] In response to the user's operation on the graphical deployment software, a deployment interface of the graphical deployment software is displayed, wherein a version resource option is displayed in the deployment interface;
[0137] In response to the user's operation on the version resource option, the K8s version to be configured is obtained;
[0138] According to the association relationship, obtain the package file corresponding to the K8s version to be configured, and deploy the K8s cluster based on the obtained package file.
[0139] In a possible implementation, the processing module 503 is specifically configured to:
[0140] For each K8s version, package the image file of the K8s version to obtain an image package;
[0141] Package the configuration files of the K8s version to obtain the configuration package;
[0142] According to the image packaging and configuration packaging, the corresponding packaging files are obtained and stored in the local image warehouse.
[0143] In a possible implementation, the installation module 501 is specifically used to, before installing the Kubeclipper graphical deployment software on the host,
[0144] Use the CLI command to upload the binary file packages of Kubeclipper and kcctl to the host. kcctl is used to manage the Kubeclipper cluster.
[0145] In a possible implementation, the configuration module 504 is further configured to:
[0146] After deploying the K8s cluster based on the obtained packaged files,
[0147] Obtain business requirements in the current scenario;
[0148] Determine whether the current cluster resources meet business needs;
[0149] If not, increase the number of cluster nodes as needed.
[0150] In a possible implementation, the installation module 501 is further used to:
[0151] Run the kcctl deploy command on the host to install the Kubeclipper graphical deployment software on the host.
[0152] Figure 6Schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Figure 6 As shown, the electronic device 60 provided in this embodiment includes: a processor 601 and a memory 602. The device 60 also includes a communication component 603. The processor 601, the memory 602 and the communication component 603 are connected via a bus 604.
[0153] During the specific implementation process, the processor 601 executes the computer execution instructions stored in the memory 602, so that the processor 601 executes the above-mentioned method of graphically deploying the K8s cluster.
[0154] The specific implementation process of the processor 601 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0155] In the above Figure 6 In the illustrated embodiment, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0156] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk storage.
[0157] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0158] The present application also provides a computer program product, including a computer program, which implements the above-mentioned method of graphically deploying a K8s cluster when executed by a processor.
[0159] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above-mentioned method of graphically deploying a K8s cluster is implemented.
[0160] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0161] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0162] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0163] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0164] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0165] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0166] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0167] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A method for graphically deploying a K8s cluster, characterized in that: include: Install Kubeclipper graphical deployment software on the host; For the graphical deployment software, build a local image repository of the host; According to the K8s version information to be configured, call the image file corresponding to each K8s version in the official warehouse of the K8s; wherein the K8s version information includes the version number of at least one K8s version and the identifier of the required image file; Package the image files corresponding to each K8s version, obtain the packaged files corresponding to each K8s and store them in the local image warehouse; According to the local image repository, the graphical deployment software is set so that the graphical deployment software can be configured with different K8s versions.
2. The method according to claim 1, characterized in that The graphical deployment software is set according to the local image repository so that the graphical deployment software can be configured with different K8s versions, including: According to the package files of different K8s versions stored in the local image repository, a version resource option is added to the graphical deployment software, wherein the version resource option includes an option corresponding to each K8s; Establish an association between each option and the package file of the corresponding K8s version in the local image repository.
3. The method according to claim 2, characterized in that After the graphical deployment software is set according to the local image repository, the method further includes: In response to the user's operation on the graphical deployment software, displaying a deployment interface of the graphical deployment software, wherein the version resource option is displayed in the deployment interface; In response to the user's operation on the version resource option, obtaining the K8s version to be configured; According to the association relationship, the package file corresponding to the K8s version to be configured is obtained, and the K8s cluster is deployed based on the obtained package file.
4. The method according to claim 1, characterized in that: The image files corresponding to each K8s version are packaged to obtain the packaged files corresponding to each K8s and stored in the local image warehouse, including: For each K8s version, the image file of the K8s version is packaged to obtain an image package; Packaging the configuration files of the K8s version to obtain configuration packaging; According to the image packaging and the configuration packaging, a corresponding packaging file is obtained and stored in a local image warehouse.
5. The method according to claim 1, characterized in that Before installing the Kubeclipper graphical deployment software on the host, the method further includes: Upload the binary file packages of Kubeclipper and kcctl to the host through the CLI command, where the kcctl is used to manage the Kubeclipper cluster.
6. The method according to claim 3, characterized in that After the K8s cluster is deployed based on the obtained packaged file, the method further includes: Obtain business requirements in the current scenario; Determine whether the current cluster resources meet the business requirements; If not, increase the number of cluster nodes as needed.
7. The method according to claim 1, characterized in that The Kubeclipper graphical deployment software is installed on the host, including: Execute the kcctl deploy command on the host to install the Kubeclipper graphical deployment software on the host.
8. A device for graphically deploying a K8s cluster, comprising: Installation module, used to install Kubeclipper graphical deployment software on the host; A building module, used for building a local image repository of the host for the graphical deployment software; A processing module, used to call the image file corresponding to each K8s version in the official warehouse of K8s according to the K8s version information to be configured; wherein the K8s version information includes the version number of at least one K8s version and the identifier of the required image file; The processing module is also used to package the image files corresponding to each K8s version, obtain the packaged files corresponding to each K8s and store them in the local image warehouse; The configuration module is used to set the graphical deployment software according to the local image repository so that the graphical deployment software can be configured with different K8s versions.
9. An electronic device, comprising: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method for graphically deploying a K8s cluster as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method for graphically deploying a K8s cluster as described in any one of claims 1 to 7.