A unified configuration management method, system, device and storage medium for applications

By creating a configuration proxy service in the Pod and binding Sidecar rules with the application's encoding identifier, the intrusiveness of the configuration center to the application in the existing technology is solved, and unified configuration management of the application and multi-language support for the development language are achieved.

CN114371882BActive Publication Date: 2024-09-10E SURFING IOT CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202111610128.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-27
Publication Date
2024-09-10
Estimated Expiration
2041-12-27

AI Technical Summary

Technical Problem

In existing technologies, when building complex systems based on Kubernetes, each service needs to obtain configuration information from the configuration center through the configuration center's SDK and security authentication mechanism, which results in a high degree of intrusion into the application and a limited number of supported development languages ​​and frameworks.

Method used

By creating a configuration proxy service in the Pod, binding Sidecar rules to the application's encoding identifier, obtaining configuration information using the downward API, and transmitting it through the Kubernetes API interface, it supports multiple development languages ​​and frameworks, reducing the intrusion into the application.

Benefits of technology

It enables unified configuration management for applications, reduces intrusiveness to applications, alleviates the limitations of development languages ​​and frameworks, and improves the security and transmission efficiency of configuration information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114371882B
    Figure CN114371882B
Patent Text Reader

Abstract

The present application discloses a unified configuration management method, system, device and storage medium for applications. The method determines the coding identifier of the application according to the preset application coding rules; determines the configuration information of the application according to the preset application configuration rules; creates a configuration proxy service of the application in the Pod according to the Sidecar rules; in response to the configuration information query request of the current application, the current configuration proxy service obtains the configuration information of the current application by accessing the kubernetes API interface, and sends the configuration information of the current application to the current application. The system includes a first determination module, a second determination module, a creation module and a configuration proxy module. By using the above method, unified configuration management of applications can be performed, which is conducive to reducing the invasiveness of applications and, at the same time, alleviating restrictions on development languages ​​and frameworks. The present application can be widely used in the field of computer technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a unified configuration management method, system, device and storage medium for applications. Background Art

[0002] Nowadays, more and more systems are deployed and managed based on K8s. When building complex systems, independent configuration centers are usually deployed to centrally manage the configuration information of various services in the system. In related technologies, each service needs to develop SDKs and security authentication mechanisms through the configuration center to obtain the required configuration information from the configuration center, which is somewhat invasive to the application and does not support multiple development languages ​​and frameworks, and has many usage restrictions. Summary of the invention

[0003] The purpose of this application is to solve one of the technical problems existing in the prior art to at least a certain extent.

[0004] To this end, one purpose of an embodiment of the present application is to provide a unified configuration management method for applications, which can perform unified configuration management on applications, help reduce the invasiveness of applications, and at the same time, alleviate restrictions on development languages ​​and frameworks.

[0005] Another object of an embodiment of the present application is to provide a unified configuration management system for applications.

[0006] In order to achieve the above technical objectives, the technical solutions adopted by the embodiments of the present application include:

[0007] On the one hand, an embodiment of the present application provides a unified configuration management method for an application, comprising the following steps: determining the coding identifier of the application according to a preset application coding rule; determining the configuration information of the application according to a preset application configuration rule; wherein the configuration information includes the coding identifier of the application; creating a configuration proxy service for the application in the Pod according to the Sidecar rule; the configuration proxy service is used to bind to the coding identifier of the application through the downward API; in response to a configuration information query request of the current application, the current configuration proxy service obtains the configuration information of the current application by accessing the kubernetes API interface, and sends the configuration information of the current application to the current application. The unified configuration management method for applications of the embodiment of the present application can perform unified configuration management on applications, which is conducive to reducing the intrusiveness of applications, and at the same time, alleviating restrictions on development languages ​​and frameworks.

[0008] In addition, the unified configuration management method for applications according to the above embodiment of the present application may also have the following additional technical features:

[0009] Furthermore, in the unified configuration management method for applications in the embodiments of the present application, the configuration proxy service is configured in the container, and the creation of the configuration proxy service for the application in the Pod includes: creating a service account; creating a role, and determining the access rights of the role; wherein the access rights are for the role to access the configuration information of the application; binding the service account and the role to determine the access rights of the service account; mounting the preset label information of the Pod to the preset file of the container through the downward API; wherein the preset label information includes the coding identifier of the application.

[0010] Furthermore, in an embodiment of the present application, it also includes: the configuration proxy service obtains the coding identifier of the application according to the preset file, and obtains the configuration proxy service having a binding relationship with the coding identifier of the application.

[0011] Further, in an embodiment of the present application, the configuration information of the application is determined according to a preset application configuration rule, including: the configuration information is stored in the form of key:value; if the configuration information is character-type plaintext information, the storage location of the configuration information is determined to be the first location in configMap; or, if the configuration information is file-type plaintext information, the storage location of the configuration information is determined to be the second location in configMap; or, if the configuration information is character-type ciphertext information, the storage location of the configuration information is determined to be the third location in Secret; or, if the configuration information is file-type ciphertext information, the storage location of the configuration information is determined to be the fourth location in Secret.

[0012] Further, in an embodiment of the present application, the current application sends the configuration information query request through the following steps: the current application sends the configuration information query request by calling an http get interface.

[0013] Furthermore, in one embodiment of the present application, the current configuration proxy service obtains the configuration information of the current application by accessing the kubernetes API interface, including: the current configuration proxy service obtains the coding identifier of the current application according to the configuration information query request; and obtains the configuration information of the current application by accessing the kubernetes API interface according to the configuration information query request and the coding identifier of the current application.

[0014] Furthermore, in one embodiment of the present application, the method further includes: mounting the temporary storage volume to a predetermined file in the container where the application is located.

[0015] On the other hand, an embodiment of the present application proposes a unified configuration management system for applications, including: a first determination module, used to determine the coding identifier of the application according to a preset application coding rule; a second determination module, used to determine the configuration information of the application according to a preset application configuration rule; wherein the configuration information includes the coding identifier of the application; a creation module, used to create a configuration proxy service of the application in the Pod according to the Sidecar rule; the configuration proxy service is used to bind to the coding identifier of the application through a downward API; a configuration proxy module, used to obtain the configuration information of the current application by accessing the kubernetes API interface according to the configuration information query request of the current application, and send the configuration information of the current application to the current application.

[0016] On the other hand, an embodiment of the present application provides a unified configuration management device for an application, including:

[0017] at least one processor;

[0018] at least one memory for storing at least one program;

[0019] When the at least one program is executed by the at least one processor, the at least one processor implements any one of the above-mentioned unified configuration management methods for applications.

[0020] On the other hand, an embodiment of the present application provides a storage medium, in which a program executable by a processor is stored. When the program executable by the processor is executed by the processor, it is used to implement the unified configuration management method of any of the above-mentioned applications.

[0021] The unified configuration management method for applications in the embodiments of the present application determines the coding identifier of the application according to preset application coding rules; determines the configuration information of the application according to preset application configuration rules; wherein the configuration information includes the coding identifier of the application; creates a configuration proxy service for the application in the Pod according to the Sidecar rule; the configuration proxy service is used to bind to the coding identifier of the application through the downward API; in response to the configuration information query request of the current application, the current configuration proxy service obtains the configuration information of the current application by accessing the kubernetes API interface, and sends the configuration information of the current application to the current application. By using the above method, unified configuration management of applications can be performed, which is conducive to reducing the invasiveness of applications and at the same time, alleviating restrictions on development languages ​​and frameworks. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following introduction is made to the drawings of the embodiments of the present application or the related technical solutions in the prior art. It should be understood that the drawings introduced below are only for the convenience of clearly describing some embodiments of the technical solutions of the present application. For technical personnel in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0023] Figure 1 A flowchart of a specific embodiment of the unified configuration management method for applications proposed in this application;

[0024] Figure 2 A schematic diagram of storage of configuration information in the unified configuration management method for applications proposed in this application;

[0025] Figure 3 This is a schematic diagram of the structure of a specific embodiment of the unified configuration management system for applications proposed in this application;

[0026] Figure 4 This is a structural diagram of a specific embodiment of the unified configuration management device for applications proposed in this application. DETAILED DESCRIPTION

[0027] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and are not to be construed as limitations on the present application. For the step numbers in the following embodiments, they are only provided for the convenience of explanation, and the order between the steps is not limited in any way, and the execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.

[0028] Kubernetes (K8s) is an open source container cluster management system that has developed very rapidly and has become the most popular and active container orchestration system. The efficiency improvement it brings to system operation and maintenance deployment has been widely recognized, and more and more systems are deployed and managed based on K8s.

[0029] When building a complex system, the system consists of many modules or services. Generally, an independent configuration center service is deployed to facilitate the unified management of the configuration information of each service in the system. However, each service needs to obtain the required configuration information from the configuration center based on the development SDK and security authentication mechanism of the configuration center, which is somewhat invasive to the application. In addition, the supported development languages ​​and frameworks are also limited.

[0030] Therefore, a unified configuration management method and system for an application proposed in an embodiment of the present application will first be described with reference to the accompanying drawings.

[0031] Reference Figure 1 In the embodiment of the present application, a unified configuration management method for an application is provided. The unified configuration management method for an application in the embodiment of the present application can be applied to a terminal or a server, or can be software running in a terminal or a server. The terminal can be a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0032] The unified configuration management method of the application in the embodiment of the present application mainly includes the following steps:

[0033] S101: Determine the coding identifier of the application according to a preset application coding rule;

[0034] In an embodiment of the present application, the coding identifier of the application is determined according to the preset application coding rules. The preset application coding rules are used to characterize the rules for naming the application, and the application can be identified by a string with a fixed meaning. In some possible implementations, the coding rule may be app-autoconfig-appId, where autoconfig is used to characterize the type of the application service. appId is used to characterize the identifier of the application service and is used to distinguish different application services. Optionally, appId can be represented in the form of a string automatically generated by the system, or in a user-defined form. The present application does not limit the specific form of the preset application coding rules.

[0035] S102: Determine configuration information of the application according to a preset application configuration rule; wherein the configuration information includes a coding identifier of the application;

[0036] In the embodiment of the present application, the configuration information of the application is determined according to the preset application configuration rules; wherein the configuration information includes the coding identifier of the application. Different configuration information of the application is processed in different ways, that is, the configuration information of the application is determined according to the preset application configuration rules.

[0037] S103: creating a configuration proxy service of the application in the Pod according to the Sidecar rule; the configuration proxy service is used to bind to the coding identifier of the application through the downward API;

[0038] In an embodiment of the present application, a configuration proxy service of the application is created in the Pod according to the Sidecar rule; the configuration proxy service is used to bind to the coding identifier of the application through the downward API. The Sidecar rule is also called the sidecar rule because it is similar to a sidecar connected to a motorcycle. By placing the configuration proxy service and the application in the same Pod, there is no need to modify the application when obtaining and transmitting configuration information, which helps to reduce the intrusiveness of the application. At the same time, it supports permission isolation and secure access to application configuration information. The configuration proxy service is bound to the coding identifier of the application through the downward API, and the application is bound to the configuration proxy service in advance. The application can only query its own configuration information, which helps to improve the security performance of the application configuration.

[0039] S104: In response to the configuration information query request of the current application, the current configuration proxy service obtains the configuration information of the current application by accessing the Kubernetes API interface, and sends the configuration information of the current application to the current application.

[0040] In an embodiment of the present application, through the above-mentioned creation process of the configuration proxy service, when the current application queries for configuration information, a configuration information query request is sent, and the current configuration proxy service accesses the API interface of K8S to obtain the configuration information of the current application, and sends the configuration information to the current application. Based on the binding of the above-mentioned configuration proxy service and the coding identifier of the application, the coding identifier of the application is obtained through the configuration information query request, thereby querying the configuration information of the application. Through the above-mentioned method, unified configuration management of the application can be performed, which is conducive to reducing the invasiveness of the application, and at the same time, alleviating the restrictions on development languages ​​and frameworks.

[0041] Optionally, in the unified configuration management method for applications in the embodiments of the present application, the configuration proxy service is configured in a container, and the configuration proxy service for the application is created in the Pod, including:

[0042] Create a service account;

[0043] Creating a role and determining the access rights of the role; wherein the access rights allow the role to access the configuration information of the application;

[0044] Binding the service account and the role to determine access rights of the service account;

[0045] The preset label information of the Pod is mounted into the preset file of the container through the downward API; wherein the preset label information includes the coding identifier of the application.

[0046] In this step, the creation process of the configuration proxy service is as follows: Create a service account ServiceAccount. For the service account of the application, the identifier can be determined to be sa-app-autoconfig. Create a role role; specifically, the identifier can be set to rl-app-autoconfig; determine the access rights of the role, that is, give the role the authority to access the configuration information of the application to read the configuration information of the application. Bind the service account and the role, determine the access rights of the service account, and determine the authority of the service account to access the configuration information of the application. Mount the preset label information of the Pod to the preset file of the container through the downwardAPI; wherein the preset label information includes the coding identifier of the application. Bind the configuration proxy service to the coding identifier of the application through the downwardAPI. In some possible implementations, the preset label information can be metadata.labels information, and the preset file can be the / etc / autoconfig-downward / labels file; that is, mount the metadata.labels information of the Pod to the / etc / autoconfig-downward / labels file of the container where the config-proxy is located through the downwardAPI, which is used to bind the configuration proxy service to the coding identifier of the application.

[0047] Optionally, the unified configuration management method for applications in the embodiments of the present application further includes:

[0048] The configuration proxy service obtains the coding identifier of the application according to the preset file, and obtains the configuration proxy service having a binding relationship with the coding identifier of the application.

[0049] In this step, the configuration proxy service obtains the coding identifier of the application according to the preset file, and obtains the configuration proxy service that has a binding relationship with the coding identifier of the application. By binding the configuration proxy service with the coding identifier of the application, when the application needs to query the configuration information, it does not need to send its own coding identifier, which is conducive to alleviating the risk of other applications obtaining the coding identifier and improving the security performance of configuration information transmission.

[0050] Optionally, in the unified configuration management method for applications in the embodiments of the present application, the step of determining the configuration information of the application according to a preset application configuration rule includes:

[0051] The configuration information is stored in the form of key:value;

[0052] If the configuration information is character-based plain text information, determine that the storage location of the configuration information is the first location in configMap;

[0053] Alternatively, if the configuration information is plain text information of a file type, determining that the storage location of the configuration information is the second location in the configMap;

[0054] Alternatively, if the configuration information is character-type ciphertext information, determining that the storage location of the configuration information is the third location in the Secret;

[0055] Alternatively, if the configuration information is file-type ciphertext information, the storage location of the configuration information is determined to be the fourth location in Secret.

[0056] In this step, create the configuration information of the application. The configuration information is stored in the form of key:value. Specifically, according to the confidentiality level and information type of the configuration information, there are four different configuration information storage methods. Figure 2 As shown, the plaintext character class configuration is saved in the configMap named cm-appId, and the plaintext file class configuration is saved in the configMap named cm-appId-file. The ciphertext character class configuration is saved in the Secret named srt-appId, and the ciphertext file class configuration is saved in the Secret named srt-appId-file. The above storage method is an example description, and those skilled in the art can set the storage form and storage location of the configuration information according to actual needs.

[0057] Optionally, in the unified configuration management method for applications in the embodiments of the present application, the current application sends the configuration information query request through the following steps:

[0058] The current application sends the configuration information query request by calling the http get interface.

[0059] In this step, the current application can call the http get interface to send a configuration information query request. After receiving the query request, the configuration proxy service performs a configuration information query operation. In some possible implementations, the calling address can be: http: / / localhost:port / config-proxy / getAppConfig? configKey=xx&configType=xx&isSecret=xx&cachSecond=xx, where localhost is used to represent the local address in a fixed format; port is used to represent the service port of the configuration proxy service config-proxy; configKey is the configuration name; configType is the configuration type, 0 represents the character type, 1 represents the file type; isSecret is whether the configuration is encrypted, 0 represents non-encrypted, and 1 represents encrypted. cachSecond is the configuration cache time in seconds, which is used to cache the configuration information to improve performance. The configuration proxy service config-proxy calls the k8s service API interface based on the above information and appId to obtain the configmap or secret information corresponding to the application, and parses the configuration value corresponding to the configKey from it and returns it to the caller. This interface does not accept the appId parameter, but binds the application information in advance based on the downward API. Therefore, the application can only query its own configuration information, which simplifies the permission management operation.

[0060] Optionally, in the unified configuration management method for applications in the embodiments of the present application, the current configuration proxy service obtains the configuration information of the current application by accessing the kubernetes API interface, including:

[0061] The current configuration proxy service obtains the coding identifier of the current application according to the configuration information query request;

[0062] According to the configuration information query request and the coding identifier of the current application, the configuration information of the current application is obtained by accessing the kubernetes API interface.

[0063] In this step, when the current configuration proxy service receives the configuration information query request, it obtains the encoding identifier of the current application through the binding information; thus, according to the configuration information query request and the encoding identifier, the configuration information of the current application is obtained by accessing the kubernetes API interface.

[0064] Optionally, the unified configuration management method for applications in the embodiments of the present application further includes:

[0065] Mount the temporary storage volume to the predetermined file in the container where the application is located.

[0066] In this step, the temporary storage volume is mounted to the predetermined file of the container where the application is located, and the permission of the application to call the K8S API interface is blocked, which is conducive to improving the security of the application configuration. In some possible implementations, the temporary storage volume can be emptyDir, and the predetermined file can be the / var / run / secrets / kubernetes.io / serviceaccount directory information. That is, emptyDir is mounted to the / var / run / secrets / kubernetes.io / serviceaccount directory of the application container to block some access rights of the application.

[0067] In order to better understand the configuration method of an application proposed in this application, a specific embodiment is described in detail below:

[0068] Step 1: Prepare 3 virtual machines with 16G memory and 8-core CPU, deploy the K8s cluster, and enable permission management and PodPreset mechanism;

[0069] Step 2: Create ServiceAccount sa-app-autoconfig;

[0070] Step 3: Create the role rl-app-autoconfig and set the access rights of the role to support configMap and secret.

[0071] Step 4: Bind sa-app-autoconfig and rl-app-autoconfig;

[0072] Step 5: assign an identifier appId to the application, which is 10001 in this embodiment;

[0073] Step 6: Create configuration information for the application as needed. The plaintext character class configuration is saved in the configMap named cm-10001, and the plaintext file class configuration is saved in the configMap named cm-10001-file. The ciphertext character class configuration is saved in the Secret named srt-10001, and the ciphertext file class configuration is saved in the Secret named srt-10001-file;

[0074] Step 7: Configure the application to publish the Pod and obtain the configuration information. The main steps are as follows:

[0075] a) Add label app:app-autoconfig-10001 to the Pod;

[0076] b) Configure the ServiceAccount permission sa-app-autoconfig for the Pod;

[0077] c) Deploy the config-proxy service in the form of Sidecar to the Pod where the application is located, with the service port 18080; mount the Pod's metadata.labels information to the / etc / autoconfig-downward / labels file of the container where the config-proxy is located through the downwardAPI;

[0078] d) Mount emptyDir to the application container / var / run / secrets / kubernetes.io / serviceaccount directory;

[0079] e) To obtain application configuration information, such as DB_SERVER, the application calls the http get interface http: / / localhost:18080 / config-proxy / getAppConfig?configKey=DB_SERVER&configType=0&isSecret=0&cacheSecond=100 to obtain it from config-proxy.

[0080] From the above description, it can be seen that the unified configuration management method of an application proposed in this application can perform unified configuration management on the application, which is conducive to reducing the invasiveness of the application and, at the same time, alleviating the restrictions on development languages ​​and frameworks.

[0081] Next, a unified configuration management system for an application proposed according to an embodiment of the present application is described with reference to the accompanying drawings.

[0082] Figure 3 This is a schematic diagram of a unified configuration management system structure of an application of an embodiment of the present application. The system specifically includes:

[0083] A first determination module 310, configured to determine a coding identifier of the application according to a preset application coding rule;

[0084] The second determination module 320 is used to determine the configuration information of the application according to a preset application configuration rule; wherein the configuration information includes a coding identifier of the application;

[0085] A creation module 330 is used to create a configuration proxy service of the application in the Pod according to the Sidecar rule; the configuration proxy service is used to bind to the coding identifier of the application through a downward API;

[0086] The configuration proxy module 340 is used to query the configuration information of the current application according to the configuration information of the current application. The current configuration proxy service obtains the configuration information of the current application by accessing the kubernetes API interface, and sends the configuration information of the current application to the current application.

[0087] It can be seen that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0088] Reference Figure 4 , the embodiment of the present application provides a unified configuration management device for applications, including:

[0089] at least one processor 410;

[0090] At least one memory 420, used to store at least one program;

[0091] When the at least one program is executed by the at least one processor 410, the at least one processor 410 implements the unified configuration management method of applications.

[0092] Similarly, the contents of the above method embodiments are all applicable to the present device embodiments. The functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0093] In some optional embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the application is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Optional embodiments are expected, wherein the order of various operations is changed and the sub-operation described as a part of a larger operation is performed independently.

[0094] In addition, although the present application is described in the context of functional modules, it should be understood that, unless otherwise specified, one or more of the functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present application. More specifically, in view of the properties, functions, and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional techniques of the engineer. Therefore, those skilled in the art can implement the present application set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present application, which is determined by the full scope of the attached claims and their equivalents.

[0095] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several programs to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0096] The logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable programs for implementing the logical functions, and may be embodied in any computer-readable medium for use by a program execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch and execute a program from a program execution system, device or apparatus), or in conjunction with such program execution systems, devices or apparatuses. For purposes of this specification, a "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by a program execution system, device or apparatus, or in conjunction with such program execution systems, devices or apparatuses.

[0097] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0098] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable program execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0099] In the above description of this specification, the description with reference to the terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0100] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.

[0101] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the described embodiments. Technical personnel familiar with the field may make various equivalent modifications or substitutions without violating the spirit of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present application.

Claims

1. A unified configuration management method for an application, characterized in that: The application is located in a Pod, and the method comprises the following steps: Determine the coding identifier of the application according to the preset application coding rule; Determining the configuration information of the application according to a preset application configuration rule; wherein the configuration information includes a coding identifier of the application; According to the Sidecar rule, a configuration proxy service of the application is created in the Pod; the configuration proxy service is used to bind to the coding identifier of the application through the downward API; In response to the configuration information query request of the current application, the current configuration proxy service obtains the configuration information of the current application by accessing the kubernetes API interface, and sends the configuration information of the current application to the current application; The configuration proxy service is configured in a container, and the configuration proxy service of the application is created in the Pod, including: Create a service account; Creating a role and determining the access rights of the role; wherein the access rights allow the role to access the configuration information of the application; Binding the service account and the role to determine access rights of the service account; Mounting the preset label information of the Pod into the preset file of the container through the downward API; wherein the preset label information includes the coding identifier of the application; The current configuration proxy service obtains the configuration information of the current application by accessing the kubernetes API interface, including: The current configuration proxy service obtains the coding identifier of the current application according to the configuration information query request; According to the configuration information query request and the coding identifier of the current application, the configuration information of the current application is obtained by accessing the Kubernetes API interface.

2. The unified configuration management method for applications according to claim 1, characterized in that: Also includes: The configuration proxy service obtains the coding identifier of the application according to the preset file, and obtains the configuration proxy service having a binding relationship with the coding identifier of the application.

3. The unified configuration management method for applications according to claim 1, characterized in that: The determining the configuration information of the application according to the preset application configuration rule includes: The configuration information is stored in the form of key:value; If the configuration information is character-based plain text information, determine that the storage location of the configuration information is the first location in configMap; Alternatively, if the configuration information is plain text information of a file type, determining that the storage location of the configuration information is the second location in the configMap; Alternatively, if the configuration information is character-type ciphertext information, determining that the storage location of the configuration information is the third location in the Secret; Alternatively, if the configuration information is file-type ciphertext information, the storage location of the configuration information is determined to be the fourth location in Secret.

4. The unified configuration management method for applications according to claim 1, characterized in that: The current application sends the configuration information query request through the following steps: The current application sends a configuration information query request by calling the http get interface.

5. The unified configuration management method for applications according to claim 1, characterized in that: Also includes: The temporary storage volume is mounted to a predetermined file in the container where the application is located.

6. A unified configuration management system for applications, characterized in that: include: A first determination module, used to determine the coding identifier of the application according to a preset application coding rule; A second determination module, configured to determine configuration information of the application according to a preset application configuration rule; wherein the configuration information includes a coding identifier of the application; A creation module is used to create a configuration proxy service of the application in the Pod according to the Sidecar rule; the configuration proxy service is used to bind to the coding identifier of the application through the downward API; The configuration proxy module is used to query the configuration information of the current application according to the configuration information of the current application. The current configuration proxy service obtains the configuration information of the current application by accessing the kubernetes API interface, and sends the configuration information of the current application to the current application; The configuration proxy service is configured in the container, creates a module, and is also used to: Create a service account; Creating a role and determining the access rights of the role; wherein the access rights allow the role to access the configuration information of the application; Binding the service account and the role to determine access rights of the service account; Mounting the preset label information of the Pod into the preset file of the container through the downward API; wherein the preset label information includes the coding identifier of the application; Configure the proxy module, also used to: The current configuration proxy service obtains the coding identifier of the current application according to the configuration information query request; According to the configuration information query request and the coding identifier of the current application, the configuration information of the current application is obtained by accessing the Kubernetes API interface.

7. A unified configuration management device for applications, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the unified configuration management method for applications as described in any one of claims 1 to 5.

8. A computer-readable storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to implement the unified configuration management method for applications according to any one of claims 1 to 5 when executed by the processor.

Citation Information

Patent Citations

  • Development environment construction method, apparatus, platform system and storage medium

    CN109104467A

  • Configuration system and method adapting to traditional application cloudization

    CN111198726A

  • Data permission control method and device, server and storage medium

    CN111414643A

  • Front-end page building method and device based on componentization, equipment and storage medium

    CN113419729A

  • Container scheduling method and system, equipment and storage medium

    CN113760452A