Method and device for automatically embedding agent in version management and storage medium

By setting the agent version in the YAML file and utilizing the extended configuration and webhook mechanism of the K8S cluster, it automatically embeds the link tracking agent in the container environment, solving the complexity of manual configuration and version management problems, realizing the consistency and configuration simplification of the agent version.

CN119806617AActive Publication Date: 2025-04-11CHINA CITIC BANK CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411774593.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-04-11
Estimated Expiration
2044-12-05

AI Technical Summary

Technical Problem

In distributed systems, link tracing between microservices is complex and error-prone, especially in container environments. The process of manually configuring link tracing agents is complicated, and the version management of multiple agents is difficult to control, resulting in inconsistent versions of the embedded agents used in different environments.

Method used

By adding the first tag to the YAML file, setting the agent version, and updating the extended configuration in the K8S cluster, using Mutating Webhook and Mutating controller to intercept the YAML file containing the first tag, calling the Webhook to obtain the agent version information, and modifying the YAML file to automatically embed the specified version of the agent.

Benefits of technology

It realizes automatic embedding of link tracking agents in container environments, ensuring that the agent versions embedded in the same application in different environments are consistent, simplifying the manual configuration of developers, and conveniently managing multiple agent versions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806617A_ABST
    Figure CN119806617A_ABST
Patent Text Reader

Abstract

The invention discloses a method for automatically embedding an agent in version management, which comprises the following steps of: setting a label version to be consistent with an access agent version by adding a label to a YAML (Young Attribute Markup Language) file; updating a first extension configuration in the K8S cluster, wherein the first extension configuration is used for intercepting the YAML file containing the tag; when interception occurs, the first extension configuration calls a modification service to modify the YAML file; when it is detected that the YAML file containing the tag is submitted to the K8S cluster for deployment, the second extension configuration intercepts the YAML file containing the tag, the second extension configuration calls the Webhook, the Webhook obtains the tag, and agent configuration information of the corresponding version is inquired according to the version of the tag; the modified YAML file is automatically embedded into the agent application of the version, and the modified YAML file is returned to the K8S cluster. By means of the mode of solidifying the agent version in the application yaml file, it is ensured that the versions of the embedded agents are consistent when the same yaml file is deployed in different environments, and meanwhile by means of the mode of automatically embedding the agents, the manual configuration work of developers is greatly simplified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer science and technology, and in particular to the field of distributed link tracking and automatic embedding of container environment agents, and more particularly to a method, device and storage medium for automatically embedding version management agents. Background Art

[0002] Tracking the call links between microservices in a distributed system is a key step in ensuring system stability and performance optimization. To achieve this tracking, an agent needs to be embedded in the application to collect link data and report it to the backend of the link tracking system for aggregation, analysis, storage, and display. Applications in different languages ​​need to be embedded with agents in different languages. However, with the increase in microservices, applications in the same development language will also embed different versions of agents, making the process of embedding agents more and more complicated. In order to make the application business code unaware of the existence of the agent, in general, embedding the application in the agent requires developers to perform more complex configurations. For example, in the current popular K8S container environment, developers need to perform complex configurations in the YAML file deployed by the application to achieve seamless embedding.

[0003] However, as the process of embedding agents becomes increasingly complex, embedding link tracking agents into applications requires complex manual configuration work, which can easily lead to errors if you are not careful; and multiple agent versions are not easy to manage, which can easily cause the same application to use different agent versions in the test environment and production environment, leading to unexpected results. This application aims to automatically embed link tracking agents in container environments to replace manual configuration work, and at the same time, by solidifying the agent version in the configuration file, it is convenient to manage multiple agent versions and ensure that the same application has the same agent version embedded in different environments. Summary of the invention

[0004] To this end, the present application provides one or more technical solutions to solve the above-mentioned defects of the prior art, realize automatic embedding of link tracking agent in the container environment, and solidify the agent version in the configuration file to facilitate the management of multiple agent versions and ensure that the agent version embedded in different environments for the same application is consistent. The present invention provides a method, device and storage medium for automatic embedding of version management agent to solve at least one of the above-mentioned technical problems.

[0005] To achieve the above objectives, in a first aspect, the present invention provides a method for automatically embedding a version management agent, comprising:

[0006] Add a first tag to the YAML file, where the version corresponding to the first tag is set to be consistent with the access agent version;

[0007] Update a first extended configuration in the K8S cluster, where the first extended configuration sets an interception function, where the interception function is designated to intercept a YAML file containing the first tag; when interception occurs, the first extended configuration calls a modification service to modify the YAML file;

[0008] When it is detected that the YAML file containing the first tag is submitted to the K8S cluster for deployment, the second extended configuration intercepts the YAML file containing the first tag, and the second extended configuration calls the Webhook, the Webhook obtains the first tag, and queries the corresponding version of the agent configuration information according to the first tag version;

[0009] The YAML file is modified by the queried agent configuration information so that the modified YAML file can be automatically embedded in the agent application of the version, and the modified YAML file is returned to the K8S cluster.

[0010] Furthermore, the first extension configuration uses MutatingWebhook, which is used to modify or process the resource object in a customized manner before the resource object is created or updated.

[0011] Furthermore, the second extended configuration adopts a Mutating controller, which intercepts the resource object when it is submitted to the API server and modifies the resource object according to predefined rules. The Mutating controller is used to extend the Kubernetes function and perform customized conversion and modification before the resource object is processed.

[0012] Furthermore, the modification service is an external Webhook service, and the modification method is any one of adding a field, deleting a field, or changing an attribute value.

[0013] In a second aspect, the present invention further provides a device for automatically embedding version management into an agent, the device comprising: a deployment unit, a first extension unit, a second extension unit, and a configuration unit;

[0014] The deployment unit is used to add a first tag to the YAML file, and the version corresponding to the first tag is set to be consistent with the access agent version;

[0015] The first extension unit is used to update a first extension configuration in the K8S cluster, the first extension configuration sets an interception function, and the interception function is designated to intercept a YAML file containing the first tag; when interception occurs, the first extension configuration calls a modification service to modify the YAML file;

[0016] The second extension unit is used for, when a YAML file containing the first tag is detected and submitted to the K8S cluster for deployment, intercepting the YAML file containing the first tag by the second extension configuration, calling a Webhook by the second extension configuration, obtaining the first tag, and querying the corresponding version of the agent configuration information according to the first tag version;

[0017] The configuration unit is used to modify the YAML file through the queried agent configuration information so that the modified YAML file can be automatically embedded in the agent application of the version, and return the modified YAML file to the K8S cluster.

[0018] Furthermore, the first extension configuration uses MutatingWebhook, which is used to modify or process the resource object in a customized manner before the resource object is created or updated.

[0019] Furthermore, the second extended configuration adopts a Mutating controller, which intercepts the resource object when it is submitted to the API server and modifies the resource object according to predefined rules. The Mutating controller is used to extend the Kubernetes function and perform customized conversion and modification before the resource object is processed.

[0020] Furthermore, the modification service is an external Webhook service, and the modification method is any one of adding a field, deleting a field, or changing an attribute value.

[0021] In a third aspect, the present invention provides a computing device, comprising:

[0022] A memory for storing program instructions;

[0023] The processor is used to call the program instructions stored in the memory, and execute the above-mentioned method of automatically embedding a version management agent according to the obtained program instructions.

[0024] In a fourth aspect, the present invention provides a computer-readable storage medium, including computer-readable instructions. When a computer reads and executes the computer-readable instructions, the above-mentioned method of automatically embedding an agent for version management is implemented. The readable medium may be multiple, and the multiple readable media can run independently of each other.

[0025] Compared with the prior art, this solution adds a first tag to the YAML file, and the corresponding version of the first tag is set to be consistent with the access agent version; updates the first extension configuration in the K8S cluster, and the first extension configuration is designated to intercept the YAML file containing the first tag; when interception occurs, the first extension configuration calls the modification service to modify the YAML file; when it is detected that the YAML file containing the first tag is submitted to the K8S cluster for deployment, the second extension configuration intercepts the YAML file containing the first tag, and the second extension configuration calls Webhook, the Webhook obtains the first tag, and queries the corresponding version of the agent configuration information according to the first tag version; modifies the YAML file through the queried agent configuration information so that the modified YAML file can be automatically embedded in the agent application of the version, and returns the modified YAML file to the K8S cluster to continue to create resources and deploy applications. It realizes the automatic embedding of the link tracking agent in the container environment, and at the same time, by solidifying the agent version in the configuration file, it is convenient to manage multiple agent versions and ensure that the same application has the same agent version embedded in different environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0027] Figure 1 A flow chart of an embodiment of the method for automatically embedding a version management agent provided by the present invention;

[0028] Figure 2 A framework diagram of an embodiment of the method for automatically embedding a version management agent provided by the present invention;

[0029] Figure 3 The present invention is a structural block diagram of an embodiment of the device for automatically embedding version management into an agent. DETAILED DESCRIPTION

[0030] The 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 cannot be interpreted as limiting the present application.

[0031] Those skilled in the art will appreciate that, unless expressly stated, the singular forms "a", "an" and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0032] In order to make the objectives, technical solutions and advantages of the present application more clear, the specific implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0033] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:

[0034] Agent: A commonly used technical term that represents other programs or users to perform certain operations or provide certain services to achieve system automation and intelligence.

[0035] Webhook: An automated notification service implemented through an HTTP callback mechanism. When a specific event occurs (such as code submission, resource creation or update, etc.), it triggers a predefined URL or API endpoint to perform the corresponding action or logic.

[0036] Mutating Webhook: An extension mechanism that allows users to modify and automate resource objects through custom webhooks before they are created or updated.

[0037] The core of the present invention is to provide a method for automatically embedding a version management agent. Figure 1 FIG. 1 is a flow chart of a method for automatically embedding a version management agent provided in this embodiment. Figure 2 The figure shows a framework diagram of the method for automatically embedding the version management into the agent provided by this embodiment. In order to better understand the method, Figure 1 and Figure 2 The technical solution of this embodiment is described in detail:

[0038] Step S1: Add a first tag to the YAML file, and the version corresponding to the first tag is set to be consistent with the access agent version;

[0039] In a preferred implementation, an agent-version tag is added to the YAML file of application deployment, and the value of the tag is the agent version specified for access.

[0040] Step S2: Update the first extended configuration in the K8S cluster, where the first extended configuration sets an interception function, where the interception function is designated to intercept the YAML file containing the first tag; when interception occurs, the first extended configuration calls a modification service to modify the YAML file.

[0041] In a preferred embodiment, the Mutating Webhook configuration is updated in the K8S cluster, and the configuration specifies intercepting the YAML file containing the agent-version tag and calling an external Webhook service to modify the YAML file.

[0042] Step S3: When it is detected that the YAML file containing the first tag is submitted to the K8S cluster for deployment, the second extended configuration intercepts the YAML file containing the first tag, and the second extended configuration calls the Webhook. The Webhook obtains the first tag and queries the corresponding version of the agent configuration information according to the first tag version.

[0043] Step S4: modify the YAML file according to the queried agent configuration information so that the modified YAML file can be automatically embedded in the agent application of the version, and return the modified YAML file to the K8S cluster.

[0044] In a preferred embodiment, when a YAML file containing the agent-version tag is submitted to the K8S cluster for deployment, the Mutating controller intercepts the YAML file and calls the Webhook for additional processing. The Webhook performs the following three steps:

[0045] Step S401: extract the version number from the agent-version tag, and query the configuration center for the corresponding version of agent configuration information, such as the agent mirror address, according to the version number.

[0046] Step S402: Modify the YAML file of the application using the configuration information of the current version of the agent to automatically embed the agent of this version into the application.

[0047] Step S403: Return the modified YAML file to the K8S cluster to continue creating resources and deploying applications. When the application is started, the specified version of the agent will be connected.

[0048] In a preferred embodiment, the first extension configuration uses a mutating Webhook to modify or process the resource object in a customized manner before the resource object is created or updated.

[0049] In a preferred embodiment, the second extended configuration uses a mutating controller, which intercepts resource objects when they are submitted to the API server and modifies the resource objects according to predefined rules. The mutating controller is used to extend Kubernetes functions and perform customized conversions and modifications before resource objects are processed.

[0050] In a preferred embodiment, the modification service is an external Webhook service, and the modification method is any one of adding a field, deleting a field, or changing an attribute value.

[0051] In the scheme of this embodiment, by adding a first tag to the YAML file, the corresponding version of the first tag is set to be consistent with the access agent version; the first extension configuration in the K8S cluster is updated, and the first extension configuration is designated to intercept the YAML file containing the first tag; when interception occurs, the first extension configuration calls the modification service to modify the YAML file; when it is detected that the YAML file containing the first tag is submitted to the K8S cluster for deployment, the second extension configuration intercepts the YAML file containing the first tag, and the second extension configuration calls Webhook, which obtains the first tag and queries the corresponding version of the agent configuration information according to the first tag version; the YAML file is modified by the queried agent configuration information so that the modified YAML file can be automatically embedded in the version of the agent application, and the modified YAML file is returned to the K8S cluster to continue creating resources and deploying applications.

[0052] This embodiment ensures that the version of the agent embedded in the same yaml file is consistent when deployed in different environments by solidifying the agent version in the application yaml file. At the same time, the manual configuration work of developers is greatly simplified by automatically embedding the agent.

[0053] In one embodiment, a device for automatically embedding version management into an agent is provided. Figure 3The figure shows a structural block diagram of a device for automatically embedding a version management agent provided by this embodiment, wherein the device comprises: a deployment unit 10, a first extension unit 20, a second extension unit 30, and a configuration unit 40;

[0054] The deployment unit 10 is used to add a first tag to the yaml file, and the version corresponding to the first tag is set to be consistent with the access agent version.

[0055] In a preferred implementation, an agent-version tag is added to the YAML file of application deployment, and the value of the tag is the agent version specified for access.

[0056] The first extension unit 20 is used to update the first extension configuration in the K8S cluster. The first extension configuration sets an interception function, and the interception function is designated to intercept the yaml file containing the first tag; when interception occurs, the first extension configuration calls the modification service to modify the yaml file.

[0057] In a preferred embodiment, the MutatingWebhook configuration is updated in the K8S cluster, and the configuration specifies intercepting the YAML file containing the agent-version tag and calling an external Webhook service to modify the YAML file.

[0058] The second extension unit 30 is used to intercept the yaml file containing the first tag when submitting it to the K8S cluster for deployment according to the detection of the yaml file containing the first tag, and the second extension configuration calls the Webhook, the Webhook obtains the first tag, and queries the corresponding version of the agent configuration information according to the first tag version.

[0059] Configuration unit 40: used to modify the yaml file according to the queried agent configuration information so that the modified yaml file can be automatically embedded in the agent application of the version, and return the modified yaml file to the K8S cluster.

[0060] In a preferred embodiment, when a YAML file containing an agent-version tag is submitted to a K8S cluster for deployment, the Mutating controller intercepts the YAML file and calls a Webhook for additional processing. The configuration unit 40 calls the Webhook to perform three steps:

[0061] Step S401: extract the version number from the agent-version tag, and query the configuration center for the corresponding version of agent configuration information, such as the agent mirror address, according to the version number.

[0062] Step S402: Modify the YAML file of the application using the configuration information of the current version of the agent to automatically embed the agent of this version into the application.

[0063] Step S403: Return the modified YAML file to the K8S cluster to continue creating resources and deploying applications. When the application is started, the specified version of the agent will be connected.

[0064] In a preferred embodiment, the first extension configuration uses mutatingWebhook, which is used to modify or process the resource object in a customized manner before the resource object is created or updated.

[0065] In a preferred embodiment, the second extended configuration uses a mutating controller, which intercepts resource objects when they are submitted to the API server and modifies the resource objects according to predefined rules. The mutating controller is used to extend Kubernetes functions and perform customized conversions and modifications before resource objects are processed.

[0066] In a preferred embodiment, the modification service is an external Webhook service, and the modification method is any one of adding a field, deleting a field, or changing an attribute value.

[0067] In the scheme of this embodiment, by adding a first tag to the YAML file, the corresponding version of the first tag is set to be consistent with the access agent version; the first extension configuration in the K8S cluster is updated, and the first extension configuration is designated to intercept the YAML file containing the first tag; when interception occurs, the first extension configuration calls the modification service to modify the YAML file; when it is detected that the YAML file containing the first tag is submitted to the K8S cluster for deployment, the second extension configuration intercepts the YAML file containing the first tag, and the second extension configuration calls Webhook, which obtains the first tag and queries the corresponding version of the agent configuration information according to the first tag version; the YAML file is modified by the queried agent configuration information so that the modified YAML file can be automatically embedded in the version of the agent application, and the modified YAML file is returned to the K8S cluster to continue creating resources and deploying applications.

[0068] This embodiment ensures that the version of the agent embedded in the same yaml file is consistent when deployed in different environments by solidifying the agent version in the application yaml file. At the same time, the manual configuration work of developers is greatly simplified by automatically embedding the agent.

[0069] The device for automatically embedding version management into an agent in this embodiment is used to implement the aforementioned method for automatically embedding version management into an agent. Therefore, the specific implementation of the device for automatically embedding version management into an agent can be seen from the specific implementation of the method for automatically embedding version management into an agent in the aforementioned text. For example, the deployment unit 10 is used to implement step S1 in the aforementioned method for automatically embedding version management into an agent, and the first extension unit 20 is used to implement step S2 in the aforementioned method for automatically embedding version management into an agent, etc. Therefore, its specific implementation can refer to the description of the corresponding various partial embodiments. The device provided by the present invention is attached to the method provided by the present invention, and its specific effects can refer to the aforementioned method, which will not be repeated here.

[0070] In one embodiment, a computing device is provided, comprising:

[0071] A memory for storing program instructions;

[0072] A processor is used to implement the steps of the method for automatically embedding version management into an agent as described in any of the above when executing the computer program. A method for automatically embedding version management into an agent of the present invention has obvious advantages and beneficial effects compared with the prior art. By adding a first tag to a YAML file, the version corresponding to the first tag is set to be consistent with the access agent version; the first extension configuration in the K8S cluster is updated, and the first extension configuration is designated to intercept the YAML file containing the first tag; when interception occurs, the first extension configuration calls the modification service to modify the YAML file; when it is detected that the YAML file containing the first tag is submitted to the K8S cluster for deployment, the second extension configuration intercepts the YAML file containing the first tag, and the second extension configuration calls Webhook, which obtains the first tag and queries the agent configuration information of the corresponding version according to the first tag version; the YAML file is modified by the queried agent configuration information so that the modified YAML file can be automatically embedded in the agent application of the version, and the modified YAML file is returned to the K8S cluster to continue to create resources and deploy applications. By solidifying the agent version in the application YAML file, the agent version embedded in the same YAML file is ensured to be consistent when deployed in different environments. At the same time, the automatic embedding of the agent greatly simplifies the manual configuration work of developers.

[0073] In one embodiment, a computer-readable storage medium is provided, comprising computer-readable instructions. When a computer reads and executes the computer-readable instructions, the steps of the method for automatically embedding a version management agent described above are implemented. The method for automatically embedding a version management agent of the present invention has obvious advantages and beneficial effects compared with the prior art. By adding a first tag to a YAML file, the version corresponding to the first tag is set to be consistent with the access agent version; a first extension configuration in a K8S cluster is updated, and the first extension configuration is designated to intercept a YAML file containing the first tag; when interception occurs, the first extension configuration calls a modification service to modify the YAML file; when it is detected that a YAML file containing the first tag is submitted to the K8S cluster for deployment, a second extension configuration intercepts the YAML file containing the first tag, and the second extension configuration calls a Webhook, which obtains the first tag and queries the agent configuration information of the corresponding version according to the first tag version; the YAML file is modified by the queried agent configuration information so that the modified YAML file can be automatically embedded in the agent application of the version, and the modified YAML file is returned to the K8S cluster to continue creating resources and deploying applications. By solidifying the agent version in the application YAML file, the agent version embedded in the same YAML file is ensured to be consistent when deployed in different environments. At the same time, the automatic embedding of the agent greatly simplifies the manual configuration work of developers.

[0074] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the specific device can be divided into different functional modules to complete all or part of the functions described above.

[0075] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0076] In several embodiments covered by the present application, it should be understood that the disclosed devices, equipment and methods can be implemented in other ways. For example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, or it can be an electrical, mechanical or other form of connection.

[0077] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0078] In addition, each functional module in each embodiment of the present application can be implemented in the form of hardware or in the form of software functional modules. If these functional modules are implemented in the form of software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application is essentially or part of the prior art that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a computer program product, which includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer program product is stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, a computer instruction can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrations. The available media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state disks (SSDs)).

[0079] The above contents are merely examples and explanations of the structure of the present invention. The technicians in this technical field may make various modifications or additions to the specific embodiments described or replace them in a similar manner. As long as they do not deviate from the structure of the invention or exceed the scope defined by the claims, they should all fall within the protection scope of the present invention.

Claims

1. A method for automatically embedding version management into an agent, characterized in that: include: Add a first tag to the YAML file, where the version corresponding to the first tag is set to be consistent with the access agent version; Update a first extended configuration in the K8S cluster, wherein the first extended configuration sets an interception function, and the interception function is designated to intercept the YAML file containing the first tag; When interception occurs, the first extension configuration calls a modification service to modify the YAML file; When it is detected that the YAML file containing the first tag is submitted to the K8S cluster for deployment, the second extended configuration intercepts the YAML file containing the first tag, and the second extended configuration calls the Webhook, the Webhook obtains the first tag, and queries the corresponding version of the agent configuration information according to the first tag version; The YAML file is modified by the queried agent configuration information so that the modified YAML file can be automatically embedded in the agent application of the version, and the modified YAML file is returned to the K8S cluster.

2. The method for automatically embedding version management into an agent according to claim 1, characterized in that: The first extension configuration uses MutatingWebhook, which is used to modify or process the resource object in a customized manner before the resource object is created or updated.

3. The method for automatically embedding version management into an agent according to claim 1, characterized in that: The second extended configuration uses a Mutating controller, which intercepts resource objects when they are submitted to the API server and modifies the resource objects according to predefined rules. The Mutating controller is used to extend Kubernetes functions and perform customized conversions and modifications before resource objects are processed.

4. The method for automatically embedding version management into an agent according to claim 1, characterized in that: The modification service is an external Webhook service, and the modification method is any one of adding a field, deleting a field, or changing an attribute value.

5. A device for automatically embedding version management into an agent, characterized in that: include: A deployment unit, a first expansion unit, a second expansion unit, and a configuration unit; The deployment unit is configured to add a first tag to the YAML file, wherein a version corresponding to the first tag is set to be consistent with a version of the access agent; The first extension unit is used to update a first extension configuration in the K8S cluster, wherein the first extension configuration sets an interception function, and the interception function is designated to intercept a YAML file containing the first tag; When interception occurs, the first extension configuration calls a modification service to modify the YAML file; The second extension unit is used for, when a YAML file containing the first tag is detected and submitted to the K8S cluster for deployment, intercepting the YAML file containing the first tag by the second extension configuration, calling a Webhook by the second extension configuration, obtaining the first tag, and querying the corresponding version of the agent configuration information according to the first tag version; The configuration unit is used to modify the YAML file through the queried agent configuration information so that the modified YAML file can be automatically embedded in the agent application of the version, and return the modified YAML file to the K8S cluster.

6. The device for automatically embedding version management into an agent according to claim 5, characterized in that: The first extension configuration uses MutatingWebhook, which is used to modify or process the resource object in a customized manner before the resource object is created or updated.

7. The device for automatically embedding version management into an agent according to claim 5, characterized in that: The second extended configuration uses a Mutating controller, which intercepts resource objects when they are submitted to the API server and modifies the resource objects according to predefined rules. The Mutating controller is used to extend Kubernetes functions and perform customized conversions and modifications before resource objects are processed.

8. The device for automatically embedding version management into an agent according to claim 5, characterized in that: The modification service is an external Webhook service, and the modification method is any one of adding a field, deleting a field, or changing an attribute value.

9. A computing device, characterized in that include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the method according to any one of claims 1 to 4 according to the obtained program instructions.

10. A computer-readable storage medium, characterized in that: It includes computer-readable instructions. When a computer reads and executes the computer-readable instructions, it implements the method as claimed in any one of claims 1 to 4. There can be multiple readable media, and the multiple readable media can operate independently of each other.

Citation Information

Patent Citations

  • Method and system for automatically deploying IAST agent in k8s

    CN113722048A

  • Container cluster deployment method, device and system, electronic equipment and storage medium

    CN115857982A

  • K8s-based yaml adaptive deployment method and device

    CN116795386A

  • Multi-cluster sidecar injection method based on kubernetes

    CN118113414A

  • Method and system for modifying and validating API requests

    US12003543B1