Configuration editing method and device, storage medium and electronic device
Patent Information
- Application Number
- CN202310548708.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-16
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2043-05-16
AI Technical Summary
[0003]由于各种原因通常存在更新接口对象(ingress)的证书配置的需求,目前的方式,通常是相关用户手动对容器编排引擎(k8s)集群中接口对象的证书配置进行对接编辑,在大规模容器编排引擎(k8s)集群中会存在上百个接口对象(ingress),手动编辑容易造成配置修改错误或遗漏等问题,修改后容易对容器编排引擎(k8s)集群造成不良影响,编辑效率较低,且用户与集群深度关联导致安全性较低
[0025] In this way, the server provides different configuration editing interfaces for editing the certificate configuration of interface objects in the Kubernetes (K8s) cluster. The server receives configuration editing requests through these interfaces and generates configurations to be processed based on these requests, allowing for editing of the target interface object's configuration. By isolating the Kubernetes cluster from the user through the server, secure user operations on the cluster are achieved. This reduces the difficulty of using the Kubernetes cluster while ensuring cluster security. Furthermore, the server can easily perform batch configuration editing operations based on these requests, reducing the manpower costs of manual maintenance and the adverse effects of errors on the cluster. Therefore, overall, this approach effectively improves the reliability, security, and efficiency of editing the certificate configuration of interface objects in the Kubernetes cluster.
Smart Images

Figure CN117407077B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more specifically to a configuration editing method, apparatus, storage medium, and electronic device. Background Technology
[0002] After services are containerized and integrated into a Kubernetes (k8s) cluster, they typically need to use ingress objects to expose domain names for external users to access the Kubernetes cluster. To ensure secure domain name access, each ingress object is configured with a certificate.
[0003] For various reasons, there is often a need to update the certificate configuration of interface objects (ingresses). Currently, the usual approach is for relevant users to manually edit the certificate configuration of interface objects in the container orchestration engine (k8s) cluster. In large-scale container orchestration engine (k8s) clusters, there may be hundreds of interface objects (ingresses). Manual editing is prone to problems such as configuration modification errors or omissions. After modification, it can easily have adverse effects on the container orchestration engine (k8s) cluster. The editing efficiency is low, and the deep connection between users and the cluster leads to low security.
[0004] Therefore, the current editing of certificate configurations for interface objects in Kubernetes (Kubernetes) clusters suffers from poor reliability, security, and editing efficiency. Summary of the Invention
[0005] This application provides a solution that can effectively improve the reliability, security, and efficiency of editing certificate configurations for interface objects in a container orchestration engine (k8s) cluster.
[0006] The embodiments of this application provide the following technical solutions:
[0007] According to one embodiment of this application, a configuration editing method is applied to a server. The server includes different configuration editing interfaces and is used to interact with a container orchestration engine cluster. The configuration editing method includes: receiving a corresponding configuration editing request through the configuration editing interface; generating a configuration to be processed according to the configuration editing request; traversing preset interface objects to obtain a target interface object, wherein the preset interface object is an interface object that manages external access to services in the container orchestration engine cluster; and editing the configuration of the target interface object according to the configuration to be processed.
[0008] In some embodiments of this application, the configuration editing request includes a certificate update request; generating a configuration to be processed according to the configuration editing request includes: creating a first certificate key information object based on the certificate key to be updated according to the certificate update request; encapsulating the first certificate key information object to obtain the configuration to be updated, the configuration to be processed including the configuration to be updated; editing the configuration of the target interface object according to the configuration to be processed includes: updating the certificate configuration of the target interface object based on the configuration to be updated.
[0009] In some embodiments of this application, the step of creating a certificate key information object based on the certificate key to be updated includes: obtaining the certificate key to be updated under different domain names; creating a first certificate key information object in the namespace corresponding to the domain name in the container orchestration engine cluster according to the domain name corresponding to each certificate key to be updated; the step of updating the certificate configuration of the target interface object based on the configuration to be updated includes: updating the certificate configuration of the target interface object corresponding to the namespace based on the configuration to be updated in different namespaces.
[0010] In some embodiments of this application, the configuration editing request includes a certificate addition request; generating a configuration to be processed based on the configuration editing request includes: creating a second certificate key information object based on the certificate key to be updated according to the certificate addition request; encapsulating the second certificate key information object to obtain a configuration to be added, the configuration to be processed including the configuration to be added; editing the configuration of the target interface object according to the configuration to be processed includes: adding the configuration to be added as the certificate configuration of the target interface object.
[0011] In some embodiments of this application, the method further includes: determining whether a certificate configuration exists in the object configuration of the target interface object; if it does not exist, adding the configuration to be added; otherwise, if it exists, returning the existing certificate configuration.
[0012] In some embodiments of this application, the configuration editing request includes a certificate deletion request; generating a configuration to be processed based on the configuration editing request includes generating an empty certificate configuration based on the certificate deletion request, the configuration to be processed including the empty certificate configuration; editing the configuration of the target interface object based on the configuration to be processed includes updating the certificate configuration of the target interface object based on the empty certificate configuration.
[0013] In some embodiments of this application, the method further includes: determining whether a certificate configuration exists in the object configuration of the target interface object; if it does not exist, returning that the certificate does not exist; otherwise, if it exists, updating the certificate configuration.
[0014] According to one embodiment of this application, a configuration editing device is applied to a server. The server includes different configuration editing interfaces and is used to interact with a container orchestration engine cluster. The configuration editing device includes: a receiving module for receiving corresponding configuration editing requests through the configuration editing interfaces; a generating module for generating a configuration to be processed according to the configuration editing requests; a traversal module for traversing preset interface objects to obtain a target interface object, wherein the preset interface object is an interface object for managing external access to services in the container orchestration engine cluster; and an editing module for editing the configuration of the target interface object according to the configuration to be processed.
[0015] In some embodiments of this application, the configuration editing request includes a certificate update request; the generation module is configured to: create a first certificate key information object based on the certificate key to be updated according to the certificate update request; encapsulate the first certificate key information object to obtain the configuration to be updated, the configuration to be processed including the configuration to be updated; the editing module is configured to: update the certificate configuration of the target interface object based on the configuration to be updated.
[0016] In some embodiments of this application, the generation module is used to: obtain certificate keys to be updated under different domain names; create a first certificate key information object in the namespace corresponding to the domain name in the container orchestration engine cluster according to the domain name corresponding to each certificate key to be updated; the editing module is used to: update the certificate configuration of the target interface object corresponding to the namespace based on the configuration to be updated in different namespaces.
[0017] In some embodiments of this application, the configuration editing request includes a certificate addition request; the generation module is configured to: create a second certificate key information object based on the certificate key to be updated according to the certificate addition request; encapsulate the second certificate key information object to obtain the configuration to be added, the configuration to be processed including the configuration to be added; the editing module is configured to: add the configuration to be added as the certificate configuration of the target interface object.
[0018] In some embodiments of this application, the device further includes a first determination module, configured to: determine whether a certificate configuration exists in the object configuration of the target interface object; if it does not exist, add the configuration to be added; otherwise, if it exists, return the stored certificate configuration.
[0019] In some embodiments of this application, the configuration editing request includes a certificate deletion request; the generation module is configured to: generate an empty certificate configuration based on the certificate deletion request, and the configuration to be processed includes the empty certificate configuration; the editing module is configured to: update the certificate configuration of the target interface object based on the empty certificate configuration.
[0020] In some embodiments of this application, the device further includes a second determination module, configured to: determine whether a certificate configuration exists in the object configuration of the target interface object; if not, return that the certificate does not exist; otherwise, if it exists, update the certificate configuration.
[0021] According to another embodiment of this application, a storage medium stores a computer program thereon, which, when executed by a computer's processor, causes the computer to perform the methods described in the embodiments of this application.
[0022] According to another embodiment of this application, an electronic device may include: a memory storing a computer program; and a processor reading the computer program stored in the memory to execute the methods described in the embodiments of this application.
[0023] According to another embodiment of this application, a computer program product or computer program includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations described in the embodiments of this application.
[0024] In this embodiment of the application, a server is provided, which includes different configuration editing interfaces. The server is used to interact with a container orchestration engine cluster. The server can execute a configuration editing method: receiving a corresponding configuration editing request through the configuration editing interface; generating a configuration to be processed according to the configuration editing request; and traversing a preset interface object to obtain a target interface object, wherein the preset interface object is an interface object that manages external access to services in the container orchestration engine cluster; and editing the configuration of the target interface object according to the configuration to be processed.
[0025] In this way, the server provides different configuration editing interfaces for editing the certificate configuration of interface objects in the Kubernetes (K8s) cluster. The server receives configuration editing requests through these interfaces and generates configurations to be processed based on these requests, allowing for editing of the target interface object's configuration. By isolating the Kubernetes cluster from the user through the server, secure user operations on the cluster are achieved. This reduces the difficulty of using the Kubernetes cluster while ensuring cluster security. Furthermore, the server can easily perform batch configuration editing operations based on these requests, reducing the manpower costs of manual maintenance and the adverse effects of errors on the cluster. Therefore, overall, this approach effectively improves the reliability, security, and efficiency of editing the certificate configuration of interface objects in the Kubernetes cluster. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 A flowchart of a configuration editing method according to an embodiment of this application is shown.
[0028] Figure 2 A block diagram of a configuration editing apparatus according to an embodiment of this application is shown.
[0029] Figure 3 A block diagram of an electronic device according to an embodiment of this application is shown. Detailed Implementation
[0030] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0031] Figure 1 A flowchart illustrating a configuration editing method according to an embodiment of this application is shown. The entity executing this configuration editing method can be any device with processing capabilities, such as a server, computer, mobile phone, television, smartwatch, and home appliance.
[0032] The device acting as the execution entity can host a server, which may include different configuration editing interfaces. This server can be used to interact with a container orchestration engine cluster. For example... Figure 1 As shown, the server can execute a configuration editing method, which may include steps S110 to S140.
[0033] Step S110: Receive the corresponding configuration editing request through the configuration editing interface; Step S120: Generate a configuration to be processed according to the configuration editing request; and Step S130: Traverse the preset interface objects to obtain the target interface object, wherein the preset interface object is an interface object for managing external access to services in the container orchestration engine cluster; Step S140: Edit the configuration of the target interface object according to the configuration to be processed.
[0034] Different configuration editing interfaces can include configuration update, configuration deletion, or configuration addition interfaces. Relevant users can access these interfaces to send corresponding configuration editing requests. In one scenario, the Gin framework (an open-source Go language web service framework) can be used as the web server to expose configuration editing interfaces that update, delete, or add ingress configurations in the Kubernetes (k8s) cluster. The server can use the client-go toolkit to access the Kubernetes cluster and perform batch updates, deletions, or additions of ingress configurations. It's understandable that other types of web server frameworks can be used as the server in other scenarios.
[0035] Different configuration editing interfaces can receive different configuration editing requests. For example, the configuration update interface can receive corresponding configuration update requests, the configuration delete interface can receive corresponding configuration delete requests, and the configuration add interface can receive corresponding configuration add requests. Based on different configuration editing requests, corresponding configurations to be processed can be generated. Then, multiple preset interface objects in the container orchestration engine cluster are traversed to obtain one or more preset interface objects and target interface objects to be edited.
[0036] The configuration corresponding to the target interface object can be edited based on the configuration to be processed. When there are multiple target interface objects, batch editing can be achieved. If the configuration editing request is a certificate update request, the certificate configuration corresponding to the target interface object can be updated based on the configuration to be processed. If the configuration editing request is a certificate deletion request, the certificate configuration corresponding to the target interface object can be deleted based on the configuration to be processed. If the configuration editing request is a certificate addition request, the certificate configuration corresponding to the target interface object can be added based on the configuration to be processed.
[0037] In this way, based on steps S110 to S140, the server provides different configuration editing interfaces for editing the certificate configuration of interface objects in the Kubernetes (k8s) cluster. The server receives configuration editing requests through these interfaces and generates configurations to be processed based on these requests, allowing for editing of the target interface object's configuration. By isolating the Kubernetes cluster from the user through the server, secure user operations on the cluster are achieved, reducing the difficulty of using the Kubernetes cluster while ensuring cluster security. Furthermore, the server can easily perform batch configuration editing operations based on these requests, reducing the labor costs of manual maintenance and the adverse effects of errors on the cluster. Therefore, overall, this approach effectively improves the reliability, security, and efficiency of editing the certificate configuration of interface objects in the Kubernetes cluster.
[0038] The following description Figure 1 Further optional specific embodiments are provided for each step performed during configuration editing in the example implementation.
[0039] In one embodiment, the configuration editing request includes a certificate update request; generating a configuration to be processed based on the configuration editing request includes: creating a first certificate key information object based on the certificate key to be updated according to the certificate update request; encapsulating the first certificate key information object to obtain the configuration to be updated, the configuration to be processed including the configuration to be updated; editing the configuration of the target interface object according to the configuration to be processed includes: updating the certificate configuration of the target interface object based on the configuration to be updated.
[0040] The configuration update interface can receive certificate update requests. Based on the certificate update request, a first certificate key information object can be created based on the certificate key to be updated. The certificate key to be updated can be retrieved from a predetermined location, for example, it can be automatically obtained from a specified cloud provider through a selected interface or manually obtained. Specifically, the first certificate key information object can be an information object (secret object) storing key information in the container orchestration engine (Kubernetes) cluster.
[0041] Furthermore, by encapsulating the first certificate key information object, an update-pending configuration conforming to the configuration standard of the interface object can be obtained. This update-pending configuration is a configuration to be processed. Subsequently, based on this update-pending configuration, the original certificate configuration of the target interface object can be updated and replaced, thereby updating the certificate configuration of the target interface object.
[0042] In one embodiment, creating a certificate key information object based on the certificate key to be updated includes: obtaining the certificate key to be updated under different domains; creating a first certificate key information object in the namespace corresponding to the domain in the container orchestration engine cluster according to the domain corresponding to each certificate key to be updated; updating the certificate configuration of the target interface object based on the configuration to be updated includes: updating the certificate configuration of the target interface object corresponding to the namespace based on the configuration to be updated in different namespaces.
[0043] The obtained certificate keys to be updated can correspond to different domain names. Based on the domain name corresponding to each certificate key to be updated, a first certificate key information object is created in the namespace corresponding to the domain name in the container orchestration engine cluster. For example, based on the certificate keys to be updated under domain A, a first certificate key information object is created in the namespace corresponding to domain A.
[0044] Furthermore, based on the configurations to be updated in different namespaces, the certificate configuration of the target interface object corresponding to the namespace is updated, further improving the batch update effect of certificate configuration.
[0045] In one embodiment, the configuration editing request includes a certificate addition request; generating a configuration to be processed based on the configuration editing request includes: creating a second certificate key information object based on the certificate key to be updated according to the certificate addition request; encapsulating the second certificate key information object to obtain a configuration to be added, the configuration to be processed including the configuration to be added; editing the configuration of the target interface object according to the configuration to be processed includes: adding the configuration to be added as the certificate configuration of the target interface object.
[0046] The configuration interface can receive certificate addition requests. Based on the certificate addition request, a second certificate key information object can be created using the certificate key to be updated. The certificate key to be updated can be retrieved from a predetermined location, such as automatically or manually obtained from a specified cloud provider through a selected interface. The second certificate key information object can specifically be a secret object (information object) storing key information within the Kubernetes (Kubernetes) cluster.
[0047] Furthermore, by encapsulating the second certificate key information object, a configuration to be added that conforms to the configuration standard of the interface object can be obtained. This configuration to be added is a configuration to be processed. Subsequently, the configuration to be added can be added to the configuration of the target interface object, thus becoming the certificate configuration of the target interface object.
[0048] In one embodiment, the method further includes: determining whether a certificate configuration exists in the object configuration of the target interface object; if it does not exist, adding the configuration to be added; otherwise, if it exists, returning the existing certificate configuration.
[0049] Before adding the configuration to be added as the certificate configuration of the target interface object, it can be first determined whether the target interface object already has a certificate configuration. If the certificate configuration does not exist, the configuration to be added is added as the certificate configuration of the target interface object; otherwise, if it exists, the existing certificate configuration of the target interface object can be returned for relevant users to view.
[0050] In one embodiment, the configuration editing request includes a certificate deletion request; generating a pending configuration based on the configuration editing request includes generating an empty certificate configuration based on the certificate deletion request, the pending configuration including the empty certificate configuration; editing the configuration of the target interface object based on the pending configuration includes updating the certificate configuration of the target interface object based on the empty certificate configuration.
[0051] The configuration delete interface can receive certificate deletion requests. Based on these requests, an empty certificate configuration can be generated, containing no certificates. Furthermore, based on this empty certificate configuration, an existing certificate configuration of the target interface object can be replaced or updated, thereby deleting the existing certificate of the target interface object.
[0052] In one embodiment, the method further includes: determining whether a certificate configuration exists in the object configuration of the target interface object; if it does not exist, returning "certificate does not exist"; otherwise, if it exists, updating the certificate configuration.
[0053] Before updating the certificate configuration of the target interface object based on the empty certificate configuration, it is first determined whether the certificate configuration exists in the object configuration of the target interface object. If it does not exist, it means that it does not need to be deleted, and a message indicating that the certificate does not exist can be returned to the relevant user. Otherwise, if it exists, the existing certificate configuration of the target interface object can be replaced and updated using the empty certificate configuration.
[0054] To facilitate better implementation of the configuration editing method provided in the embodiments of this application, the embodiments of this application also provide a configuration editing device based on the above configuration editing method. The meanings of the terms used are the same as in the configuration editing method described above, and specific implementation details can be found in the descriptions in the method embodiments. Figure 2 A block diagram of a configuration editing apparatus according to an embodiment of this application is shown.
[0055] like Figure 2As shown, the configuration editing device 200 can be applied to a server. The server includes different configuration editing interfaces and is used to interact with the container orchestration engine cluster. The configuration editing device 200 includes: a receiving module 210 for receiving corresponding configuration editing requests through the configuration editing interfaces; a generating module 220 for generating configurations to be processed based on the configuration editing requests; and a traversal module 230 for traversing preset interface objects to obtain target interface objects, wherein the preset interface objects are interface objects that manage external access to services in the container orchestration engine cluster; and an editing module 240 for editing the configuration of the target interface object based on the configurations to be processed.
[0056] In some embodiments of this application, the configuration editing request includes a certificate update request; the generation module is configured to: create a first certificate key information object based on the certificate key to be updated according to the certificate update request; encapsulate the first certificate key information object to obtain the configuration to be updated, the configuration to be processed including the configuration to be updated; the editing module is configured to: update the certificate configuration of the target interface object based on the configuration to be updated.
[0057] In some embodiments of this application, the generation module is used to: obtain certificate keys to be updated under different domain names; create a first certificate key information object in the namespace corresponding to the domain name in the container orchestration engine cluster according to the domain name corresponding to each certificate key to be updated; the editing module is used to: update the certificate configuration of the target interface object corresponding to the namespace based on the configuration to be updated in different namespaces.
[0058] In some embodiments of this application, the configuration editing request includes a certificate addition request; the generation module is configured to: create a second certificate key information object based on the certificate key to be updated according to the certificate addition request; encapsulate the second certificate key information object to obtain the configuration to be added, the configuration to be processed including the configuration to be added; the editing module is configured to: add the configuration to be added as the certificate configuration of the target interface object.
[0059] In some embodiments of this application, the device further includes a first determination module, configured to: determine whether a certificate configuration exists in the object configuration of the target interface object; if it does not exist, add the configuration to be added; otherwise, if it exists, return the stored certificate configuration.
[0060] In some embodiments of this application, the configuration editing request includes a certificate deletion request; the generation module is configured to: generate an empty certificate configuration based on the certificate deletion request, and the configuration to be processed includes the empty certificate configuration; the editing module is configured to: update the certificate configuration of the target interface object based on the empty certificate configuration.
[0061] In some embodiments of this application, the device further includes a second determination module, configured to: determine whether a certificate configuration exists in the object configuration of the target interface object; if not, return that the certificate does not exist; otherwise, if it exists, update the certificate configuration.
[0062] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0063] Furthermore, embodiments of this application also provide an electronic device, which can be a terminal or a server, such as... Figure 3 As shown, it illustrates a structural schematic diagram of the electronic device involved in the embodiments of this application, specifically:
[0064] The electronic device may include components such as a processor 301 with one or more processing cores, a memory 302 with one or more computer-readable storage media, a power supply 303, and an input unit 304. Those skilled in the art will understand that... Figure 3 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0065] in:
[0066] The processor 301 is the control center of the electronic device. It connects to various parts of the computer device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 302, and by calling data stored in the memory 302, it performs various functions of the computer device and processes data, thereby providing overall monitoring of the electronic device. Optionally, the processor 301 may include one or more processing cores; preferably, the processor 301 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user page, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 301.
[0067] The memory 302 can be used to store software programs and modules. The processor 301 executes various functional applications and data processing by running the software programs and modules stored in the memory 302. The memory 302 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 302 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 302 may also include a memory controller to provide the processor 301 with access to the memory 302.
[0068] The electronic device also includes a power supply 303 that supplies power to various components. Preferably, the power supply 303 can be logically connected to the processor 301 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 303 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0069] The electronic device may also include an input unit 304, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0070] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 301 in the electronic device loads the executable files corresponding to the processes of one or more computer programs into the memory 302 according to the following instructions, and the processor 301 runs the computer programs stored in the memory 302, thereby realizing the various functions in the foregoing embodiments of this application. For example, the processor 301 can perform the following steps:
[0071] The configuration editing interface receives the corresponding configuration editing request; generates a configuration to be processed based on the configuration editing request; and iterates through preset interface objects to obtain a target interface object, wherein the preset interface object is an interface object that manages external access to services in the container orchestration engine cluster; and edits the configuration of the target interface object based on the configuration to be processed.
[0072] In some embodiments of this application, the configuration editing request includes a certificate update request; generating a configuration to be processed according to the configuration editing request includes: creating a first certificate key information object based on the certificate key to be updated according to the certificate update request; encapsulating the first certificate key information object to obtain the configuration to be updated, the configuration to be processed including the configuration to be updated; editing the configuration of the target interface object according to the configuration to be processed includes: updating the certificate configuration of the target interface object based on the configuration to be updated.
[0073] In some embodiments of this application, the step of creating a certificate key information object based on the certificate key to be updated includes: obtaining the certificate key to be updated under different domain names; creating a first certificate key information object in the namespace corresponding to the domain name in the container orchestration engine cluster according to the domain name corresponding to each certificate key to be updated; the step of updating the certificate configuration of the target interface object based on the configuration to be updated includes: updating the certificate configuration of the target interface object corresponding to the namespace based on the configuration to be updated in different namespaces.
[0074] In some embodiments of this application, the configuration editing request includes a certificate addition request; generating a configuration to be processed based on the configuration editing request includes: creating a second certificate key information object based on the certificate key to be updated according to the certificate addition request; encapsulating the second certificate key information object to obtain a configuration to be added, the configuration to be processed including the configuration to be added; editing the configuration of the target interface object according to the configuration to be processed includes: adding the configuration to be added as the certificate configuration of the target interface object.
[0075] In some embodiments of this application, the method further includes: determining whether a certificate configuration exists in the object configuration of the target interface object; if it does not exist, adding the configuration to be added; otherwise, if it exists, returning the existing certificate configuration.
[0076] In some embodiments of this application, the configuration editing request includes a certificate deletion request; generating a configuration to be processed based on the configuration editing request includes generating an empty certificate configuration based on the certificate deletion request, the configuration to be processed including the empty certificate configuration; editing the configuration of the target interface object based on the configuration to be processed includes updating the certificate configuration of the target interface object based on the empty certificate configuration.
[0077] In some embodiments of this application, the method further includes: determining whether a certificate configuration exists in the object configuration of the target interface object; if it does not exist, returning that the certificate does not exist; otherwise, if it exists, updating the certificate configuration.
[0078] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by a computer program, or by a computer program controlling related hardware. The computer program can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0079] Therefore, embodiments of this application also provide a storage medium storing a computer program that can be loaded by a processor to execute the steps in any of the methods provided in embodiments of this application.
[0080] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0081] Since the computer program stored in the storage medium can execute the steps of any of the methods provided in the embodiments of this application, the beneficial effects that the methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.
[0082] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0083] It should be understood that this application is not limited to the embodiments described above and shown in the accompanying drawings, but various modifications and changes can be made without departing from its scope.
Claims
1. A configuration editing method, characterized in that, Applied to the server side, the server side includes different configuration editing interfaces, the server side is used to interact with the container orchestration engine cluster, and the configuration editing method includes: The corresponding configuration editing request is received through the configuration editing interface; Based on the configuration edit request, a pending configuration is generated through update, delete, or add operations; and... Traverse the preset interface objects to obtain the target interface object, where the preset interface object is an interface object that manages external access to services in the container orchestration engine cluster; The configuration of the target interface object is edited according to the configuration to be processed.
2. The method according to claim 1, characterized in that, The configuration editing request includes a certificate update request; the step of generating a configuration to be processed based on the configuration editing request through update, deletion, or addition operations includes: Based on the certificate update request, create a first certificate key information object based on the certificate key to be updated; The first certificate key information object is encapsulated to obtain the configuration to be updated, and the configuration to be processed includes the configuration to be updated; The step of editing the configuration of the target interface object according to the configuration to be processed includes: Update the certificate configuration of the target interface object based on the configuration to be updated.
3. The method according to claim 2, characterized in that, The creation of a certificate key information object based on the certificate key to be updated includes: Obtain the certificate keys to be updated under different domains; Based on the domain name corresponding to each of the certificate keys to be updated, a first certificate key information object is created in the namespace corresponding to the domain name in the container orchestration engine cluster. The process of updating the certificate configuration of the target interface object based on the configuration to be updated includes: Based on the configuration to be updated in different namespaces, update the certificate configuration of the target interface object corresponding to the namespace.
4. The method according to claim 1, characterized in that, The configuration editing request includes a certificate addition request; the process of generating a configuration to be processed based on the configuration editing request through update, deletion, or addition operations includes: Based on the certificate addition request, create a second certificate key information object based on the certificate key to be updated; The second certificate key information object is encapsulated to obtain the configuration to be added, and the configuration to be processed includes the configuration to be added; The step of editing the configuration of the target interface object according to the configuration to be processed includes: Add the configuration to be added as the certificate configuration of the target interface object.
5. The method according to claim 4, characterized in that, The method further includes: Determine whether a certificate configuration exists in the object configuration of the target interface object. If it does not exist, add the configuration to be added; otherwise, if it exists, return the existing certificate configuration.
6. The method according to claim 1, characterized in that, The configuration editing request includes a certificate deletion request; the step of generating a configuration to be processed based on the configuration editing request through update, deletion, or addition operations includes: An empty certificate configuration is generated based on the certificate deletion request, and the configuration to be processed includes the empty certificate configuration. The step of editing the configuration of the target interface object according to the configuration to be processed includes: Update the certificate configuration of the target interface object based on the empty certificate configuration.
7. The method according to claim 6, characterized in that, The method further includes: Determine whether a certificate configuration exists in the object configuration of the target interface object. If it does not exist, return that the certificate does not exist; otherwise, if it exists, update the certificate configuration.
8. A configuration editing device, characterized in that, Applied to the server side, the server side includes different configuration editing interfaces, the server side is used to interact with the container orchestration engine cluster, and the configuration editing device includes: The receiving module is used to receive the corresponding configuration editing request through the configuration editing interface; The generation module is used to generate a configuration to be processed based on the configuration editing request through update, deletion, or addition operations; and, The traversal module is used to traverse preset interface objects to obtain target interface objects. The preset interface objects are interface objects that manage external access to services in the container orchestration engine cluster. The editing module is used to edit the configuration of the target interface object according to the configuration to be processed.
9. A storage medium, characterized in that, It stores a computer program that, when executed by the computer's processor, causes the computer to perform the method described in any one of claims 1 to 7.
10. An electronic device, characterized in that, include: Memory, which stores computer programs; A processor reads a computer program stored in memory to perform the method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for replacing big data computing job data source based on Kubernetes
CN114490834A
System and method for applying development patterns for component based applications
CN1834908A