Method and system for applying dynamic updates to ai containers based on kubernetes configuration resource types
By setting up dynamic update interfaces and file contents in Kubernetes and utilizing node proxy services to update configurations in real time, the problem of low efficiency in updating configuration resource types in containers is solved, thus improving development efficiency and service quality.
Patent Information
- Application Number
- CN202511631100.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-10
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2045-11-10
AI Technical Summary
In existing technologies, dynamically updating resource types in Kubernetes containers is inefficient, costly, and degrades service quality when AI applications are redeployed.
By setting up a dynamic update interface and configuration file content in the configuration resource type of the container orchestration software, the node agent service is used to update the configuration information in real time and send the latest configuration file content to the AI application in the workload, avoiding the need to write additional listening programs and redeploy.
It enables dynamic updating of configuration resource types within containers, improving development efficiency, reducing costs, and enhancing the service quality of AI applications.
Smart Images

Figure CN121070416B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of computer software, and particularly relates to a method and system for dynamically updating AI container applications based on Kubernetes configuration resource types. BACKGROUND
[0002] ConfigMap and Secret are configuration resource types in Kubernetes, used to store configuration data. Organized in the form of key-value pairs, they can store and manage the configuration information required by AI applications. As the complexity of deploying AI applications through containerization increases, dynamic updating of configuration resource types becomes an important requirement. AI applications need to be configured at runtime without having to redeploy the AI applications in containers, which can reduce downtime and improve the availability and flexibility of AI applications. The current method of dynamically updating configuration resource types to AI applications in containers is to write additional programs to listen to configuration resource type update events and redeploy AI applications according to the update events to achieve dynamic updating of configuration resource types to AI applications in containers. This method is inefficient and costly, and redeploying AI applications also reduces service quality. SUMMARY
[0003] The technical problem to be solved by the present application is how to dynamically update configuration resource types to containers. The present application proposes a method and system for dynamically updating AI container applications based on Kubernetes configuration resource types.
[0004] To solve the above technical problems, the technical solution adopted by the present application is as follows:
[0005] A method for dynamically updating AI container applications based on Kubernetes configuration resource types, comprising the following steps:
[0006] Step 1: Set the dynamic update configuration interface and configuration file content for running AI applications in containers in the configuration information of the configuration resource type of the container orchestration software;
[0007] Step 2: Set the configuration resource type needed in the workload resource of the container orchestration software;
[0008] Step 3: When the configuration information of the AI application in the container in the workload needs to be updated, update the configuration file content and update the configuration file content in the configuration information of the configuration resource type;
[0009] Step 4: The node agent service obtains the configuration information of the configuration resource type, and sends the latest configuration file content in the configuration information to the AI application in the workload through the dynamic update configuration interface in the configuration information.
[0010] Step 5: After the AI application in the container in the work load receives the latest configuration file content, the latest configuration file content is loaded into the AI application.
[0011] Further, the method for setting the dynamic update configuration interface for running the AI application in the container in step 1 is:
[0012] In a certain key of the configuration information, the value of the key is set as the path of the dynamic update configuration interface, and the key is defined as the interface path key, so as to facilitate the node agent service to obtain the path of the dynamic update configuration interface in the configuration information.
[0013] Further, the method for setting the configuration file content in the configuration resource type of the container orchestration software in step 1 is: in the configuration information of the configuration resource type in the container orchestration software, the value of a certain key is set as the configuration file content, and the key is defined as the configuration file content key, so as to facilitate the node agent service to obtain the configuration file content in the configuration information.
[0014] Further, the method for setting the configuration resource type to be used in step 2 is: in the work load resource configuration information of the container orchestration software, the configuration resource type to be used by the work load resource is set, and the configuration resource type is identified as being used by the work load of the container orchestration software.
[0015] Further, the method for loading the new configuration file content into the AI application in step 5 is:
[0016] The configuration file content is set as a global dictionary variable, the global dictionary variable is updated each time new configuration file content is obtained, and the application always obtains the latest configuration content from the global dictionary variable during running.
[0017] A system for dynamically updating an AI container application based on a Kubernetes configuration resource type, using the steps of the method for dynamically updating an AI container application based on a Kubernetes configuration resource type described above.
[0018] By adopting the technical solutions described above, the present application has the following beneficial effects:
[0019] The application provides a method and system for dynamically updating an AI container application based on a Kubernetes configuration resource type. By setting a dynamic update configuration interface and configuration file content for running an AI application in a container in the configuration information of the configuration resource type of the container orchestration software, when the configuration resource type content is updated, the node agent service obtains the latest configuration of the configuration resource type resource, and sends the new configuration file content to the AI application in the working load through the dynamic update configuration interface. Without the need to additionally write a program for listening to configuration resource type update events or to redeploy the AI application program, the configuration resource type dynamic update to the AI application program in the container can be realized, the development efficiency is improved, the company cost is reduced, and the service quality of the AI application program is improved. BRIEF DESCRIPTION OF DRAWINGS
[0020] Figure 1 The system flowchart of the application is shown. DETAILED DESCRIPTION
[0021] The technical solutions of the application will be described clearly and completely in combination with the drawings. Obviously, the described embodiments are part of the embodiments of the application, rather than all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor fall within the protection scope of the application.
[0022] Figure 1 A specific embodiment of the method for dynamically updating an AI container application based on a Kubernetes configuration resource type is shown, which includes the following steps:
[0023] Step 1: Set a dynamic update configuration interface and configuration file content for running an AI application in a container in the configuration information of the configuration resource type of the container orchestration software.
[0024] In this embodiment, the container orchestration software uses Kubernetes, and the configuration resource types in the container orchestration software include Secret resources, ConfigMap resources, etc. The configuration resource type used in this embodiment is a ConfigMap resource.
[0025] The method for setting a dynamic update configuration interface for running an AI application in a container is as follows:
[0026] In a certain key of the configuration information, the value of the key is set as the dynamic update configuration interface path, and the key is defined as the interface path key, so as to facilitate the node agent service to obtain the dynamic update configuration interface path in the configuration information. The dynamic update configuration interface path is placed in the configuration information, so that the node agent service can quickly obtain the interface path. Through the interface path, the configuration file content can be sent to the AI application in the working load. The configuration information is generally in the key-value pair structure. As to which key in the configuration information is used to place the dynamic update configuration interface path, it is defined according to the needs, and the reading is facilitated. In the embodiment, the dynamic update configuration interface path of the application running in the container is set in the content of the annotations key in the configuration information in the ConfigMap resource. The dynamic update configuration interface path adopts the HTTP protocol, for example: http: / / test.com / update.
[0027] In the embodiment, the method for setting the configuration file content in the configuration of the configuration resource type of the container orchestration software is as follows: the value of a certain key in the configuration information of the configuration resource type in the container orchestration software is set as the configuration file content, and the key is defined as the configuration file content key, so as to facilitate the node agent service to obtain the configuration file content in the configuration information. In the embodiment, the content of the data key in the configuration information in the ConfigMap resource is the content of the configuration file.
[0028] Step 2: Set the configuration resource type required to be used in the working load resource of the container orchestration software.
[0029] In the embodiment, the method for setting the configuration resource type required to be used is as follows: the configuration resource type required to be used by the working load resource of the container orchestration software is set in the working load resource configuration information of the container orchestration software, and the configuration resource type is identified to be used by the working load of the container orchestration software.
[0030] The workload resources of the container orchestration software include Deployment, StatefulSet, DaemonSet, Job, CronJob, and the like. In this embodiment, the ConfigMap resource with the name test is mounted in the Deployment workload resource in the container orchestration software in the form of a data volume. The Deployment resource is created by using the kubectlapply command provided by the Kubernetes container orchestration software. After the Deployment resource is successfully created, the container orchestration software schedules and starts the Pod resource managed by the Deployment resource. After the Pod resource is successfully started, the configuration file content of the ConfigMap resource is mounted to the specified path in the Pod resource, and the ConfigMap resource is used by the Deployment workload resource.
[0031] Step 3: When the configuration information of the AI application in the container in the workload needs to be updated, the configuration file content is updated, and the configuration file content is updated in the configuration information of the configuration resource type.
[0032] In this embodiment, the latest configuration file content needs to be updated to the configuration information of the configuration resource type, specifically to the key corresponding to the placement of the configuration file content in the configuration information, such as the data key.
[0033] Step 4: The node agent service obtains the configuration information of the configuration resource type, and sends the latest configuration file content in the configuration information to the AI application in the workload through the dynamic update configuration interface in the configuration information.
[0034] In this embodiment, the node agent service is a proxy service software run by the container orchestration software on each host. In the Kubernetes container orchestration software, kubelet is used. This proxy service software can obtain the configuration of the workload, and then create the container in the workload according to the configuration of the workload, including all other operations of the container to be created, including the configuration information of the configuration resource type ConfigMap. In this embodiment, the node agent service can obtain the configuration information of the configuration resource type ConfigMap, and then obtain the latest configuration file content, and deliver the latest configuration file content to the AI application in the workload through the dynamic update configuration interface.
[0035] As the name of the ConfigMap resource is edited using the kubectl edit command provided by the Kubernetes container orchestration software, the data key content of the ConfigMap resource is modified from "test:001" to "test:002", the node agent service Kubelet obtains the latest configuration file content in the data key of the configuration resource type ConfigMap configuration information, obtains the dynamic update configuration interface path http: / / test.com / update of the application running in the container through the annotations key in the configuration resource type ConfigMap configuration information, and sends the latest ConfigMap resource data key content "test:002" to the AI application running in the container in the workload through the dynamic update configuration interface http: / / test.com / update.
[0036] Step 5: After the AI application in the container in the workload receives the latest configuration file content, the AI application loads the latest configuration file content into the AI application.
[0037] In this embodiment, the AI application in the container in the Pod resource in the Deployment workload resource in the container orchestration software receives the new configuration file content "test:002" through the http: / / test.com / update interface, and loads the new "test:002" configuration file content into the running application. The method of loading the new configuration file content into the AI application is:
[0038] Set the configuration file content as a global dictionary variable, update the global dictionary variable every time a new configuration file content is obtained, and the AI application always obtains the latest configuration content from the global dictionary variable during running.
[0039] A system for dynamically updating AI container applications based on Kubernetes configuration resources, using the method for dynamically updating AI container applications based on Kubernetes configuration resources described above.
[0040] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for dynamically updating AI container applications based on Kubernetes configuration resource types, characterized in that, Includes the following steps: Step 1: In the configuration information of the configuration resource type of the container orchestration software, set the dynamic update configuration interface and configuration file content for running AI applications within the container; The method for setting the configuration file content is as follows: in the configuration information of the configuration resource type in the container orchestration software, a certain key is set to the value of the configuration file content, and this key is defined as the configuration file content key, so that the node agent service can obtain the configuration file content in the configuration information. Step 2: Configure the required resource types in the workload resources of the container orchestration software; Step 3: When the configuration information of the AI application within the container in the workload needs to be updated, update the configuration file content and update the configuration information of the configuration resource type; Step 4: The node proxy service obtains the configuration information of the configuration resource type and sends the latest configuration file content in the configuration information to the AI application in the workload through the dynamic update configuration interface in the configuration information; Step 5: After receiving the latest configuration file content, the AI application within the container in the workload loads the latest configuration file content into the AI application.
2. The method according to claim 1, characterized in that, The method for setting up the dynamic update configuration interface for running AI applications within the container in step 1 is as follows: In the configuration information, the value of a key is set to the dynamic update configuration interface path, and this key is defined as the interface path key, so that the node proxy service can obtain the dynamic update configuration interface path in the configuration information.
3. The method according to claim 2, characterized in that, The method for setting the required configuration resource type in step 2 is as follows: set the configuration resource type required by the workload resource in the workload resource configuration information of the container orchestration software, and identify that the configuration resource type is used by the workload of the container orchestration software.
4. The method according to claim 3, characterized in that, The method for loading the latest configuration file content into the AI application in step 5 is as follows: The configuration file content is set as a global dictionary variable. The global dictionary variable is updated every time a new configuration file content is obtained. During the operation of the AI application, the latest configuration content is always obtained from the global dictionary variable.
5. A system for dynamically updating AI container applications based on Kubernetes configuration resource types, characterized in that, The steps of the method for dynamically updating AI container applications based on Kubernetes configuration resource types as described in any one of claims 1 to 4 are used.
Citation Information
Patent Citations
Dynamic updating method and system for container configuration file
CN117170709A
Configuration management method and system for container arrangement and deployment
CN120704802A