Configuration management method, device, equipment and storage medium
By building a new configuration management model, reading and merging the configuration information of the namespace, the problem of multi-level configuration management in Kubernetes containerized services is solved, and the configuration information merging and inheritance of tenants, projects, and resource groups is realized.
Patent Information
- Application Number
- CN202210028021.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-11
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-01-11
AI Technical Summary
The existing configuration management model cannot support configuration management at tenants, projects, resource groups and even more levels in Kubernetes containerized services, especially when application instances are no longer limited to multi-tenant scenarios.
By building a new configuration management model, read the configuration information of each namespace, determine the hierarchical relationship between the namespaces, and merge the configuration information based on the hierarchical relationship to obtain the configuration information of the target namespace.
It realizes configuration management at tenants, projects, resource groups and even more levels, and supports the merge and inheritance of configuration information of complex deployment scenarios in Kubernetes containerized services.
Smart Images

Figure CN114398151B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to a configuration management method, apparatus, device, and storage medium. Background Art
[0002] In recent years, with the development of containerization technology, Kubernetes containerization services have gradually become popular. Kubernetes is an open source application for managing containerization on multiple hosts in a cloud platform.
[0003] Application instances in Kubernetes are no longer limited to multi-tenant scenarios. A tenant's resource group or project can even independently deploy a set of application instances. Existing configuration management models cannot support configuration management at the tenant, project, resource group, or even higher levels. Summary of the Invention
[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a configuration management method, apparatus, device and storage medium to implement configuration management at tenants, projects, resource groups and even higher levels.
[0005] In a first aspect, an embodiment of the present disclosure provides a configuration management method, the method comprising:
[0006] Reading the first configuration information corresponding to each namespace;
[0007] Determine the hierarchical relationship between namespaces and the target namespace;
[0008] The first configuration information corresponding to each namespace is merged based on the hierarchical relationship to obtain the target configuration information corresponding to the target namespace.
[0009] In a second aspect, an embodiment of the present disclosure provides a configuration management device, the device comprising:
[0010] A first configuration information reading module, configured to read the first configuration information corresponding to each namespace;
[0011] A hierarchical relationship determination module is used to determine the hierarchical relationship between each namespace and the target namespace;
[0012] The target configuration information determination module is used to merge the first configuration information corresponding to each namespace based on the hierarchical relationship to obtain the target configuration information corresponding to the target namespace.
[0013] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
[0014] Memory;
[0015] processor; and
[0016] computer programs;
[0017] The computer program is stored in the memory and is configured to be executed by the processor to implement the configuration management method as described in the first aspect above.
[0018] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the configuration management method as described in the first aspect above.
[0019] The configuration management method, apparatus, device, and storage medium provided by the embodiments of the present disclosure include: reading first configuration information corresponding to each namespace; determining the hierarchical relationship between each namespace and the target namespace; and merging the first configuration information corresponding to each namespace based on the hierarchical relationship to obtain target configuration information corresponding to the target namespace. The embodiments of the present disclosure implement configuration management at tenant, project, resource group, and even higher levels by merging the configuration information of the namespaces based on the hierarchical relationship between the namespaces to obtain the configuration information of the target namespace. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0021] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0022] Figure 1 A flowchart of a configuration management method provided in an embodiment of the present disclosure;
[0023] Figure 2 A flowchart of configuration acquisition provided in an embodiment of the present disclosure;
[0024] Figure 3 A schematic diagram of the structure of a configuration management device provided in an embodiment of the present disclosure;
[0025] Figure 4 A schematic diagram of the structure of a configuration management device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0026] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features therein can be combined with each other in the absence of conflict.
[0027] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0028] Common configuration management tools include the Nacos management model and the Apollo management model. Configuration management tools are used to store application configurations.
[0029] The Nacos management model is an open-source, easy-to-use platform designed for dynamic service discovery, configuration, and service management. It can be used to build cloud-native applications and microservice platforms. Nacos supports virtually all types of services, such as Kubernetes services.
[0030] The Apollo management model is an open source configuration management center developed by Ctrip's framework department. It can centrally manage the configuration of different application environments and clusters. After the configuration is modified, it can be pushed to the application end in real time, and has standardized permissions, process governance and other features.
[0031] Faced with complex deployment scenarios, Apollo and Nacos have different management models.
[0032] The Apollo management model mainly includes: Application, Environment, Cluster and Namespace.
[0033] Among them, Application is managed with application as the main dimension in the Apollo configuration center. It can manage the configuration information of an application in different environments and clusters. The configuration information can be divided into different namespaces for management.
[0034] Environment is generally used in development environment, test environment, production environment, etc.
[0035] A cluster refers to the grouping of different application instances. For example, in a production environment, application instances in the Shanghai data center are divided into one cluster, and application instances in the Beijing data center are divided into another cluster.
[0036] A namespace is a grouping of different application configurations, which can be compared to a configuration file.
[0037] The Nacos management model mainly includes: namespace (Namespace), configuration group (Group), configuration set (dataId).
[0038] The namespace in the Nacos management model is completely different from the namespace concept in the Apollo management model. The namespace is a relatively general concept that can refer to different tenants, different environments, etc.
[0039] A configuration group is generally a collection of related configuration sets. For example, a product can be a configuration group, and a module (application) can also be a configuration group.
[0040] Configuration set (dataId): Usually a configuration file is a configuration set.
[0041] From the above descriptions of the Apollo and Nacos management models, we can see that both support configuration management across different environments and instances. The Nacos management model, due to its simplicity and openness, is suitable for multi-tenant scenarios. However, with the increasing popularity of Kubernetes containerized services, application instances are no longer limited to multi-tenant scenarios. In fact, a tenant's resource group or project can even independently deploy a set of application instances. This requires configuration management tools to support configuration management at the tenant, project, resource group, and even higher levels. Due to the inclusion relationship between tenants, projects, and resource groups, each level of configuration can not only set its own configuration information but also inherit configuration information from the previous level. In these scenarios, the existing Apollo and Nacos management models are not sufficient.
[0042] To address this issue, embodiments of the present disclosure provide a configuration management method. By merging namespace configuration information level by level based on the parent-child relationship between namespaces, the configuration information of child namespaces is obtained. This method enables configuration management at the tenant, project, resource group, and even higher levels. This method is described below with reference to specific embodiments.
[0043] This disclosure constructs a new configuration management model mainly including: namespace (Namespace), configuration group (Group) and configuration item (Config).
[0044] In the newly created configuration management model, namespace is a relatively general concept. For example, a namespace can refer to different tenants, different environments, or a cluster.
[0045] A configuration group is generally a collection of related configuration sets. For example, a product can be a configuration group, and a module (application) can also be a configuration group.
[0046] A configuration item consists of a configuration name (key), configuration content (value), and configuration format (form). It can be either a configuration item or a configuration file. The key can be either the configuration item name or the configuration file name. The configuration content is the configuration content saved in the configuration format. Configuration formats can be common formats such as XML, YAML, JSON, and properties. This example only illustrates the configuration format, not limiting it.
[0047] It should be noted that the namespaces mentioned below in this disclosure all refer to the namespaces in the new configuration management model; the configuration groups mentioned below in this disclosure all refer to the configuration groups in the new configuration management model; and the configuration items mentioned below in this disclosure all refer to the configuration items in the new configuration management model.
[0048] It should be noted that the configuration management method provided by this disclosure is implemented by the configuration management model provided above. The details are as follows:
[0049] Figure 1 A flow chart of a configuration management method provided in an embodiment of the present disclosure; Figure 1 As shown, the configuration management method provided by the embodiment of the present disclosure mainly includes the following steps:
[0050] S11. Read first configuration information corresponding to each namespace.
[0051] In this embodiment, a namespace may include any one of a cluster, tenant, project, or resource group representing a Kubernetes containerized service. Clusters, tenants, projects, and resource groups are in an inclusion relationship, meaning a cluster includes one or more tenants, a tenant includes one or more projects, and a project includes one or more resource groups.
[0052] During business use, different name prefixes are used to distinguish different levels of configuration, such as cluster-k8s1 for a k8s1 cluster and cluster-k8s2 for a k8s2 cluster. Group can represent an application instance name, such as standard-query for a standard data query application. Config can be a configuration file, such as application.yaml, where value is the configuration file content and format is yaml.
[0053] The configuration information can be the above configuration group or the above configuration item. The first configuration information refers to the namespace-independent configuration information. The first configuration information refers to the namespace-independent deployment of a set of application instances or configuration information.
[0054] Specifically, existing Kubernetes containerized services can independently deploy a set of configuration information for clusters, tenants, projects, and resource groups. This means you can deploy a set of configuration information for clusters, tenants, projects, and resource groups independently.
[0055] In this embodiment, the configuration management model reads the independent configuration information of each namespace through a reading interface.
[0056] S12. Determine the hierarchical relationship between the namespaces and the target namespace.
[0057] The hierarchical relationship between namespaces can be understood as the hierarchical relationship between namespaces. Specifically, a cluster includes tenants, and the cluster's hierarchy is higher than the tenant's hierarchy; a tenant includes projects, and the tenant's hierarchy is higher than the project's hierarchy; a project includes resource groups, and the project's hierarchy is higher than the resource group's hierarchy. The above hierarchical relationship is determined by the Kubernetes containerized service platform. In this embodiment, the target namespace is the namespace currently read. Optionally, the target namespace is the namespace with the lowest hierarchy, that is, the resource group.
[0058] In one possible embodiment, a method for determining the hierarchical relationship of namespaces is provided. The hierarchical information of each namespace can be carried in the parameters of the namespace. Furthermore, the hierarchy of the namespace can be represented by pre-set parameters. For example: the parameters of the cluster, tenant, project, and resource group are set to 0, 1, 2, and 3 respectively. 0 indicates that the cluster is the namespace with the highest hierarchy; 1 indicates that the tenant's hierarchy is lower than the cluster and higher than the project's hierarchy; 2 indicates that the project's hierarchy is higher than the resource group and lower than the tenant's hierarchy; 3 indicates that the resource group is the namespace with the lowest hierarchy.
[0059] In one possible implementation, another method for determining namespace hierarchical relationships is provided. The hierarchical relationships between namespaces are pre-stored in the configuration management model. Specifically, the hierarchical relationships between namespaces are, from highest to lowest, cluster, tenant, project, and resource group. If the configuration management model reads both the tenant's first configuration information and the cluster's first configuration information, the pre-stored parent-child relationship determines that the cluster is the project's parent namespace.
[0060] In one possible implementation, another method for determining the hierarchical relationship of namespaces is provided. The hierarchical relationship of each namespace is determined according to the order in which each namespace is read. For example, the first namespace read has the highest hierarchy, and the subsequent namespaces read have successively lower hierarchies, with the last namespace read having the lowest hierarchy.
[0061] It should be noted that the above-mentioned method for determining the hierarchical relationship of namespaces is merely illustrative and not restrictive. The hierarchical relationship between namespaces at all levels may be determined in an appropriate manner according to the actual application of the configuration management model.
[0062] S13: Merge the first configuration information corresponding to each namespace based on the hierarchical relationship to obtain target configuration information corresponding to the target namespace.
[0063] Merging the first configuration information corresponding to each namespace can be understood as integrating the first configuration information corresponding to all namespaces together as the target configuration information corresponding to the target namespace.
[0064] Specifically, the first configuration information corresponding to the cluster, the first configuration information corresponding to the tenant, the first configuration information corresponding to the project, and the first configuration information corresponding to the resource group are all integrated into one as the target namespace, that is, the target configuration information of the resource group.
[0065] Merging the first configuration information corresponding to each namespace based on the hierarchical relationship may include merging the first configuration information corresponding to each namespace from highest to lowest hierarchical relationship. For example, merging the first configuration information corresponding to the cluster with the first configuration information corresponding to the tenant, then merging them with the first configuration information corresponding to the project, and finally merging them with the first configuration information corresponding to the resource group to obtain the target configuration information for the target namespace, i.e., the resource group.
[0066] Based on the hierarchical relationship, the first configuration information corresponding to each namespace is merged to obtain the target configuration information corresponding to the target namespace, including: merging the first configuration information corresponding to each namespace in order from low to high according to the hierarchical relationship to obtain the target configuration information corresponding to the target namespace.
[0067] For example, after merging the first configuration information corresponding to the resource group and the first configuration information corresponding to the project, merge them with the first configuration information corresponding to the tenant, and finally merge them with the first configuration information corresponding to the cluster to obtain the target namespace, i.e., the target configuration information of the resource group.
[0068] Specifically, when the standard data query application in the resource group reads the application.yaml configuration, it needs to read the namespaces such as the cluster, tenant, project, and resource group, as well as their corresponding standard data query applications (standard-query) and application.yaml. The configuration contents in the read application.yaml are merged in turn to obtain the configuration file content of the resource group.
[0069] In one possible implementation, the first configuration information includes a configuration name and configuration content; the first configuration information corresponding to each namespace is merged in order from low to high according to the hierarchical relationship to obtain the target configuration information corresponding to the target namespace, including: in the merging process of the first configuration information, if there is first configuration information with the same configuration name but different configuration content, the first configuration information corresponding to the lower-level namespace is determined as the target configuration information corresponding to the target namespace.
[0070] It should be noted that each namespace may correspond to one or more first configuration information, and this embodiment does not limit the number of first configuration information corresponding to each namespace. Furthermore, the configuration information may also be referred to as a configuration group or configuration item.
[0071] Furthermore, the first configuration information includes a configuration name and configuration content. During the merging process of the first configuration information corresponding to the resource group and the first configuration information corresponding to the project, if there is first configuration information with the same configuration name but different configuration content, the first configuration information corresponding to the resource group will be determined as the target configuration information corresponding to the resource group, and the first configuration information corresponding to the project will be directly ignored without any processing.
[0072] After the first configuration information corresponding to the resource group is merged with the first configuration information corresponding to the project to obtain the target configuration information, it is merged with the first configuration information corresponding to the tenant. If, during the merging process, there is configuration information with the same configuration name but different configuration content, the first configuration information is directly ignored without any processing.
[0073] After the first configuration information corresponding to the resource group is merged with the first configuration information corresponding to the project, and then merged with the first configuration information corresponding to the tenant, the target configuration information is obtained and finally merged with the first configuration information corresponding to the cluster. If, during the merging process, there is configuration information with the same configuration name but different configuration content, the first configuration information is directly ignored without any processing.
[0074] In this disclosed embodiment, the business side (client) maintains the hierarchical relationship of the namespace, and determines the target configuration information based on the order in which the namespace is entered. Similarly, a higher-level namespace can be set on the namespace, and when reading configuration information, all higher-level namespaces are automatically recursively queried to determine the target configuration information.
[0075] The configuration management method provided by the embodiment of the present disclosure can independently manage configuration information of different levels; at the same time, when reading configuration information, the configuration information corresponding to the high-level namespace can be inherited, so that the high-level namespace configuration information can be shared, and the low-level namespace can independently set information.
[0076] The present disclosure relates to a configuration management method, comprising: reading first configuration information corresponding to each namespace; determining a hierarchical relationship between the namespaces and a target namespace; and merging the first configuration information corresponding to the namespaces based on the hierarchical relationship to obtain target configuration information corresponding to the target namespace. The present disclosure implements configuration management at tenant, project, resource group, and even higher levels by merging the configuration information of the namespaces based on the hierarchical relationship between the namespaces to obtain the configuration information of the target namespace.
[0077] In one possible implementation, determining the hierarchical relationship between each namespace and the target namespace includes: determining the hierarchical relationship between each namespace based on the order in which the namespaces are read, wherein a namespace read earlier has a higher hierarchy than a namespace read later; and determining the last namespace read as the target namespace.
[0078] In this embodiment, the order of reading the namespaces may be the time order of reading the namespaces.
[0079] In one embodiment, a namespace read earlier has a higher level than a namespace read later. For example, the first namespace read has a higher level than the second namespace read, the second namespace read has a higher level than the third namespace read, and the third namespace read has a higher level than the fourth namespace read.
[0080] Since the hierarchical relationship between namespaces is determined by the Kubernetes containerized service platform, the configuration management model is unaware of the hierarchical relationship between namespaces. Therefore, the hierarchical relationship of the configuration management model can be determined based on the settings of the Kubernetes containerized service platform.
[0081] Preferably, the Kubernetes containerized service platform is output in the order of cluster, tenant, project, and resource group, so that the namespace with the earlier configuration management model reading time has a higher level than the namespace with the later reading time.
[0082] In one possible implementation, the first configuration information also includes a configuration format; before merging the first configuration information corresponding to each namespace based on the hierarchical relationship, it also includes: converting the first configuration information corresponding to each namespace into a Map format; after obtaining the target configuration information corresponding to the target namespace, it also includes: converting the target configuration information from a Map format to the configuration format included in the first configuration information.
[0083] In this embodiment, the configuration model is processed using the Map format. Therefore, before the first configuration information is merged, it is necessary to convert the first configuration information into a Map format. After the first configuration information is merged and the target configuration information is obtained, it is converted back to the configuration format included in the first configuration information to facilitate the use of the configuration information in subsequent programs.
[0084] In an applicable embodiment, Figure 2 As shown, the configuration information management process mainly includes: receiving input namespaces at all levels and their corresponding allocation groups and configuration names. The final configuration content result (target configuration information) of the child namespace is recorded as resultConfigMap. The traversal namespace is recorded as ns. According to ns, the corresponding configuration content and configuration format are queried from the first configuration information, recorded as ConfigForm and ConfigValue. According to the configuration content and configuration format, the configuration content is parsed into Map format for storage, recorded as ConfigMap. The ConfigMap content is merged into the resultConfigMap, and the configuration name with the same name retains the configuration content in the resultConfigMap. After the traversal is completed, the resultConfigMap is converted into the corresponding configuration format and used as the final configuration information of the child namespace.
[0085] For example: receive input clusters, tenants, projects, resource groups, and their respective independent configuration groups and configuration names. Record the final configuration information of the resource group as resultConfigMap. Modify the independent configuration information of the resource group to Map format for storage and merge it into resultConfigMap; then query the corresponding configuration content and configuration format based on the project, configuration group, and configuration name, record them as ConfigForm1 and ConfigValue1, parse the configuration content into Map format for storage based on the configuration content and configuration format, record them as ConfigMap1, merge the content of ConfigMap1 into resultConfigMap, and configuration names with the same name retain the configuration content in resultConfigMap. Then query the corresponding configuration content and configuration format based on the tenant, configuration group, and configuration name, record them as ConfigForm2 and ConfigValue2, parse the configuration content into Map format for storage based on the configuration content and configuration format, record them as ConfigMap2, merge the content of ConfigMap2 into resultConfigMap, and configuration names with the same name retain the configuration content in resultConfigMap. Then, based on the cluster, configuration group, and configuration name, the corresponding configuration content and configuration format are retrieved, recorded as ConfigForm3 and ConfigValue3. Based on the configuration content and configuration format, the configuration content is parsed and stored in Map format, recorded as ConfigMap3. The content of ConfigMap3 is merged into resultConfigMap. Configurations with the same name retain the configuration content in resultConfigMap. Finally, resultConfigMap is converted to the configuration format corresponding to the resource group and used as the final configuration information for the resource group.
[0086] Figure 3 The configuration management device provided by the embodiment of the present disclosure can execute the processing flow provided by the above configuration management method embodiment, such as Figure 3 As shown, the configuration management device 30 provided by the embodiment of the present disclosure includes: a first configuration information reading module 31 , a hierarchical relationship determination module 32 and a target configuration information determination module 33 .
[0087] The first configuration information reading module 31 is configured to read the first configuration information corresponding to each namespace;
[0088] A hierarchical relationship determination module 32 is used to determine the hierarchical relationship between each namespace and the target namespace;
[0089] The target configuration information determining module 33 is configured to merge the first configuration information corresponding to each namespace based on the hierarchical relationship to obtain the target configuration information corresponding to the target namespace.
[0090] In one possible embodiment, the hierarchical relationship determination module includes: a hierarchical relationship determination unit, used to determine the hierarchical relationship between each namespace according to the order of reading the namespaces, wherein the namespace read first has a higher hierarchy than the namespace read later; and a target namespace determination unit, used to determine the last namespace read as the target namespace.
[0091] In a possible implementation, the target configuration information determination module is specifically configured to merge the first configuration information corresponding to each namespace in order from low to high according to the hierarchical relationship to obtain the target configuration information corresponding to the target namespace.
[0092] In one possible implementation, the first configuration information includes a configuration name and configuration content; a target configuration information determination module is specifically used to, during the merging process of the first configuration information, determine the first configuration information corresponding to the lower-level namespace as the target configuration information corresponding to the target namespace if there is first configuration information with the same configuration name but different configuration content.
[0093] In a possible implementation manner, the first configuration information further includes a configuration format;
[0094] The device also includes: a format conversion module, which is used to convert the first configuration information corresponding to each namespace into a Map format before merging the first configuration information corresponding to each namespace based on the hierarchical relationship; the format conversion module is also used to convert the target configuration information corresponding to the target namespace from a Map format to a configuration format included in the first configuration information after obtaining the target configuration information corresponding to the target namespace.
[0095] Figure 3 The configuration management device of the illustrated embodiment can be used to execute the technical solution of the above-mentioned configuration management method embodiment. Its implementation principle and technical effects are similar and will not be repeated here.
[0096] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. The electronic device may be the client described above, or a component of the client. The electronic device provided in an embodiment of the present disclosure may execute the processing flow provided in the configuration management method embodiment described above.
[0097] like Figure 4As shown, the electronic device 40 includes: a memory 41, a processor 42, a computer program and a communication interface 43; wherein the computer program is stored in the memory 41 and is configured so that the processor 42 executes the configuration management method as described above.
[0098] In addition, an embodiment of the present disclosure further provides a computer-readable storage medium on which a computer program is stored. The computer program is executed by a processor to implement the configuration management method described in the above embodiment.
[0099] It should be noted that, in this document, relational terms such as "first" and "second" are used only 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. Moreover, 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 elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0100] The foregoing description is intended only to provide specific embodiments of the present disclosure, intended to enable those skilled in the art to understand and implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the embodiments described herein, but rather to be construed in the broadest manner consistent with the principles and novel features disclosed herein.
[0101] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0102] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A configuration management method, characterized in that: The method comprises: Reading first configuration information corresponding to each namespace, wherein the namespace includes any one of a cluster, a tenant, a project, and a resource group representing a Kubernetes containerized service, and the first configuration information includes a configuration name, configuration content, and configuration format; Determine a hierarchical relationship between namespaces and a target namespace, wherein a high-level namespace includes one or more low-level namespaces, and the target namespace is the lowest-level namespace among the namespaces; The first configuration information corresponding to each namespace is merged based on the hierarchical relationship to obtain the target configuration information corresponding to the target namespace.
2. The method according to claim 1, characterized in that Determine the hierarchical relationship between namespaces and the target namespace, including: The hierarchical relationship between namespaces is determined based on the order in which the namespaces are read, wherein the namespace read first has a higher hierarchy than the namespace read later; The last namespace read is determined as the target namespace.
3. The method according to claim 1, characterized in that Merging the first configuration information corresponding to each namespace based on the hierarchical relationship to obtain the target configuration information corresponding to the target namespace includes: The first configuration information corresponding to each namespace is merged in order from low to high according to the hierarchical relationship to obtain the target configuration information corresponding to the target namespace.
4. The method according to claim 3, characterized in that The first configuration information includes a configuration name and configuration content; Merging the first configuration information corresponding to each namespace in order from low to high according to the hierarchical relationship to obtain target configuration information corresponding to the target namespace includes: During the merging process of the first configuration information, if there is first configuration information with the same configuration name but different configuration content, the first configuration information corresponding to the lower-level namespace is determined as the target configuration information corresponding to the target namespace.
5. The method according to claim 4, characterized in that The first configuration information also includes a configuration format; Before merging the first configuration information corresponding to each namespace based on the hierarchical relationship, the method further includes: Convert the first configuration information corresponding to each namespace into a Map format; After obtaining the target configuration information corresponding to the target namespace, the method further includes: The target configuration information is converted from a Map format to a configuration format included in the first configuration information.
6. A configuration management device, characterized in that: The device comprises: A first configuration information reading module is configured to read first configuration information corresponding to each namespace, wherein the namespace includes any one of a cluster, a tenant, a project, and a resource group representing a Kubernetes containerized service, and the first configuration information includes a configuration name, configuration content, and configuration format; A hierarchical relationship determination module is used to determine the hierarchical relationship between each namespace and a target namespace, where a high-level namespace includes one or more low-level namespaces, and the target namespace is the lowest-level namespace among the namespaces; The target configuration information determination module is used to merge the first configuration information corresponding to each namespace based on the hierarchical relationship to obtain the target configuration information corresponding to the target namespace.
7. The device according to claim 6, characterized in that The hierarchical relationship determination module includes: a hierarchical relationship determining unit, configured to determine the hierarchical relationship between the namespaces according to the order in which the namespaces are read, wherein the namespace read earlier has a higher hierarchy than the namespace read later; The target namespace determination unit is used to determine the last namespace read as the target namespace.
8. The device according to claim 6, characterized in that The target configuration information determination module is specifically configured to merge the first configuration information corresponding to each namespace in order from low to high according to the hierarchical relationship to obtain the target configuration information corresponding to the target namespace.
9. The device according to claim 8, characterized in that The first configuration information includes a configuration name and configuration content; The target configuration information determination module is specifically used to determine the first configuration information corresponding to the lower-level namespace as the target configuration information corresponding to the target namespace if there is first configuration information with the same configuration name but different configuration content during the merging process of the first configuration information.
10. The device according to claim 9, characterized in that The first configuration information also includes a configuration format; The apparatus further includes: a format conversion module configured to convert the first configuration information corresponding to each namespace into a Map format before merging the first configuration information corresponding to each namespace based on the hierarchical relationship; The format conversion module is further configured to, after obtaining the target configuration information corresponding to the target namespace, convert the target configuration information from a Map format to a configuration format included in the first configuration information.
11. An electronic device, characterized in that: include: Memory; processor; as well as computer programs; The computer program is stored in the memory and configured to be executed by the processor to implement the method according to any one of claims 1 to 5.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Application migration system
CN109416643A