Method and device for constructing simple cloud native custom resource use environment
By using single-point deployment methods such as distributed key-value storage databases in non-K8S cluster environments to build a cloud-native custom resource usage environment, the problem of complex and large resource occupancy of building and running a custom resource controller environment is solved, and the problem of large resource occupancy is realized. Efficient and resource-saving deployment plan.
Patent Information
- Application Number
- CN202411409644.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-02-07
AI Technical Summary
The controller environment for building and running custom resources is complex and has a large resource occupancy, especially in resource-short edge environments and test environments, which are difficult to achieve efficient construction.
In a non-K8S cluster deployment environment, the single-point deployment method corresponding to the distributed key-value storage database, server programs, custom controllers and command line tools is achieved to streamline the construction of cloud-native custom resource usage environment.
It improves the efficiency of building a custom resource controller environment, reduces resource occupation, is suitable for resource-intensive environments, and simplifies deployment complexity.
Smart Images

Figure CN119396414A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of resource management of container orchestration and scheduling systems, and more specifically, to a method and device for building a streamlined cloud-native custom resource usage environment. Background Art
[0002] With the development of container technology and container orchestration and scheduling systems (Kubernetes, K8S), Custom Resource Definitions (CRD) technology has also developed rapidly. It can quickly expand user-defined resources and implement related functions through custom controllers.
[0003] However, when using CRD technology, a K8S cluster environment is required to run the controller of custom resources. Building a K8S cluster environment is relatively complex and requires a lot of resources. Especially for some resource-scarce environments such as edge environments and certain test environments, it is not enough to build a complete K8S cluster, or there is a lack of experience or ability to build a K8S cluster, which leads to low efficiency in building and running the controller environment for custom resources.
[0004] Therefore, how to improve the efficiency of building a controller environment for running custom resources to implement functions related to custom controllers is an urgent problem to be solved in this application. Summary of the invention
[0005] In view of this, the present application discloses a streamlined method and device for building a cloud-native custom resource usage environment, aiming to improve the efficiency of building a controller environment for running custom resources to realize the functions of a custom controller.
[0006] In order to achieve the above purpose, the disclosed technical solution is as follows:
[0007] The first aspect of the present application discloses a simplified method for building a cloud-native custom resource usage environment, the method comprising:
[0008] Determine various deployment modes; wherein the various deployment modes are deployment modes in which the distributed key-value storage database, the server program, the custom controller, and the command line tool are each started on the host machine in a single point;
[0009] In the preset deployment environment, the distributed key-value storage database, server program, custom controller and command line tool are deployed accordingly according to each deployment method to complete the construction of the cloud-native custom resource usage environment; wherein the preset deployment environment is a non-K8S cluster deployment environment;
[0010] In the cloud-native custom resource usage environment, the functions of the custom controller are implemented through custom resource definition technology.
[0011] Preferably, the deployment process of the distributed key-value storage database includes:
[0012] The distributed key-value storage database is run on the host machine in the form of a host machine service; wherein the distributed key-value storage database is a single-point distributed key-value storage database; the host machine service runs the distributed key-value storage database in the form of a container;
[0013] During the operation of the host machine, the container is started to mount the host directory, and the host directory is used as the storage directory to complete the deployment process of the distributed key-value storage database.
[0014] Preferably, the deployment process of the server program includes:
[0015] The server program is run on the host machine in the form of a host machine service; wherein the server program is a single-point server program; and the database address used by the server program is a single-point database address;
[0016] When the host machine is running, the server program is started through the container mode, and the certificate file required for the server program to run is mounted into the container through the mount directory mode to complete the deployment process of the server program.
[0017] Preferably, the deployment process of the custom controller includes:
[0018] Running the custom controller on the host machine in the form of a host service; wherein the custom controller uses a server program deployed on the node;
[0019] During the operation of the host machine, the custom controller is operated in the form of a host machine service to complete the deployment process of the custom controller.
[0020] Preferably, the deployment process of the command line tool includes:
[0021] The command line tool is deployed on the node through binary deployment to complete the deployment process of the command line tool; wherein the address of the server program connected to the command line tool is the server program address in the deployment process of the custom controller; the certificate file of the command line tool is stored in the node.
[0022] Preferably, the function of the custom controller is realized by custom resource definition technology in the cloud native custom resource usage environment, including:
[0023] In a cloud-native custom resource usage environment, a custom controller is run through a custom resource definition technology to implement the functions of the custom controller; wherein the functions of the custom controller at least include creating a custom resource definition to a server program, creating a custom resource to a server program, and the custom controller listening to the custom resource.
[0024] Preferably, it also includes:
[0025] Use command line tools to create custom resource definitions and custom resources in server programs, and use custom resource controllers to tune custom resources.
[0026] The second aspect of the present application discloses a simplified device for building a cloud-native custom resource usage environment, the device comprising:
[0027] A determination unit, used to determine each deployment mode; wherein each deployment mode is a deployment mode in which a distributed key-value storage database, a server program, a custom controller, and a command line tool are respectively started on a host machine at a single point;
[0028] A deployment unit is used to deploy the distributed key-value storage database, server program, custom controller and command line tool respectively according to various deployment methods in a preset deployment environment to complete the construction of a cloud-native custom resource usage environment; wherein the preset deployment environment is a non-K8S cluster deployment environment;
[0029] The implementation unit is used to implement the functions of the custom controller through the custom resource definition technology in the cloud native custom resource usage environment.
[0030] Preferably, the deployment unit of the distributed key-value storage database includes:
[0031] A first operation module is used to run the distributed key-value storage database on the host machine in the form of a host machine service; wherein the distributed key-value storage database is a single-point distributed key-value storage database; and the host machine service runs the distributed key-value storage database in the form of a container;
[0032] The first startup module is used to start the container to mount the host directory during the operation of the host machine, and use the host directory as the storage directory to complete the deployment process of the distributed key-value storage database.
[0033] Preferably, the deployment unit of the server program includes:
[0034] The second running module is used to run the server program on the host machine in the form of a host machine service; wherein the server program is a single-point server program; and the database address used by the server program is a single-point database address;
[0035] The mounting module is used to start the server program through the container mode during the operation of the host machine, and mount the certificate files required for the server program to the container through the mounting directory to complete the deployment process of the server program.
[0036] Through the above technical scheme, it can be known that the present application discloses a simplified method and device for building a cloud-native custom resource use environment, and determines each deployment mode, wherein each deployment mode is an optimized deployment mode corresponding to each of the distributed key-value storage database, the server program, the custom controller, and the command line tool. Under the preset deployment environment, the distributed key-value storage database, the server program, the custom controller, and the command line tool are respectively deployed according to each deployment mode to complete the construction of the cloud-native custom resource use environment, wherein the preset deployment environment is a non-K8S cluster deployment environment, and under the cloud-native custom resource use environment, the function of the custom controller is realized through the custom resource definition technology. Through the above scheme, since building a K8S cluster environment requires a large amount of resources and is relatively complex, the present application does not need to build a complex K8S cluster environment, but only needs to be based on the non-K8S cluster deployment environment, through the distributed key-value storage database, the server program, the custom controller, and the command line tool. The deployment mode corresponding to each other on the host machine is simplified to complete the construction of the cloud-native custom resource use environment, thereby improving the construction efficiency of the controller environment for running custom resources to realize the function of the custom controller. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0038] Figure 1 A flowchart of a simplified method for building a cloud-native custom resource usage environment disclosed in an embodiment of the present application;
[0039] Figure 2 This is a schematic diagram of the structure of a non-K8S node disclosed in an embodiment of the present application;
[0040] Figure 3 A schematic diagram of the structure of a simplified device for building a cloud-native custom resource usage environment disclosed in an embodiment of the present application;
[0041] Figure 4 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0043] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0044] As can be seen from the background technology, when using CRD technology, a K8S cluster environment is required to run the controller of custom resources, and building a K8S cluster environment is relatively complex, and it also requires a lot of resources, especially for some resource-scarce environments such as edge environments and certain test environments, which are not enough to build a complete K8S cluster, or lack the experience or ability to build a K8S cluster, resulting in low efficiency in building a controller environment for running custom resources. Therefore, how to improve the efficiency of building a controller environment for running custom resources to realize functions related to custom controllers is a problem that this application urgently needs to solve.
[0045] In order to solve the above problems, the present application discloses a streamlined method and device for building a cloud-native custom resource usage environment. Since building a K8S cluster environment requires a large amount of resources and is relatively complex, the present application does not need to build a complex K8S cluster environment. It only needs to be based on a non-K8S cluster deployment environment, through a distributed key-value storage database, a server program, a custom controller, and a command line tool. The deployment method of each corresponding to a single point start on the host machine is streamlined to complete the construction of a cloud-native custom resource usage environment, thereby improving the efficiency of building a controller environment for running custom resources to realize the function of a custom controller. The specific implementation method is specifically described through the following embodiments.
[0046] refer to Figure 1 As shown, a simplified method for building a cloud-native custom resource usage environment disclosed in an embodiment of the present application is provided. The simplified method for building a cloud-native custom resource usage environment mainly includes the following steps:
[0047] S101: Determine each deployment mode; wherein each deployment mode is a deployment mode of single-point startup on a host machine corresponding to a distributed key-value storage database (etcd), a server program (apiserver), a custom controller, and a command line tool (kubectl).
[0048] Each deployment method is a simplified deployment method in which the kubelet component starts the service program (apiserver) container in a single-point startup on the host machine in multiple copies.
[0049] S102: In the preset deployment environment, etcd, apiserver, custom controller and kubectl are deployed respectively according to various deployment methods to complete the construction of the cloud-native custom resource usage environment; wherein the preset deployment environment is a non-K8S cluster deployment environment.
[0050] Among them, the non-K8S cluster deployment environment refers to a cluster deployment environment other than K8S.
[0051] It should be noted that the operation of custom controllers requires a storage database for custom resources. In a K8S cluster, etcd is often used as the backend storage data (that is, all resource data in the cluster). In a non-K8S cluster environment, etcd is also used as the storage for custom resources, and a streamlined deployment method is adopted, which is easy to deploy and takes up less resources.
[0052] The specific deployment method is as follows:
[0053] (1) Simplified etcd deployment;
[0054] (2) Simplified apiserver deployment;
[0055] (3) Simplified deployment of custom controllers;
[0056] (4) How to use custom resources.
[0057] The deployment process of etcd is shown in A1-A2.
[0058] A1: The distributed key-value storage database runs on the host through the form of a host service. Among them, etcd is a single-point distributed key-value storage database; the service runs etcd in the form of a container.
[0059] (1) etcd runs on the host as a host service:
[0060] etcd running as a service is pulled up by the system and runs on the host machine. When encountering an exception, it can be pulled up by the system in time.
[0061] The service is in the form of adding a service file directly on the host machine and configuring its configuration parameters, such as startup commands, dependencies, etc. It is started directly by the host machine without relying on other components. It can start automatically at boot and automatically restart in abnormal states, and it is easy to deploy.
[0062] (2) etcd is a single point etcd:
[0063] In edge scenarios where resources are scarce, a single-point deployment method is used. etcd is deployed as a single-point etcd, which is simple to configure and can be used immediately after startup. At the same time, data is backed up regularly for the single-point etcd so that it can be restored through the backup data when etcd fails.
[0064] It should be noted that the single-point deployment method can bring streamlined deployment to this solution, which is suitable for the use or testing of custom controllers without a K8S environment, as well as various scenarios where edge resources are scarce.
[0065] (3) The service is started through a container:
[0066] Specifically, the Service runs etcd in the form of a container. Running it only requires the container runtime and etcd container image on the host. The start and stop commands are as follows:
[0067] ExecStart= / usr / bin / dockerrun\
[0068] --init\
[0069] --env-file= / etc / etcd.env\
[0070] --net=host\
[0071] -v / var / lib / etcd: / var / lib / etcd:rw\
[0072] --name=etcd\
[0073] {{.ImageRegistry}} / library / cke / etcd / etcd:{{.ImageVersion}}\
[0074] / usr / local / bin / etcd
[0075] ExecStartPre=- / usr / bin / dockerrm-fetcd
[0076] ExecStop= / usr / bin / docker stop etcd
[0077] ExecStop= / usr / bin / dockerrm-fetcd.
[0078] A2: When the host is running, start the container to mount the host directory and use the host directory as the storage directory to complete the deployment process of the distributed key-value storage database.
[0079] (4) etcd uses the host directory as storage:
[0080] When the container is started, it mounts the host directory and uses the host directory as the storage directory.
[0081] The deployment process of the apiserver is shown in B1-B2.
[0082] B1: Run the apiserver on the host machine in the form of service. The apiserver is a single-point apiserver. The database address used by the apiserver is the etcd address. The apiserver is easy to deploy and configure, and can be used immediately after startup.
[0083] The operation of custom controllers requires monitoring of custom resources and depends on apiserver. The apiserver uses a simplified deployment method to connect to etcd. The apiserver deployment provides custom controllers with the ability to monitor custom resources.
[0084] (1) The apiserver runs on the host as a host service:
[0085] The apiserver running as a service is pulled up by the system. The apiserver runs on the host machine and can be pulled up by the system in time when encountering an exception.
[0086] API server refers to the component that provides API capabilities in Kubernetes.
[0087] (2) Apiserver is a single point:
[0088] The apiserver is deployed as a single-point apiserver with simple configuration and can be used immediately after startup.
[0089] By configuring the service file on the node, configuring the startup command of the apiserver and the configuration file, start it by systmctl start apiserver. Nodes refer to nodes controlled by custom resources other than the controller deployment node, such as the installation and configuration of various components on other nodes.
[0090] (3) The database address used by apiserver is a single-point etcd address:
[0091] The apiserver configures etcd as a single point etcd deployed on the host. The apiserver address is the IP address of the current node plus the port number exposed by etcd. Specifically, in the apiserver startup command, configure --etcd-servers to the address and port that etcd listens on on the current node.
[0092] B2: When running the host machine, start the server program (apiserver) through the container mode, and mount the certificate file required for the server program (apiserver) to the container through the mount directory mode to complete the deployment process of the server program (apiserver).
[0093] (4)Service is started through container:
[0094] Service runs the apiserver as a container, which only requires the container runtime and the apiserver container image on the host.
[0095] ExecStart= / usr / bin / dockerrun\
[0096] --init\
[0097] -v / etc / cke / : / etc / cke / \
[0098] --net=host\
[0099] --name=apiserver\
[0100] {{.ImageRegistry}} / library / cke / kubernetes / {{.ImageVersion}}\
[0101] / kube-apiserver\
[0102] --etcd-servers=http: / / {{.NodeIp}}:8091\
[0103] --bind-address=0.0.0.0\
[0104] --secure-port=8890\
[0105] --client-ca-file= / etc / cke / ca.pem\
[0106] --tls-cert-file= / etc / cke / apiserver.pem\
[0107] --tls-private-key-file= / etc / cke / apiserver-key.pem\
[0108] ExecStartPre=- / usr / bin / dockerrm-fapiserver
[0109] ExecStop= / usr / bin / dockerstop apiserver
[0110] ExecStop= / usr / bin / dockerrm-fapiserver.
[0111] (5) The apiserver uses the certificate file generated in advance:
[0112] The certificate files required for the apiserver to run are all pre-generated certificate files, which are mounted into the container by mounting the directory.
[0113] The operation of the apiserver requires a certificate file, which is mainly used for communication between the controller and the apiserver. The certificate file is preset in advance and does not need to be generated every time.
[0114] The deployment process of the custom controller is shown in C1-C2.
[0115] C1: Run the custom controller on the host in the form of a service. The custom controller uses the apiserver deployed on the node.
[0116] (1) The custom controller runs on the host machine as a service:
[0117] The custom controller running as a service is pulled up by the system and runs on the host machine. It will be pulled up again by the system in case of an exception.
[0118] (2) The custom controller uses the apiserver deployed on the node:
[0119] The startup of the custom controller depends on the apiserver on the host. The configured apiserver address is the node address plus the port exposed by the apiserver, and is accessed using a pre-configured certificate.
[0120] C2: During the running of the host machine, the custom controller is run in the form of a service to complete the deployment process of the custom controller.
[0121] (3) Start via container:
[0122] The service runs the custom controller in the form of a container, which only requires the container runtime and the automatic escape controller container image on the host.
[0123] The deployment process of the command line tool (kubectl) is as follows:
[0124] Deploy kubectl on the node through binary deployment to complete the kubectl deployment process. The address of the apiserver connected to the command line tool is the address of the server program apiserver in the deployment process of the custom controller; the kubectl certificate file is stored on the node.
[0125] In order to facilitate the definition, creation and query of custom resources, kubectl is deployed on the node. The deployment method is:
[0126] (1) kubectl uses binary deployment mode and places the binary in the / usr / local / bin directory of the host machine.
[0127] (2) The kubectl connection address and port are the local address plus the port exposed by the apiserver.
[0128] (3) The kubectl certificate file is a pre-generated certificate file that is placed on the node in advance for use when calling.
[0129] S103: In the cloud-native custom resource usage environment, the functions of the custom controller are realized through CRD technology.
[0130] In S103, in a cloud-native custom resource usage environment, a custom controller is run through CRD technology to implement the functions of the custom controller, wherein the functions of the custom controller at least include creating a custom resource definition to an apiserver, creating a custom resource to a server program apiserver, and the custom controller listening to the custom resource.
[0131] By deploying etcd, apiserver and custom controller on non-K8S nodes, the operation of custom controller is realized. Custom controller listens to custom resources and realizes related functions of custom controller.
[0132] The specific structure of non-K8S nodes is as follows Figure 2 shown.
[0133] Figure 2 In this context, nodes refer to nodes other than controller deployment nodes that are controlled by custom resources, such as the installation and configuration of various components on other nodes.
[0134] Figure 2 The specific functions are as follows:
[0135] (1) On non-K8S nodes, etcd is configured to provide the running capability of the apiserver and is used as the only data source for regular backup.
[0136] (2) On non-K8S nodes, the ability to run custom controllers is provided by configuring the apiserver.
[0137] (3) The custom controller tunes related resources on other nodes based on the custom resources.
[0138] The functions of a custom controller are implemented by the custom controller, such as installing the components defined by it on a node by creating custom resources, and implementing its deletion, update, upgrade and other functions. The specific related functions are as follows:
[0139] (1) Create a custom resource definition to the apiserver:
[0140] Create a custom resource definition to the apiserver. The custom resource definition contains the specific definition of the monitoring resource and is created by the kubectl command tool.
[0141] It should be noted that monitoring resources refers to the controller monitoring custom resources through the apiserver and listening to their events, such as creation, deletion, update, and upgrade.
[0142] (2) Create custom resources to the apiserver:
[0143] Create a custom resource definition to the apiserver. Custom resources are the specific manifestation of custom resource definitions and are created using the kubectl command tool.
[0144] Custom resources are defined in the form of data serialization (yaml) files, and can be created through the kubectl command tool kubectl create -f.
[0145] (3) Custom controller monitors custom resources:
[0146] The custom controller listens to custom resources and tunes them to implement related functions. Since they are not in the K8S cluster, custom resources generally process various resources on the node.
[0147] Through kubectl, create custom resource definitions and custom resources to the apiserver, and tune custom resources through the custom resource controller.
[0148] The custom controller monitors custom resources through the apiserver, mainly by monitoring custom resource events and performing corresponding processing to achieve the required state of the custom resource. For example, if it monitors creation, it will execute the creation action as required.
[0149] The processing of various resources on the node is as follows:
[0150] For example, a custom resource definition is to install a binary component on a node and configure its configuration file. After the controller monitors the creation, it will copy the binary to this node and configure the configuration file.
[0151] In view of the current scenario in the container cloud platform field where custom resources cannot be used in a non-K8S cluster environment, the beneficial effects of this application are as follows:
[0152] (1) Using custom resources in a non-container cluster environment;
[0153] (2) Provide a custom controller operating environment in a non-container cluster environment;
[0154] (3) Save resources, which is suitable for scenarios with resource shortage or testing. Currently, custom resources and their controllers are used in K8S clusters. The construction of clusters requires the deployment of a large number of components, which takes up a lot of resources. This solution does not require the deployment of K8S clusters, which saves a lot of resources.
[0155] (4) Because the deployment of K8S cluster is very complicated, this application only needs to deploy a few components (etcd, apiserver, custom controller, kubectl) for quick construction, with low complexity and no complex maintenance of K8S environment.
[0156] In view of the current usage scenarios of custom resource technology, based on the environment required for the operation of custom controllers, the following capabilities are implemented:
[0157] (1) Provide the ability to use custom resources in a non-K8S cluster environment; custom resources are resources defined by users in a K8S cluster and are used to define resources other than native resources in K8S. What is provided here is the ability to define custom resources in a non-K8S cluster environment.
[0158] (2) Provide the ability to run custom controllers in non-K8S cluster environments. Custom controllers are controllers that process custom resources in a K8S cluster and are used to handle various events of custom resources. What is provided here is the ability to run and use custom controllers in non-K8S environments.
[0159] In the embodiment of the present application, there is no need to build a complex K8S cluster environment. It is only necessary to perform streamlined deployment on the basis of a non-K8S cluster deployment environment through a distributed key-value storage database, server program, custom controller and command line tool, each of which is started on the host machine in a single point. To complete the construction of a cloud-native custom resource usage environment, thereby improving the efficiency of building the controller environment for running custom resources and realizing the functions of the custom controller.
[0160] Based on the above embodiments Figure 1 A simplified method for building a cloud-native custom resource usage environment is disclosed. The embodiment of the present application also discloses a simplified device for building a cloud-native custom resource usage environment. Figure 3 As shown, the simplified cloud-native custom resource usage environment construction device includes:
[0161] The determination unit 301 is used to determine each deployment mode; wherein each deployment mode is a deployment mode in which a distributed key-value storage database, a server program, a custom controller, and a command line tool are respectively started on a host machine at a single point;
[0162] The deployment unit 302 is used to deploy the distributed key-value storage database, the server program, the custom controller and the command line tool according to various deployment methods in a preset deployment environment to complete the construction of the cloud-native custom resource usage environment; wherein the preset deployment environment is a non-K8S cluster deployment environment;
[0163] The implementation unit 303 is used to implement the function of the custom controller through the custom resource definition technology in the cloud native custom resource usage environment.
[0164] Furthermore, the deployment unit 302 of the distributed key-value storage database includes:
[0165] A first running module is used to run the distributed key-value storage database on the host machine in the form of a host machine service; wherein the distributed key-value storage database is a single-point distributed key-value storage database; and the host machine service runs the distributed key-value storage database in the form of a container;
[0166] The first startup module is used to start the container to mount the host directory during the operation of the host machine, and use the host directory as the storage directory to complete the deployment process of the distributed key-value storage database.
[0167] Furthermore, the server program deployment unit 302 includes:
[0168] The second running module is used to run the server program on the host machine in the form of a host machine service; wherein the server program is a single-point server program; and the database address used by the server program is a single-point database address;
[0169] The mounting module is used to start the server program through the container mode during the operation of the host machine, and mount the certificate files required for the server program to the container through the mounting directory to complete the deployment process of the server program.
[0170] Furthermore, the deployment unit 302 of the custom controller includes:
[0171] A third running module is used to run the custom controller on the host machine in the form of a host service; wherein the custom controller uses a server program deployed on the node;
[0172] The fourth running module is used to run the custom controller in the form of a host service during the running of the host machine to complete the deployment process of the custom controller.
[0173] Furthermore, the deployment unit 302 of the command line tool is specifically used to deploy the command line tool on the node through binary deployment to complete the deployment process of the command line tool; wherein the address of the server program connected to the command line tool is the server program address in the deployment process of the custom controller; and the certificate file of the command line tool is stored in the node.
[0174] Furthermore, implementation unit 303 is specifically used to run a custom controller through custom resource definition technology in a cloud-native custom resource usage environment to realize the functions of the custom controller; wherein the functions of the custom controller at least include creating custom resource definitions to the server program, creating custom resources to the server program, and the custom controller listening to custom resources.
[0175] Furthermore, the simplified cloud-native custom resource usage environment construction device also includes:
[0176] Create a tuning unit to create custom resource definitions and custom resources to the server program through command line tools, and tune custom resources through custom resource controllers.
[0177] In the embodiment of the present application, there is no need to build a complex K8S cluster environment. It is only necessary to perform streamlined deployment on the basis of a non-K8S cluster deployment environment through a distributed key-value storage database, server program, custom controller and command line tool, each of which is started on the host machine in a single point. To complete the construction of a cloud-native custom resource usage environment, thereby improving the efficiency of building the controller environment for running custom resources and realizing the functions of the custom controller.
[0178] An embodiment of the present application also provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the method for building a simplified cloud-native custom resource usage environment as described above.
[0179] The present application also provides an electronic device, whose structural diagram is as follows: Figure 4 As shown, it specifically includes a memory 401 and one or more instructions 402, wherein the one or more instructions 402 are stored in the memory 401 and are configured to be executed by one or more processors 403 to execute the one or more instructions 402 to execute the above-mentioned streamlined method for building a cloud-native custom resource usage environment.
[0180] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0181] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0182] The steps in the methods of the embodiments of the present application can be adjusted in order, combined, and deleted according to actual needs.
[0183] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.
[0184] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
[0185] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A simplified method for building a cloud-native custom resource usage environment, characterized in that: The method comprises: Determine various deployment modes; wherein the various deployment modes are deployment modes in which the distributed key-value storage database, the server program, the custom controller, and the command line tool are each started on the host machine in a single point; In the preset deployment environment, the distributed key-value storage database, server program, custom controller and command line tool are deployed accordingly according to each deployment method to complete the construction of the cloud-native custom resource usage environment; wherein the preset deployment environment is a non-K8S cluster deployment environment; In the cloud-native custom resource usage environment, the functions of the custom controller are implemented through custom resource definition technology.
2. The method according to claim 1, characterized in that The deployment process of a distributed key-value storage database includes: The distributed key-value storage database is run on the host machine in the form of a host machine service; wherein the distributed key-value storage database is a single-point distributed key-value storage database; the host machine service runs the distributed key-value storage database in the form of a container; During the operation of the host machine, the container is started to mount the host directory, and the host directory is used as the storage directory to complete the deployment process of the distributed key-value storage database.
3. The method according to claim 1, characterized in that The deployment process of the server program includes: The server program is run on the host machine in the form of a host machine service; wherein the server program is a single-point server program; and the database address used by the server program is a single-point database address; When the host machine is running, the server program is started through the container mode, and the certificate file required for the server program to run is mounted into the container through the mount directory mode to complete the deployment process of the server program.
4. The method according to claim 1, characterized in that The deployment process of a custom controller includes: Running the custom controller on the host machine in the form of a host service; wherein the custom controller uses a server program deployed on the node; During the operation of the host machine, the custom controller is operated in the form of a host machine service to complete the deployment process of the custom controller.
5. The method according to claim 4, characterized in that The deployment process of the command line tool includes: The command line tool is deployed on the node through binary deployment to complete the deployment process of the command line tool; wherein the address of the server program connected to the command line tool is the server program address in the deployment process of the custom controller; the certificate file of the command line tool is stored in the node.
6. The method according to claim 1, characterized in that In the cloud-native custom resource usage environment, the functions of the custom controller are realized through the custom resource definition technology, including: In a cloud-native custom resource usage environment, a custom controller is run through a custom resource definition technology to implement the functions of the custom controller; wherein the functions of the custom controller at least include creating a custom resource definition to a server program, creating a custom resource to a server program, and the custom controller listening to the custom resource.
7. The method according to claim 6, characterized in that Also includes: Use command line tools to create custom resource definitions and custom resources in server programs, and use custom resource controllers to tune custom resources.
8. A simplified device for building a cloud-native custom resource usage environment, characterized in that: The device comprises: A determination unit, used to determine each deployment mode; wherein each deployment mode is a deployment mode in which a distributed key-value storage database, a server program, a custom controller, and a command line tool are each started on a host machine at a single point; A deployment unit is used to deploy the distributed key-value storage database, server program, custom controller and command line tool respectively according to various deployment methods in a preset deployment environment to complete the construction of a cloud-native custom resource usage environment; wherein the preset deployment environment is a non-K8S cluster deployment environment; The implementation unit is used to implement the functions of the custom controller through the custom resource definition technology in the cloud native custom resource usage environment.
9. The device according to claim 8, characterized in that The deployment unit of the distributed key-value storage database includes: A first running module is used to run the distributed key-value storage database on the host machine in the form of a host machine service; wherein the distributed key-value storage database is a single-point distributed key-value storage database; and the host machine service runs the distributed key-value storage database in the form of a container; The first startup module is used to start the container to mount the host directory during the operation of the host machine, and use the host directory as the storage directory to complete the deployment process of the distributed key-value storage database.
10. The device according to claim 8, characterized in that The deployment unit of the server program includes: The second running module is used to run the server program on the host machine in the form of a host machine service; wherein the server program is a single-point server program; and the database address used by the server program is a single-point database address; The mounting module is used to start the server program through the container mode during the operation of the host machine, and mount the certificate files required for the operation of the server program into the container through the mounting directory to complete the deployment process of the server program.