Service orchestration control method and device based on Yaml template

CN115865718BActive Publication Date: 2025-01-17SHENZHEN COMTOP INFORMATION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211577463.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-05
Publication Date
2025-01-17
Estimated Expiration
2042-12-05

AI Technical Summary

Technical Problem

[0011]以上的几种部署方式,均是针对K8s集群本身的部署,对于系统环境、容器运行时以及节点网络插件等方面无法做到一站式配置部署;若想要部署一个能用的K8s集群,除了集群本身的安装部署外,还需要在其他方面进行大量配置,部署步骤仍然十分繁琐

Benefits of technology

[0069] In the embodiment of the present invention, a service orchestration management and control method based on Yaml template is provided. The method includes: determining at least one cluster parameter of the cluster to be created according to the predetermined cluster deployment requirements. The cluster parameters include the cluster parameters corresponding to the cluster to be created. Cluster information and network information corresponding to the cluster network. The cluster network is used to realize communication between different nodes in the cluster to be created. All the determined cluster parameters are classified according to the parameters corresponding to each cluster parameter. Perform parameter preprocessing operations for each cluster parameter to obtain the preprocessing results corresponding to each cluster parameter; combine the preprocessing results corresponding to all cluster parameters based on the preset Yaml template to generate the cluster configuration file and target execution corresponding to the cluster to be created. Script; create a target cluster based on the cluster configuration file, target execution script, pre-configured system environment and multiple identified cluster installation components. The target cluster is a cluster that matches the cluster deployment requirements. It can be seen that the implementation of the present invention can automatically determine cluster parameters according to cluster deployment requests, thereby performing parameter preprocessing operations according to parameter classification based on the cluster parameters, improving the classification efficiency and classification accuracy of cluster parameters; and then based on all preprocessing results and The Yaml template generates cluster configuration files and target execution scripts. The system environment and cluster installation components are then integrated to create the target cluster, which improves the creation efficiency, accuracy and reliability of the target cluster. The created target cluster is based on the Yaml template, which shields complex cluster configurations and options and simplifies cluster deployment. Difficulty can also improve cluster deployment efficiency and deployment accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115865718B_ABST
    Figure CN115865718B_ABST
Patent Text Reader

Abstract

The present invention discloses a service orchestration control method and device based on a Yaml template, the method comprising: determining at least one cluster parameter of a cluster to be created according to a predetermined cluster deployment requirement; for all determined cluster parameters, performing parameter preprocessing operations on each cluster parameter according to the parameter classification corresponding to each cluster parameter, and obtaining a preprocessing result corresponding to each cluster parameter; generating a cluster configuration file and a target execution script corresponding to the cluster to be created according to a preset Yaml template combined with the preprocessing results corresponding to all cluster parameters; creating a target cluster according to the cluster configuration file, the target execution script, the preconfigured system environment combined with a plurality of determined cluster installation components, and the target cluster is a cluster that matches the cluster deployment requirements. It can be seen that the implementation of the present invention can reduce the deployment difficulty of the K8s cluster and improve the deployment efficiency of the K8s cluster.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cluster orchestration control, and in particular to a service orchestration control method and device based on YAML template. Background Art

[0002] The traditional Kubernetes deployment steps mainly include: a. Environment preprocessing; b. Container installation based on cluster version; c. Installation of multiple Kubernetes components; d. Network configuration; e. Master node initialization, sub-node deployment, and cluster deployment. Among them, the traditional deployment methods for Kubernetes clusters mainly include the following methods:

[0003] 1. Deploy through the officially released binary package;

[0004] In this mode, the official binary installation packages of each component are provided, and users are required to deploy and configure each component separately. The deployment is more complicated and difficult.

[0005] 2. Deploy through the official kubeadm tool;

[0006] The official quick deployment tool simplifies the component deployment steps, that is, c in the above deployment steps; but steps such as abde are still required.

[0007] 3. Cluster deployment through helm tool;

[0008] helm is an official K8s package management tool that supports version management and control. It dynamically generates k8s configuration files and then automatically calls k8s resources for deployment through kubectl.

[0009] 4. Use kops for deployment;

[0010] Kops is the official kubernete Operations, which is used for the installation, upgrade, and management of K8s. It focuses on the deployment of K8s clusters on cloud platforms and supports platforms such as AWS (Amazon Cloud), GCE (Google Cloud), and VMware vSphere.

[0011] The above deployment methods are all for the deployment of the K8s cluster itself, and cannot provide one-stop configuration and deployment for the system environment, container runtime, and node network plug-ins. If you want to deploy a usable K8s cluster, in addition to the installation and deployment of the cluster itself, you also need to perform a lot of configuration in other aspects, and the deployment steps are still very cumbersome. It can be seen that it is particularly important to provide a method to reduce the difficulty of K8s cluster deployment and improve the efficiency of K8s cluster deployment. Summary of the invention

[0012] The technical problem to be solved by the present invention is to provide a service orchestration control method and device based on YAML template, which can reduce the deployment difficulty of K8s cluster and improve the deployment efficiency of K8s cluster.

[0013] In order to solve the above technical problems, the first aspect of the present invention discloses a service orchestration control method based on a YAML template, the method comprising:

[0014] Determine at least one cluster parameter of the cluster to be created according to a predetermined cluster deployment requirement, wherein the cluster parameter includes cluster information corresponding to the cluster to be created and network information corresponding to a cluster network, wherein the cluster network is used to realize communication between different nodes of the cluster to be created;

[0015] For all the determined cluster parameters, according to the parameter classification corresponding to each cluster parameter, a parameter preprocessing operation is performed on each cluster parameter to obtain a preprocessing result corresponding to each cluster parameter;

[0016] Generate a cluster configuration file and a target execution script corresponding to the cluster to be created according to a preset YAML template combined with preprocessing results corresponding to all the cluster parameters;

[0017] A target cluster is created according to the cluster configuration file, the target execution script, the pre-configured system environment and a plurality of determined cluster installation components. The target cluster is a cluster that matches the cluster deployment requirement.

[0018] As an optional implementation, in the first aspect of the present invention, the cluster information includes at least one of a cluster identifier corresponding to the cluster to be created, a deployment host corresponding to the cluster to be created, node information of a deployment node corresponding to the cluster to be created, and a version corresponding to the cluster to be created, wherein the deployment node includes a master node and child nodes, and each of the master nodes includes at least one child node;

[0019] The network information corresponding to the cluster network includes a network plug-in type of the cluster network, and each network plug-in type corresponds to a node communication control mode.

[0020] As an optional implementation manner, in the first aspect of the present invention, for all the determined cluster parameters, according to the parameter classification corresponding to each of the cluster parameters, a parameter preprocessing operation is performed on each of the cluster parameters to obtain a preprocessing result corresponding to each of the cluster parameters, including:

[0021] According to the determined version corresponding to the cluster to be created, determine a target version for performing parameter preprocessing on the cluster parameters, the target version including a container runtime type and a container runtime version, a cluster component version of the cluster to be created, a storage plug-in version, a DNS version, a monitoring plug-in, and at least one of a container plug-in version, each of the target versions has a version classification corresponding to the target version as a parameter classification of the cluster parameters corresponding to the target version;

[0022] According to the target version, according to the parameter classification corresponding to each cluster parameter, a parameter preprocessing operation is performed on each cluster parameter to obtain a preprocessing result corresponding to each cluster parameter.

[0023] As an optional implementation, in the first aspect of the present invention, the cluster configuration file includes a cluster initialization file and a network plug-in configuration file, and the network plug-in configuration file includes a first network plug-in file and a second network plug-in file;

[0024] The target execution script includes a cluster execution script and a container installation script.

[0025] As an optional implementation, in the first aspect of the present invention, creating a target cluster according to the cluster configuration file, the target execution script, the pre-configured system environment and a plurality of determined cluster installation components includes:

[0026] According to the cluster initialization file, a first configuration operation is performed on a first control parameter corresponding to the cluster initialization file to obtain a first configuration result corresponding to the first control parameter, wherein the first control parameter includes at least one of a cluster version of the cluster to be created, a network address and port corresponding to the cluster to be created, a container runtime, an image repository address, and an external interface version of the cluster to be created;

[0027] According to the network configuration file, a second configuration operation is performed on a second control parameter corresponding to the cluster to be created, so as to obtain a second configuration result corresponding to the second control parameter;

[0028] According to the target execution script combined with the pre-configured system environment, a third configuration operation is performed on the determined cluster installation component to obtain a third configuration result corresponding to the cluster installation component, and a target cluster is created based on the first configuration result, the second configuration result and the third configuration result.

[0029] As an optional implementation manner, in the first aspect of the present invention, the second control parameter includes a first plug-in parameter and a second plug-in parameter, the first plug-in parameter is a parameter corresponding to the first network plug-in file, and the second plug-in parameter is a file corresponding to the second network plug-in file, and according to the network configuration file, performing a second configuration operation on the second control parameter corresponding to the cluster to be created, and obtaining a second configuration result corresponding to the second control parameter, including:

[0030] According to the first network plug-in file, a first-level configuration operation is performed on the first plug-in parameter to obtain a first-level configuration result corresponding to the first plug-in parameter, wherein the first plug-in parameter includes at least one of a cluster interface version, a cluster network address and port, and a dependent package version of the first network plug-in corresponding to the cluster to be created, and the first network plug-in is a plug-in corresponding to the first network plug-in file;

[0031] According to the second network plug-in file, a secondary configuration operation is performed on the second network plug-in to obtain a secondary configuration result corresponding to the second plug-in, wherein the second network plug-in is a plug-in corresponding to the second network plug-in file, and the second plug-in is used to provide network services and network policies for the cluster system corresponding to the cluster to be created;

[0032] The first-level configuration result and the second-level configuration result are determined as the second configuration result corresponding to the second control parameter.

[0033] As an optional implementation, in the first aspect of the present invention, the executing script according to the target in combination with the pre-configured system environment, performing a third configuration operation on the determined cluster installation component, and obtaining a third configuration result corresponding to the cluster installation component, includes:

[0034] According to the cluster execution script combined with the pre-configured system environment, an installation control operation is performed on the first script parameter controlled by the cluster execution script to obtain an installation control result corresponding to the first script parameter, wherein the first script parameter includes a cluster component, a network plug-in, and a storage plug-in corresponding to the target cluster;

[0035] According to the cluster execution script, a configuration control operation is performed on a second script parameter controlled by the cluster execution script to obtain a configuration control result corresponding to the second script parameter, where the second script parameter includes a cluster network corresponding to the cluster to be created;

[0036] According to the container installation script, perform container control operations on the container installation service and the initialization container service controlled by the container installation script to obtain corresponding container control results;

[0037] The installation control result, the configuration control result, and the container control result are determined as a third configuration result corresponding to the cluster installation component.

[0038] A second aspect of the present invention discloses a service orchestration control device based on a YAML template, the device comprising:

[0039] A determination module, configured to determine at least one cluster parameter of a cluster to be created according to a predetermined cluster deployment requirement, wherein the cluster parameter includes cluster information corresponding to the cluster to be created and network information corresponding to a cluster network, wherein the cluster network is used to realize communication between different nodes of the cluster to be created;

[0040] A preprocessing module, used for performing parameter preprocessing operations on all determined cluster parameters according to parameter classifications corresponding to each cluster parameter, and obtaining preprocessing results corresponding to each cluster parameter;

[0041] A generation module, used to generate a cluster configuration file and a target execution script corresponding to the cluster to be created according to a preset Yaml template combined with preprocessing results corresponding to all the cluster parameters;

[0042] A creation module is used to create a target cluster according to the cluster configuration file, the target execution script, a pre-configured system environment and a plurality of determined cluster installation components, wherein the target cluster is a cluster matching the cluster deployment requirements.

[0043] As an optional implementation, in the second aspect of the present invention, the cluster information includes at least one of a cluster identifier corresponding to the cluster to be created, a deployment host corresponding to the cluster to be created, node information of a deployment node corresponding to the cluster to be created, and a version corresponding to the cluster to be created, wherein the deployment node includes a master node and child nodes, and each of the master nodes includes at least one child node;

[0044] The network information corresponding to the cluster network includes a network plug-in type of the cluster network, and each network plug-in type corresponds to a node communication control mode.

[0045] As an optional implementation, in the second aspect of the present invention, the preprocessing module performs parameter preprocessing operations on all determined cluster parameters according to the parameter classification corresponding to each cluster parameter, and obtains the preprocessing results corresponding to each cluster parameter in a manner specifically including:

[0046] According to the determined version corresponding to the cluster to be created, determine a target version for performing parameter preprocessing on the cluster parameters, the target version including a container runtime type and a container runtime version, a cluster component version of the cluster to be created, a storage plug-in version, a DNS version, a monitoring plug-in, and at least one of a container plug-in version, each of the target versions has a version classification corresponding to the target version as a parameter classification of the cluster parameters corresponding to the target version;

[0047] According to the target version, according to the parameter classification corresponding to each cluster parameter, a parameter preprocessing operation is performed on each cluster parameter to obtain a preprocessing result corresponding to each cluster parameter.

[0048] As an optional implementation, in the second aspect of the present invention, the cluster configuration file includes a cluster initialization file and a network plug-in configuration file, and the network plug-in configuration file includes a first network plug-in file and a second network plug-in file;

[0049] The target execution script includes a cluster execution script and a container installation script.

[0050] As an optional implementation, in the second aspect of the present invention, the creation module includes:

[0051] A first configuration submodule is used to perform a first configuration operation on a first control parameter corresponding to the cluster initialization file according to the cluster initialization file to obtain a first configuration result corresponding to the first control parameter, wherein the first control parameter includes at least one of a cluster version of the cluster to be created, a network address and port corresponding to the cluster to be created, a container runtime, an image repository address, and an external interface version of the cluster to be created;

[0052] A second configuration submodule, configured to perform a second configuration operation on a second control parameter corresponding to the cluster to be created according to the network configuration file, and obtain a second configuration result corresponding to the second control parameter;

[0053] The third configuration submodule is used to perform a third configuration operation on the determined cluster installation component according to the target execution script in combination with a pre-configured system environment, obtain a third configuration result corresponding to the cluster installation component, and create a target cluster according to the first configuration result, the second configuration result and the third configuration result.

[0054] As an optional implementation, in the second aspect of the present invention, the second control parameter includes a first plug-in parameter and a second plug-in parameter, the first plug-in parameter is a parameter corresponding to the first network plug-in file, and the second plug-in parameter is a file corresponding to the second network plug-in file. The second configuration submodule performs a second configuration operation on the second control parameter corresponding to the cluster to be created according to the network configuration file, and the manner of obtaining the second configuration result corresponding to the second control parameter specifically includes:

[0055] According to the first network plug-in file, a first-level configuration operation is performed on the first plug-in parameter to obtain a first-level configuration result corresponding to the first plug-in parameter, wherein the first plug-in parameter includes at least one of a cluster interface version, a cluster network address and port, and a dependent package version of the first network plug-in corresponding to the cluster to be created, and the first network plug-in is a plug-in corresponding to the first network plug-in file;

[0056] According to the second network plug-in file, a secondary configuration operation is performed on the second network plug-in to obtain a secondary configuration result corresponding to the second plug-in, wherein the second network plug-in is a plug-in corresponding to the second network plug-in file, and the second plug-in is used to provide network services and network policies for the cluster system corresponding to the cluster to be created;

[0057] The first-level configuration result and the second-level configuration result are determined as the second configuration result corresponding to the second control parameter.

[0058] As an optional implementation, in the second aspect of the present invention, the third configuration submodule performs a third configuration operation on the determined cluster installation component according to the target execution script in combination with the pre-configured system environment, and the manner in which the third configuration result corresponding to the cluster installation component is obtained specifically includes:

[0059] According to the cluster execution script combined with the pre-configured system environment, an installation control operation is performed on the first script parameter controlled by the cluster execution script to obtain an installation control result corresponding to the first script parameter, wherein the first script parameter includes a cluster component, a network plug-in, and a storage plug-in corresponding to the target cluster;

[0060] According to the cluster execution script, a configuration control operation is performed on a second script parameter controlled by the cluster execution script to obtain a configuration control result corresponding to the second script parameter, where the second script parameter includes a cluster network corresponding to the cluster to be created;

[0061] According to the container installation script, perform container control operations on the container installation service and the initialization container service controlled by the container installation script to obtain corresponding container control results;

[0062] The installation control result, the configuration control result, and the container control result are determined as a third configuration result corresponding to the cluster installation component.

[0063] The third aspect of the present invention discloses another service orchestration control device based on YAML template, the device comprising:

[0064] A memory storing executable program code;

[0065] a processor coupled to the memory;

[0066] The processor calls the executable program code stored in the memory to execute the service orchestration and control method based on the YAML template disclosed in the first aspect of the present invention.

[0067] The fourth aspect of the present invention discloses a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute the service orchestration and control method based on YAML template disclosed in the first aspect of the present invention.

[0068] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0069] In an embodiment of the present invention, a service orchestration control method based on a YAML template is provided, the method comprising: determining at least one cluster parameter of a cluster to be created according to a predetermined cluster deployment requirement, the cluster parameter comprising cluster information corresponding to the cluster to be created and network information corresponding to a cluster network, the cluster network being used to realize communication between different nodes of the cluster to be created; for all determined cluster parameters, performing a parameter preprocessing operation on each cluster parameter according to a parameter classification corresponding to each cluster parameter, and obtaining a preprocessing result corresponding to each cluster parameter; generating a cluster configuration file and a target execution script corresponding to the cluster to be created according to a preset YAML template combined with the preprocessing results corresponding to all cluster parameters; creating a target cluster according to the cluster configuration file, the target execution script, the preconfigured system environment and a plurality of determined cluster installation components, the target cluster being a cluster matching the cluster deployment requirement. It can be seen that the implementation of the present invention can automatically determine cluster parameters according to the cluster deployment request, thereby performing parameter preprocessing operations based on the cluster parameters according to parameter classification, thereby improving the classification efficiency and classification accuracy of the cluster parameters; then generating a cluster configuration file and a target execution script based on all the preprocessing results and the Yaml template, and then creating a target cluster based on the system environment and cluster installation components, thereby improving the creation efficiency, creation accuracy and reliability of the target cluster. The created target cluster is based on the Yaml template, which shields complex cluster configurations and options, simplifies the difficulty of cluster deployment, and can also improve the cluster deployment efficiency and deployment accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0071] Figure 1 It is a flow chart of a service orchestration and control method based on a YAML template disclosed in an embodiment of the present invention;

[0072] Figure 2 It is a flow chart of another service orchestration and control method based on YAML template disclosed in an embodiment of the present invention;

[0073] Figure 3 It is a structural diagram of a service orchestration control device based on a YAML template disclosed in an embodiment of the present invention;

[0074] Figure 4 It is a schematic diagram of the structure of the creation module disclosed in the embodiment of the present invention;

[0075] Figure 5 It is a structural diagram of another service orchestration control device based on YAML template disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0076] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0077] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or end including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or ends.

[0078] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0079] The present invention discloses a service arrangement control method and device based on a Yaml template, which can automatically determine cluster parameters according to a cluster deployment request, thereby performing parameter preprocessing operations according to parameter classification based on the cluster parameters, thereby improving the classification efficiency and classification accuracy of cluster parameters; further, based on all preprocessing results and the Yaml template, a cluster configuration file and a target execution script are generated, and then a target cluster is created based on the system environment and cluster installation components, thereby improving the creation efficiency, creation accuracy and reliability of the target cluster. The created target cluster is based on a Yaml template, shielding complex cluster configurations and options, simplifying the difficulty of cluster deployment, and improving the cluster deployment efficiency and deployment accuracy. The following are detailed descriptions.

[0080] Embodiment 1

[0081] See also Figure 1 , Figure 1 : is a flow chart of a service orchestration and control method based on a YAML template disclosed in an embodiment of the present invention. Figure 1 The described service orchestration control method based on Yaml template can be applied to a service orchestration control device based on Yaml template, and the embodiment of the present invention does not limit it. Figure 1 As shown, the service orchestration control method based on the YAML template may include the following operations:

[0082] 101. Determine at least one cluster parameter of a cluster to be created according to a predetermined cluster deployment requirement.

[0083] In the embodiment of the present invention, the cluster parameters include cluster information corresponding to the cluster to be created and network information corresponding to the cluster network, and the cluster network is used to realize communication between different nodes in the cluster to be created.

[0084] In an embodiment of the present invention, the cluster information includes at least one of a cluster identifier corresponding to the cluster to be created, a deployment host corresponding to the cluster to be created, node information of a deployment node corresponding to the cluster to be created, and a version corresponding to the cluster to be created, wherein the deployment node includes a master node and child nodes, and each master node includes at least one child node.

[0085] In the embodiment of the present invention, the network information corresponding to the cluster network includes the network plug-in type of the cluster network, and each network plug-in type corresponds to a node communication control mode.

[0086] 102. For all the determined cluster parameters, according to the parameter classification corresponding to each cluster parameter, a parameter preprocessing operation is performed on each cluster parameter to obtain a preprocessing result corresponding to each cluster parameter.

[0087] 103. Generate a cluster configuration file and a target execution script corresponding to the cluster to be created according to the preset YAML template and the preprocessing results corresponding to all cluster parameters.

[0088] 104. Create a target cluster according to the cluster configuration file, the target execution script, the pre-configured system environment and the multiple determined cluster installation components.

[0089] In the embodiment of the present invention, the target cluster is a cluster that matches the cluster deployment requirement.

[0090] It should be noted that after the target cluster is created, the deployment parameters of the cluster are fed back to the user through a visual interface. The visual interface supports operations such as container cluster display, cluster status display, cluster creation, update and deletion; supports cluster variable configuration, environment selection, K8s version selection, network type selection, whether to deploy a high-availability cluster, etc.; supports basic cluster information display, cluster pod management, cluster deployment service management, cluster release, cluster node addition and deletion, cluster storage management, and cluster monitoring information; supports information display of cluster deployment services, including service namespace, name, port and other information.

[0091] It can be seen that implementation Figure 1 The described service orchestration and control method based on YAML template can automatically determine cluster parameters according to cluster deployment requests, thereby performing parameter preprocessing operations according to parameter classification based on the cluster parameters, thereby improving the classification efficiency and classification accuracy of cluster parameters; then, based on all the preprocessing results and the YAML template, a cluster configuration file and a target execution script are generated, and then the target cluster is created by integrating the system environment and cluster installation components, thereby improving the creation efficiency, creation accuracy and reliability of the target cluster. The created target cluster is based on the YAML template, which shields complex cluster configurations and options, simplifies the difficulty of cluster deployment, and can also improve the cluster deployment efficiency and deployment accuracy.

[0092] Embodiment 2

[0093] See also Figure 2 , Figure 2 : is a flow chart of another service orchestration and control method based on Yaml template disclosed in an embodiment of the present invention. Figure 2 The described service orchestration control method based on Yaml template can be applied to a service orchestration control device based on Yaml template, and the embodiment of the present invention does not limit it. Figure 2 As shown, the service orchestration control method based on the YAML template may include the following operations:

[0094] 201. Determine at least one cluster parameter of a cluster to be created according to a predetermined cluster deployment requirement.

[0095] 202. Determine a target version for performing parameter preprocessing on cluster parameters according to the determined version corresponding to the cluster to be created.

[0096] In an embodiment of the present invention, the target version includes at least one of the container runtime type and container runtime version, the cluster component version of the cluster to be created, the storage plug-in version, the DNS version, the monitoring plug-in and the container plug-in version. For each target version, there is a version classification corresponding to the target version, which serves as a parameter classification of the cluster parameters corresponding to the target version.

[0097] 203. According to the target version, and according to the parameter classification corresponding to each cluster parameter, a parameter preprocessing operation is performed on each cluster parameter to obtain a preprocessing result corresponding to each cluster parameter.

[0098] 204. Generate a cluster configuration file and a target execution script corresponding to the cluster to be created according to the preset YAML template and the preprocessing results corresponding to all cluster parameters.

[0099] 205. Create a target cluster according to the cluster configuration file, the target execution script, the pre-configured system environment and the multiple determined cluster installation components.

[0100] In the embodiment of the present invention, the target cluster (K8s) finally created and orchestrated realizes complete container cluster management, supports K8s container cluster non-aware deployment, K8s multi-version quick deployment, custom network plug-ins, supports container cluster expansion and reduction, supports cluster pod management, and supports cluster service management.

[0101] In the embodiment of the present invention, for other descriptions of step 201 and step 204-step 205, please refer to other specific descriptions of step 101, step 103 and step 104 in embodiment 1, and the embodiment of the present invention will not be repeated here.

[0102] It can be seen that implementation Figure 2The described service orchestration control method based on YAML template can automatically determine the target version required for preprocessing cluster parameters based on the version corresponding to the cluster to be created, and then accurately preprocess each cluster parameter based on the target version and the parameter classification corresponding to each cluster parameter, thereby improving the preprocessing efficiency and accuracy of each cluster parameter, thereby facilitating the feasibility of the subsequent process of fault reporting, that is, improving the accuracy of the created target cluster to a certain extent.

[0103] In an optional embodiment, the cluster configuration file includes a cluster initialization file and a network plug-in configuration file, and the network plug-in configuration file includes a first network plug-in file and a second network plug-in file;

[0104] The target execution script includes the cluster execution script and the container installation script;

[0105] Optionally, the method of creating the target cluster according to the cluster configuration file, the target execution script, the pre-configured system environment and the multiple determined cluster installation components specifically includes:

[0106] According to the cluster initialization file, a first configuration operation is performed on a first control parameter corresponding to the cluster initialization file to obtain a first configuration result corresponding to the first control parameter, where the first control parameter includes at least one of a cluster version of the cluster to be created, a network address and port corresponding to the cluster to be created, a container runtime, an image repository address, and an external interface version of the cluster to be created;

[0107] According to the network configuration file, a second configuration operation is performed on a second control parameter corresponding to the cluster to be created, so as to obtain a second configuration result corresponding to the second control parameter;

[0108] According to the target execution script combined with the pre-configured system environment, a third configuration operation is performed on the determined cluster installation component to obtain a third configuration result corresponding to the cluster installation component, and a target cluster is created according to the first configuration result, the second configuration result and the third configuration result.

[0109] In this optional embodiment, the second control parameter includes a first plug-in parameter and a second plug-in parameter, the first plug-in parameter is a parameter corresponding to the first network plug-in file, and the second plug-in parameter is a file corresponding to the second network plug-in file. The above method of performing a second configuration operation on the second control parameter corresponding to the cluster to be created according to the network configuration file to obtain a second configuration result corresponding to the second control parameter specifically includes:

[0110] According to the first network plug-in file, a first-level configuration operation is performed on the first plug-in parameter to obtain a first-level configuration result corresponding to the first plug-in parameter, wherein the first plug-in parameter includes at least one of a cluster interface version, a cluster network address and port, and a dependent package version of the first network plug-in corresponding to the cluster to be created, and the first network plug-in is a plug-in corresponding to the first network plug-in file, and the first network plug-in may be a flannel plug-in;

[0111] According to the second network plug-in file, perform secondary configuration operations on the second network plug-in to obtain the secondary configuration result corresponding to the second plug-in. The second network plug-in is a plug-in corresponding to the second network plug-in file. The second plug-in is used to provide network services and network policies for the cluster system corresponding to the cluster to be created. The second network plug-in can be a calico plug-in. Optionally, the calico can provide network services and network policies for the K8s system alone, or it can be integrated with flannel to realize network services by flannel and calico only provides network policies.

[0112] The first-level configuration result and the second-level configuration result are determined as the second configuration result corresponding to the second control parameter.

[0113] Optionally, the method of performing the third configuration operation on the determined cluster installation component according to the target execution script in combination with the pre-configured system environment to obtain the third configuration result corresponding to the cluster installation component specifically includes:

[0114] According to the cluster execution script combined with the pre-configured system environment, an installation control operation is performed on the first script parameter controlled by the cluster execution script to obtain an installation control result corresponding to the first script parameter, where the first script parameter includes a cluster component, a network plug-in, and a storage plug-in corresponding to the target cluster;

[0115] According to the cluster execution script, a configuration control operation is performed on a second script parameter controlled by the cluster execution script to obtain a configuration control result corresponding to the second script parameter, where the second script parameter includes a cluster network corresponding to the cluster to be created;

[0116] According to the container installation script, perform container control operations on the container installation service and the initialization container service controlled by the container installation script to obtain corresponding container control results;

[0117] The installation control result, the configuration control result, and the container control result are determined as the third configuration result corresponding to the cluster installation component.

[0118] It can be seen that in this optional embodiment, based on the cluster configuration file and the target execution script, the cluster configuration file and the target execution script respectively and accurately execute the first, second and third configuration operations on the first, second and third control parameters in a targeted manner, and finally the target cluster is created by integrating the results corresponding to the three configuration operations, thereby improving the creation reliability and accuracy of the target cluster.

[0119] Embodiment 3

[0120] See also Figure 3 , Figure 3 It is a structural diagram of a service orchestration control device based on a Yaml template disclosed in an embodiment of the present invention. Among them, the service orchestration control device based on a Yaml template can be a service orchestration control terminal based on a Yaml template, a service orchestration control device based on a Yaml template, a service orchestration control system based on a Yaml template, or a service orchestration control server based on a Yaml template. The service orchestration control server based on a Yaml template can be a local server, a remote server, or a cloud server (also called a cloud server). When the service orchestration control server based on a Yaml template is a non-cloud server, the non-cloud server can communicate with the cloud server, which is not limited in the embodiment of the present invention. Figure 3 As shown, the service orchestration control device based on the Yaml template may include a determination module 301, a preprocessing module 302, a generation module 303 and a creation module 304, wherein:

[0121] The determination module 301 is used to determine at least one cluster parameter of the cluster to be created according to a predetermined cluster deployment requirement. The cluster parameter includes cluster information corresponding to the cluster to be created and network information corresponding to the cluster network. The cluster network is used to realize communication between different nodes of the cluster to be created.

[0122] Among them, the cluster information includes at least one of the cluster identifier corresponding to the cluster to be created, the deployment host corresponding to the cluster to be created, the node information of the deployment node corresponding to the cluster to be created, and the version corresponding to the cluster to be created, wherein the deployment node includes a master node and child nodes, and each master node includes at least one child node; the network information corresponding to the cluster network includes the network plug-in type of the cluster network, and each network plug-in type corresponds to a node communication control method.

[0123] The preprocessing module 302 is used to perform parameter preprocessing operations on all determined cluster parameters according to the parameter classification corresponding to each cluster parameter, so as to obtain preprocessing results corresponding to each cluster parameter.

[0124] The generation module 303 is used to generate a cluster configuration file and a target execution script corresponding to the cluster to be created according to a preset Yaml template combined with preprocessing results corresponding to all cluster parameters.

[0125] The creation module 304 is used to create a target cluster according to the cluster configuration file, the target execution script, the pre-configured system environment and the multiple determined cluster installation components, where the target cluster is a cluster that matches the cluster deployment requirements.

[0126] It can be seen that implementation Figure 3 The described service orchestration control device based on YAML template can automatically determine cluster parameters according to cluster deployment requests, thereby performing parameter preprocessing operations according to parameter classification based on the cluster parameters, thereby improving the classification efficiency and classification accuracy of cluster parameters; then generating cluster configuration files and target execution scripts based on all preprocessing results and YAML templates, and then creating a target cluster based on the system environment and cluster installation components, thereby improving the creation efficiency, creation accuracy and reliability of the target cluster. The created target cluster is based on the YAML template, shielding complex cluster configurations and options, simplifying the difficulty of cluster deployment, and improving the cluster deployment efficiency and deployment accuracy.

[0127] In an optional embodiment, the preprocessing module 302 performs parameter preprocessing operations on all determined cluster parameters according to the parameter classification corresponding to each cluster parameter, and the manner in which the preprocessing results corresponding to each cluster parameter are obtained specifically includes:

[0128] According to the determined version corresponding to the cluster to be created, determine the target version for performing parameter preprocessing on the cluster parameters, the target version includes at least one of the container runtime type and container runtime version, cluster component version of the cluster to be created, storage plug-in version, DNS version, monitoring plug-in and container plug-in version, and each target version has a version classification corresponding to the target version as the parameter classification of the cluster parameters corresponding to the target version;

[0129] According to the target version, according to the parameter classification corresponding to each cluster parameter, a parameter preprocessing operation is performed on each cluster parameter to obtain a preprocessing result corresponding to each cluster parameter.

[0130] It can be seen that in this optional embodiment, the target version required for preprocessing cluster parameters can be automatically determined based on the version corresponding to the cluster to be created, so that based on the target version and combined with the parameter classification corresponding to each cluster parameter, each cluster parameter can be accurately preprocessed, thereby improving the preprocessing efficiency and preprocessing accuracy of each cluster parameter, thereby facilitating the feasibility of the subsequent process of fault reporting, that is, improving the accuracy of the created target cluster to a certain extent.

[0131] In another optional embodiment, the cluster configuration file includes a cluster initialization file and a network plug-in configuration file, and the network plug-in configuration file includes a first network plug-in file and a second network plug-in file;

[0132] The target execution scripts include cluster execution scripts and container installation scripts.

[0133] Optional, such as Figure 4 As shown, the creation module 304 may include a first configuration submodule 3041, a second configuration submodule 3042, and a third configuration submodule 3043, wherein:

[0134] The first configuration submodule 3041 is used to perform a first configuration operation on a first control parameter corresponding to the cluster initialization file according to the cluster initialization file, and obtain a first configuration result corresponding to the first control parameter. The first control parameter includes at least one of the cluster version of the cluster to be created, the network address and port corresponding to the cluster to be created, the container runtime, the image repository address, and the external interface version of the cluster to be created.

[0135] The second configuration submodule 3042 is used to perform a second configuration operation on a second control parameter corresponding to the cluster to be created according to the network configuration file, and obtain a second configuration result corresponding to the second control parameter.

[0136] The third configuration submodule 3043 is used to perform a third configuration operation on the determined cluster installation component according to the target execution script combined with the pre-configured system environment, obtain a third configuration result corresponding to the cluster installation component, and create a target cluster according to the first configuration result, the second configuration result and the third configuration result.

[0137] In this optional embodiment, the second control parameter includes a first plug-in parameter and a second plug-in parameter, the first plug-in parameter is a parameter corresponding to the first network plug-in file, and the second plug-in parameter is a file corresponding to the second network plug-in file. The second configuration submodule 3042 performs a second configuration operation on the second control parameter corresponding to the cluster to be created according to the network configuration file, and the manner in which the second configuration result corresponding to the second control parameter is obtained specifically includes:

[0138] According to the first network plug-in file, a first-level configuration operation is performed on the first plug-in parameter to obtain a first-level configuration result corresponding to the first plug-in parameter, wherein the first plug-in parameter includes at least one of a cluster interface version, a cluster network address and port, and a dependent package version of the first network plug-in corresponding to the cluster to be created, and the first network plug-in is a plug-in corresponding to the first network plug-in file;

[0139] According to the second network plug-in file, a secondary configuration operation is performed on the second network plug-in to obtain a secondary configuration result corresponding to the second plug-in, where the second network plug-in is a plug-in corresponding to the second network plug-in file, and the second plug-in is used to provide network services and network policies for the cluster system corresponding to the cluster to be created;

[0140] The first-level configuration result and the second-level configuration result are determined as the second configuration result corresponding to the second control parameter.

[0141] Optionally, the third configuration submodule 3043 performs a third configuration operation on the determined cluster installation component according to the target execution script and the pre-configured system environment, and obtains a third configuration result corresponding to the cluster installation component in the following manner:

[0142] According to the cluster execution script combined with the pre-configured system environment, an installation control operation is performed on the first script parameter controlled by the cluster execution script to obtain an installation control result corresponding to the first script parameter, where the first script parameter includes a cluster component, a network plug-in, and a storage plug-in corresponding to the target cluster;

[0143] According to the cluster execution script, a configuration control operation is performed on a second script parameter controlled by the cluster execution script to obtain a configuration control result corresponding to the second script parameter, where the second script parameter includes a cluster network corresponding to the cluster to be created;

[0144] According to the container installation script, perform container control operations on the container installation service and the initialization container service controlled by the container installation script to obtain corresponding container control results;

[0145] The installation control result, the configuration control result, and the container control result are determined as the third configuration result corresponding to the cluster installation component.

[0146] It can be seen that in this optional embodiment, based on the cluster configuration file and the target execution script, the cluster configuration file and the target execution script respectively and accurately execute the first, second and third configuration operations on the first, second and third control parameters in a targeted manner, and finally the target cluster is created by integrating the results corresponding to the three configuration operations, thereby improving the creation reliability and accuracy of the target cluster.

[0147] Embodiment 4

[0148] See also Figure 5 , Figure 5 FIG. 1 is a schematic diagram of the structure of another service orchestration control device based on a YAML template disclosed in an embodiment of the present invention. Figure 5 As shown, the service orchestration control device based on the Yaml template may include:

[0149] A memory 401 storing executable program codes;

[0150] a processor 402 coupled to the memory 401;

[0151] The processor 402 calls the executable program code stored in the memory 401 to execute the steps in the service orchestration and control method based on the YAML template described in the first embodiment of the present invention or the second embodiment of the present invention.

[0152] Embodiment 5

[0153] An embodiment of the present invention discloses a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute the steps of the service orchestration and control method based on the YAML template described in Embodiment 1 or Embodiment 2 of the present invention.

[0154] Embodiment 6

[0155] An embodiment of the present invention discloses a computer program product, which includes a non-transitory computer storage medium storing a computer program, and the computer program is operable to enable a computer to execute the steps of the service orchestration and control method based on the YAML template described in Embodiment 1 or Embodiment 2.

[0156] The device embodiments described above are only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, i.e., they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0157] Through the specific description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution can be essentially or partly contributed to the prior art in the form of a software product, and the computer software product can be stored in a computer storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0158] Finally, it should be noted that the service orchestration control method and device based on YAML template disclosed in the embodiment of the present invention discloses only the preferred embodiment of the present invention, which is only used to illustrate the technical solution of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, ordinary technicians in this field should understand that the technical solutions recorded in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A service orchestration control method based on YAML template, characterized in that: The method comprises: Determine at least one cluster parameter of the cluster to be created according to a predetermined cluster deployment requirement, wherein the cluster parameter includes cluster information corresponding to the cluster to be created and network information corresponding to a cluster network, wherein the cluster network is used to realize communication between different nodes of the cluster to be created; For all the determined cluster parameters, according to the parameter classification corresponding to each cluster parameter, a parameter preprocessing operation is performed on each cluster parameter to obtain a preprocessing result corresponding to each cluster parameter; Generate a cluster configuration file and a target execution script corresponding to the cluster to be created according to a preset YAML template combined with preprocessing results corresponding to all the cluster parameters; Creating a target cluster according to the cluster configuration file, the target execution script, the pre-configured system environment and a plurality of determined cluster installation components, wherein the target cluster is a cluster matching the cluster deployment requirement; The cluster information includes at least one of a cluster identifier corresponding to the cluster to be created, a deployment host corresponding to the cluster to be created, node information of a deployment node corresponding to the cluster to be created, and a version corresponding to the cluster to be created, wherein the deployment node includes a master node and child nodes, and each of the master nodes includes at least one child node; The network information corresponding to the cluster network includes a network plug-in type of the cluster network, and each network plug-in type corresponds to a node communication control mode; The step of performing parameter preprocessing on all the determined cluster parameters according to the parameter classification corresponding to each cluster parameter to obtain a preprocessing result corresponding to each cluster parameter includes: According to the determined version corresponding to the cluster to be created, determine a target version for performing parameter preprocessing on the cluster parameters, the target version including a container runtime type and a container runtime version, a cluster component version of the cluster to be created, a storage plug-in version, a DNS version, a monitoring plug-in, and at least one of a container plug-in version, each of the target versions has a version classification corresponding to the target version as a parameter classification of the cluster parameters corresponding to the target version; According to the target version, according to the parameter classification corresponding to each cluster parameter, a parameter preprocessing operation is performed on each cluster parameter to obtain a preprocessing result corresponding to each cluster parameter.

2. The service orchestration control method based on YAML template according to claim 1 is characterized in that: The cluster configuration file includes a cluster initialization file and a network plug-in configuration file, and the network plug-in configuration file includes a first network plug-in file and a second network plug-in file; The target execution script includes a cluster execution script and a container installation script.

3. The service orchestration control method based on YAML template according to claim 2 is characterized in that: The step of creating a target cluster according to the cluster configuration file, the target execution script, the pre-configured system environment and the plurality of determined cluster installation components includes: According to the cluster initialization file, a first configuration operation is performed on a first control parameter corresponding to the cluster initialization file to obtain a first configuration result corresponding to the first control parameter, wherein the first control parameter includes at least one of a cluster version of the cluster to be created, a network address and port corresponding to the cluster to be created, a container runtime, an image repository address, and an external interface version of the cluster to be created; According to the network plug-in configuration file, perform a second configuration operation on a second control parameter corresponding to the cluster to be created, and obtain a second configuration result corresponding to the second control parameter; According to the target execution script combined with the pre-configured system environment, a third configuration operation is performed on the determined cluster installation component to obtain a third configuration result corresponding to the cluster installation component, and a target cluster is created based on the first configuration result, the second configuration result and the third configuration result.

4. The service orchestration control method based on YAML template according to claim 3 is characterized in that: The second control parameter includes a first plug-in parameter and a second plug-in parameter, the first plug-in parameter is a parameter corresponding to the first network plug-in file, and the second plug-in parameter is a parameter corresponding to the second network plug-in file. According to the network plug-in configuration file, performing a second configuration operation on the second control parameter corresponding to the cluster to be created to obtain a second configuration result corresponding to the second control parameter includes: According to the first network plug-in file, a first-level configuration operation is performed on the first plug-in parameter to obtain a first-level configuration result corresponding to the first plug-in parameter, wherein the first plug-in parameter includes at least one of a cluster interface version, a cluster network address and port, and a dependent package version of the first network plug-in corresponding to the cluster to be created, and the first network plug-in is a plug-in corresponding to the first network plug-in file; According to the second network plug-in file, a secondary configuration operation is performed on the second network plug-in to obtain a secondary configuration result corresponding to the second network plug-in, where the second network plug-in is a plug-in corresponding to the second network plug-in file, and the second network plug-in is used to provide network services and network policies for the cluster system corresponding to the cluster to be created; The first-level configuration result and the second-level configuration result are determined as the second configuration result corresponding to the second control parameter.

5. The service orchestration control method based on YAML template according to claim 3 or 4, characterized in that: The step of executing the target script in combination with the pre-configured system environment to perform a third configuration operation on the determined cluster installation component to obtain a third configuration result corresponding to the cluster installation component includes: According to the cluster execution script combined with the pre-configured system environment, an installation control operation is performed on the first script parameter controlled by the cluster execution script to obtain an installation control result corresponding to the first script parameter, wherein the first script parameter includes a cluster component, a network plug-in, and a storage plug-in corresponding to the target cluster; According to the cluster execution script, a configuration control operation is performed on a second script parameter controlled by the cluster execution script to obtain a configuration control result corresponding to the second script parameter, where the second script parameter includes a cluster network corresponding to the cluster to be created; According to the container installation script, perform container control operations on the container installation service and the initialization container service controlled by the container installation script to obtain corresponding container control results; The installation control result, the configuration control result, and the container control result are determined as a third configuration result corresponding to the cluster installation component.

6. A service orchestration control device based on YAML template, characterized in that: The device is used to execute the service orchestration control method based on the YAML template according to any one of claims 1 to 5, and the device includes: A determination module, configured to determine at least one cluster parameter of a cluster to be created according to a predetermined cluster deployment requirement, wherein the cluster parameter includes cluster information corresponding to the cluster to be created and network information corresponding to a cluster network, wherein the cluster network is used to realize communication between different nodes of the cluster to be created; A preprocessing module, used for performing parameter preprocessing operations on all determined cluster parameters according to parameter classifications corresponding to each cluster parameter, and obtaining preprocessing results corresponding to each cluster parameter; A generation module, used to generate a cluster configuration file and a target execution script corresponding to the cluster to be created according to a preset YAML template combined with preprocessing results corresponding to all the cluster parameters; A creation module is used to create a target cluster according to the cluster configuration file, the target execution script, a pre-configured system environment and a plurality of determined cluster installation components, wherein the target cluster is a cluster matching the cluster deployment requirements.

7. A service orchestration control device based on YAML template, characterized in that: The device comprises: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the service orchestration and control method based on the YAML template as described in any one of claims 1-5.

8. A computer storage medium, characterized in that The computer storage medium stores computer instructions, which, when called, are used to execute the service orchestration and control method based on the YAML template as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Automatic deployment method for application cluster of cloud platform

    CN108572860A

  • Cluster creation method, first server and readable storage medium

    CN110138577A