A system and method for upgrading a version of a container image

By designing a container image version upgrade system, users can select containers for upgrades in batches on the front-end interface, generate and process multiple upgrade tasks, solve the problem that container image versions in Kubernetes can only be upgraded one by one, and improve upgrade efficiency.

CN115878154BActive Publication Date: 2026-04-17CHINA CONSTRUCTION BANK
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA CONSTRUCTION BANK
Filing Date
2022-12-05
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

In existing technologies, container image version upgrades in Kubernetes can only be performed one by one, and batch upgrades are not possible, resulting in low upgrade efficiency.

Method used

Design a container image version upgrade system. The system displays the application image version information through a front-end interface. Users can select containers for batch upgrades, generating multiple upgrade tasks, which are then processed sequentially by the task execution module, calling relevant interfaces to perform batch image version upgrades.

Benefits of technology

This enables batch upgrades of container image versions in Kubernetes, improving upgrade efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115878154B_ABST
    Figure CN115878154B_ABST
Patent Text Reader

Abstract

This invention provides a container image version upgrade system and method. The system includes a front-end module, a storage module, a task distribution module, an image repository module, a database module, and a task execution module. The front-end module displays the current and latest image version information of the application's containers and receives upgrade commands input by the user for one or more containers. The task distribution module generates multiple upgrade tasks based on the upgrade commands and saves them to a task queue in the database module. The task execution module sequentially retrieves and executes the upgrade tasks from the task queue. In this solution, by displaying the current and latest image version information of each application's containers to the user, and when the user selects multiple containers for batch upgrades, multiple upgrade tasks are generated accordingly. The task execution module sequentially retrieves and executes the upgrade tasks, achieving the goal of batch upgrading container image versions and improving upgrade efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of application container technology, and in particular to a system and method for upgrading container image versions. Background Technology

[0002] Because container technology has advantages such as simple deployment, multi-environment support, fast startup, service orchestration and easy migration, most cloud applications are deployed in the form of containers. However, containers only provide the most basic container runtime environment and cannot achieve cross-host communication, so Kubernetes is needed to manage container clusters.

[0003] In Kubernetes, upgrading container image versions is achieved by modifying the YAML file. However, this method can only upgrade the image version of one container at a time, making it impossible to upgrade the image versions of multiple containers at once, resulting in low upgrade efficiency. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a container image version upgrade system and method to achieve the purpose of batch upgrading container image versions.

[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0006] The first aspect of this invention discloses a container image version upgrade system, comprising:

[0007] The front-end module is used to retrieve and display the application names of each application corresponding to the currently logged-in user from the storage module; for each application, it queries and displays the current image version information and the latest image version information of the application's container from the database module; it receives upgrade instructions for one or more containers of the application input by the currently logged-in user and sends the upgrade instructions to the task distribution module.

[0008] The storage module is used to store the application names of each application; store the correspondence between each application and users; wherein each application has only one corresponding user, and the user has upgrade permissions for the container corresponding to the application;

[0009] The task distribution module is used to obtain the image version information of each image version stored in the image repository module and send it to the database module for storage; receive the upgrade instruction, generate one or more upgrade tasks according to the upgrade instruction and save them sequentially to the task queue in the database module; each upgrade task is used to indicate the upgrade of a corresponding container.

[0010] The image repository module is used to store various image versions and the image version information corresponding to each image version;

[0011] The database module is used to store image version information of each image version obtained by the task distribution module from the image repository module; in response to the query of the front-end module, it returns the current image version information and the latest image version information of the application's container; and it receives the upgrade task and saves it to the task queue in sequence.

[0012] The task execution module is used to sequentially retrieve the upgrade tasks from the task queue; based on the upgrade tasks, download the latest image version of the container corresponding to the upgrade task from the image repository module, and run the container with the latest image version.

[0013] Preferably, the task execution module is specifically used for:

[0014] The upgrade tasks are retrieved sequentially from the task queue; based on the upgrade tasks, the API interface of the Kubernetes cluster is called to modify the current image version information in the YAML file of the corresponding resource object to the latest image version information, and Docker is called to download the latest image version of the container corresponding to the upgrade task from the image repository module, and the container is run with the latest image version.

[0015] Preferably, the front-end module is further used for:

[0016] Receive the application name input by the user; query the database module for the current image version information and the latest image version information of the container corresponding to the application name; display the application name received by the search module, as well as the current image version information and the latest image version information of the container corresponding to the application name.

[0017] Preferably, the database module is further used for:

[0018] When the task distribution module saves the upgrade task to the task queue, it generates record information indicating that the container corresponding to the upgrade task is upgraded from the current image version to the latest image version; the record information includes at least the current image version information, the latest image version information, the operator, the operation object, the operation content, and the operation date.

[0019] Preferably, the front-end module is further used for:

[0020] When an upgrade instruction for one or more containers of the application is received from the currently logged-in user, if the current image version information of any container of the application is consistent with the latest image version information, a text message is generated to prompt the user that the image version of the container is the latest version.

[0021] A second aspect of this invention discloses a method for upgrading a container image version, comprising:

[0022] Retrieve and display the application names of each application corresponding to the currently logged-in user;

[0023] For each application, query and display the current image version information and the latest image version information of the application's container;

[0024] Receive upgrade instructions for one or more containers of the application from the currently logged-in user;

[0025] One or more upgrade tasks are generated according to the upgrade instruction and saved to the task queue in sequence; each upgrade task is used to indicate the upgrade of a corresponding container;

[0026] The upgrade tasks are retrieved sequentially from the task queue;

[0027] Download the latest image version of the container corresponding to the upgrade task from the image repository that stores various image versions in advance, and run the container with the latest image version.

[0028] Preferably, the step of downloading the latest image version of the container corresponding to the upgrade task from the image repository that stores various image versions in advance, and running the container with the latest image version, based on the upgrade task, includes:

[0029] Based on the upgrade task, the API interface of the Kubernetes cluster is called to modify the current image version information in the YAML file of the corresponding resource object to the latest image version information.

[0030] The Docker command downloads the latest image version of the container corresponding to the upgrade task from the image repository that stores various image versions in advance, and runs the container with the latest image version.

[0031] Preferred options also include:

[0032] Receive the application name input by the user;

[0033] Query the current image version information and the latest image version information of the container corresponding to the application name;

[0034] The front-end page displays the current and latest image version information of the container corresponding to the application name.

[0035] Preferred options also include:

[0036] When the upgrade task is saved to the task queue, record information is generated that indicates the container corresponding to the upgrade task to be upgraded from the current image version to the latest image version;

[0037] The recorded information includes at least the current image version information, the latest image version information, the operator, the object of the operation, the operation content, and the operation date.

[0038] Preferred options also include:

[0039] When an upgrade instruction for one or more containers of the application is received from the currently logged-in user, if the current image version information of any container of the application is consistent with the latest image version information, a text message is generated to prompt the user that the image version of the container is the latest version.

[0040] Based on the above embodiments of the present invention, a container image version upgrade system and method are provided. The system includes: a front-end module, used to obtain and display the application names of each application corresponding to the currently logged-in user from a storage module; for each application, to query and display the current image version information and the latest image version information of the application's container from a database module; to receive upgrade instructions for one or more containers of the applications input by the currently logged-in user, and send the upgrade instructions to a task distribution module; the storage module is used to store the application names of each application; to store the correspondence between each application and the user; wherein each application has only one corresponding user, and the user has upgrade permissions for the container corresponding to the application; the task distribution module is used to obtain the image version information of each image version stored in the image repository module, and send it to the database module for storage; The system receives the upgrade command, generates one or more upgrade tasks corresponding to the upgrade command, and saves them sequentially to the task queue in the database module. Each upgrade task is used to indicate the upgrade of a corresponding container. The image repository module is used to store various image versions and their corresponding image version information. The database module is used to store the image version information of various image versions obtained by the task distribution module from the image repository module. In response to a query from the front-end module, the system returns the current image version information and the latest image version information of the application's container. The system receives the upgrade tasks and saves them sequentially to the task queue. The task execution module is used to sequentially retrieve the upgrade tasks from the task queue. Based on the upgrade tasks, the system downloads the latest image version of the container corresponding to the upgrade task from the image repository module and runs the container with the latest image version. In this solution, the front-end interface displays the current image version information and the latest image version information of the containers of each application to the currently logged-in user. When the user selects multiple containers for batch upgrade, multiple upgrade tasks are generated and saved sequentially. The task execution module sequentially retrieves the upgrade tasks and calls the relevant interfaces to upgrade the container image versions, thereby achieving batch upgrade of container image versions in Kubernetes and improving upgrade efficiency. Attached Figure Description

[0041] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0042] Figure 1 This is a schematic diagram of a container image version upgrade process disclosed in an embodiment of the present invention;

[0043] Figure 2 This is an architecture diagram of a container image version upgrade system disclosed in an embodiment of the present invention;

[0044] Figure 3 This is an architecture diagram of a K8s cluster disclosed in an embodiment of the present invention;

[0045] Figure 4 This is a flowchart of a container image version upgrade method disclosed in an embodiment of the present invention. Detailed Implementation

[0046] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0047] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0048] As the background technology shows, in Kubernetes, existing container image version upgrade methods can only upgrade the image version of one container at a time, and cannot upgrade the image versions of containers in batches, resulting in low upgrade efficiency.

[0049] Therefore, this invention discloses a container image version upgrade system and method. In this solution, the current image version information and the latest image version information of each application's container are displayed to the currently logged-in user through the front-end interface. When the user selects multiple containers for batch upgrade, multiple upgrade tasks are generated and saved in sequence. The task execution module obtains the upgrade tasks in sequence and calls the relevant interfaces to upgrade the container image version, thereby realizing the purpose of batch upgrading container image versions in Kubernetes and improving upgrade efficiency.

[0050] To illustrate the problems existing in the current process, such as Figure 1 The diagram shown is a schematic representation of a container image version upgrade process disclosed in an embodiment of the present invention.

[0051] In a K8s cluster (Kubernetes, a container cluster management system), the kubectl edit command is typically used to interact with the apiserver container cluster management entry point to modify the configuration of the Deployment resource object. Specifically, the spec.template.spec.containers[0].image in the resource object's YAML file is modified from the current image version information to the new image version information. The new image version is then downloaded to the local machine, and the application container is run with the new image version to complete the upgrade.

[0052] In summary, users can only modify the image version information of application containers one by one, and cannot select the containers of the applications that need to be upgraded in batches, thus making it impossible to upgrade the image version of containers in batches.

[0053] like Figure 2 The diagram shown is an architecture diagram of a container image version upgrade system disclosed in an embodiment of the present invention. The system includes: a front-end module 201, a storage module 202, a task distribution module 203, an image repository module 204, a database module 205, and a task execution module 206.

[0054] The front-end module 201 is used to obtain and display the application names of each application corresponding to the currently logged-in user from the storage module 202; for each application, it queries and displays the current image version information and the latest image version information of the application's container from the database module 205; it receives upgrade instructions for containers of one or more applications input by the currently logged-in user and sends the upgrade instructions to the task distribution module 203.

[0055] It should be noted that image version information includes at least: image name, image ID, and version number; upgrade commands are used to instruct the containers of one or more applications to be upgraded from the current image version to the latest image version.

[0056] Specifically, the currently logged-in user is User 1. The front-end module 201 retrieves and displays the application names corresponding to User 1 from the storage module 202, namely Application 1, Application 2 and Application 3.

[0057] The front-end module 201 retrieves the current image version information of the containers of Application 1, Application 2, and Application 3 from the database module 205 based on the current image version of the containers of Application 1, Application 2, and Application 3. Then, based on the time when the image version information of each container was stored in the database module, it obtains the latest image version information of the containers of Application 1, Application 2, and Application 3, and displays the current image version information and the latest image version information of the containers of Application 1, Application 2, and Application 3 through the front-end interface.

[0058] User 1 uses the selection box on the left side of the front-end page displayed by front-end module 201 to select the containers of the applications that need to be upgraded in batches, and clicks the upgrade button to generate upgrade instructions.

[0059] In this embodiment of the invention, application 1, application 2 and application 3 run in different containers, or they can run in the same container, or they can run in pairs in the same container.

[0060] In one embodiment, the front-end module 201 is further configured to:

[0061] Receive the application name input by the user; query the current image version information and the latest image version information of the container corresponding to the application name from the database module 205; display the application name input by the user, as well as the current image version information and the latest image version information of the container corresponding to the application name.

[0062] Specifically, the front-end module 201 displays a search box and a corresponding search button on the front-end page. It receives the application name entered by the user through the search box, and after receiving the instruction generated by the user clicking the search button, it queries the current image version information and the latest image version information of the container of the application corresponding to the application name. The front-end module then displays the application name entered by the user, as well as the current image version information and the latest image version information of the container of the application corresponding to the application name on the main page of the front-end interface.

[0063] In one embodiment, the front-end module 201 is further configured to:

[0064] When an upgrade command for one or more application containers is received from the currently logged-in user, if the current image version information of any application container is consistent with the latest image version information, a text message is generated to prompt the user that the container image version is already the latest version, and the user is given the option to select again.

[0065] In one embodiment, the front-end module 201 is further configured to:

[0066] The system displays the login page, retrieves the username and password entered by the user on the login page, and compares the username and password with the username and password stored in the storage module 202. If they match, the user successfully logs into the system; otherwise, the system prompts that the username or password is incorrect.

[0067] Storage module 202 is used to store the application names of each application and the correspondence between each application and the user.

[0068] Each application has only one corresponding user, and that user has container upgrade permissions for that application.

[0069] Specifically, the storage module 202 stores application 1, application 2 and application 3 corresponding to user 1, and application 3 and application 4 corresponding to user 2. User 1 has upgrade permissions for the containers corresponding to application 1, application 2 and application 3, and user 2 has upgrade permissions for the containers corresponding to application 3 and application 4.

[0070] In one embodiment, the storage module 202 is further configured to:

[0071] Stores the user's username and password.

[0072] The username and password are used to compare with the username and password entered by the user when logging into the system. If they match, the user can log into the upgraded system of the mirror version.

[0073] The task distribution module 203 is used to obtain the image version information of each image version stored in the image repository module 204 and send it to the database module 205 for storage; receive upgrade instructions, generate one or more upgrade tasks according to the upgrade instructions and save them to the task queue in the database module 205 in sequence.

[0074] Each upgrade task is used to instruct a corresponding container to be upgraded from the current image version to the latest image version.

[0075] It should be noted that the task distribution module 203 is deployed in a K8s cluster (Kubernetes, a container cluster management system).

[0076] To clarify the relationship between upgrade instructions and upgrade tasks, the embodiments of the present invention provide the following examples.

[0077] For example, when the task distribution module 203 receives upgrade instructions for application 1 and application 2, it generates upgrade task 1 and upgrade task 2 accordingly. Upgrade task 1 indicates the container corresponding to application 1, and upgrade task 2 indicates the container corresponding to application 2.

[0078] The image repository module 204 is used to store various image versions and the corresponding image version information.

[0079] Each image version can be understood as a software package that developers write and upload using a programming language.

[0080] Understandably, when developers upload an image version to the image repository module 204, the image version information, namely the image name, image ID, and version number, is also uploaded along with the image version.

[0081] The database module 205 is used to store the image version information of each image version obtained by the task distribution module 203 from the image repository module 204; in response to the query of the front-end module 201, it returns the current image version information and the latest image version information of the application's container; and it receives upgrade tasks and saves them to the task queue in sequence.

[0082] After receiving the image version information, the database module 205 determines the application container to be upgraded based on the information recorded in each image version information, and associates each image version information with the application.

[0083] For example, if database module 205 receives image version information 1, which indicates that the corresponding image version 1 is used to upgrade the container of application 1, then database module 205 will associate application 1 with image version information 1.

[0084] It should be noted that, as mentioned above, an upgrade command instructs to upgrade the containers of one or more applications. Therefore, for each upgrade task corresponding to the same upgrade command, they can be saved to the task queue in sequence according to the time when the upgrade task is received, or in a random order.

[0085] In the specific implementation, the database module 205 responds to the query request of the front-end module 201, returns the image version information of the currently running image version based on the image version of the application's container, and returns the latest image version information of the application's container based on the time when each image version information was stored.

[0086] In one embodiment, the database module 205 is further configured to generate record information indicating that the container corresponding to the upgrade task is upgraded from the current image version to the latest image version when it receives the upgrade task sent by the task distribution module 203 and saves it to the task queue.

[0087] The recorded information should include at least the current image version information, the latest image version information, the operator, the object of the operation, the content of the operation, and the date of the operation.

[0088] Understandably, the record information not only contains the current image version information and the record of upgrading to the latest image version information, but also contains the operator, the object of the operation, the operation content and the operation date, so that users can easily view the historical upgrade records, and also provide reliable information for maintenance personnel to maintain the system in the future, thereby improving maintenance efficiency.

[0089] The task execution module 206 is used to retrieve upgrade tasks from the task queue in sequence; based on the upgrade task, it downloads the latest image version of the container corresponding to the upgrade task from the image repository module 204, and runs the container with the latest image version.

[0090] It should be noted that the task execution module 206 is deployed in a K8s cluster (Kubernetes, a container cluster management system).

[0091] For the architecture of the Kubernetes cluster and the specific process of task execution module 206 executing the upgrade task, please refer to [link to documentation]. Figure 3 The illustrated embodiment.

[0092] Based on the above embodiments of the present invention, a container image version upgrade system is disclosed. The system includes: a front-end module, a storage module, a task distribution module, an image repository module, a database module, and a task execution module. The front-end module retrieves and displays the application names of each application corresponding to the currently logged-in user from the storage module; for each application, it queries and displays the current and latest image version information of the application's container from the database module; it receives upgrade instructions for containers of one or more applications input by the currently logged-in user and sends these instructions to the task distribution module; the task distribution module generates one or more upgrade tasks according to the upgrade instructions and sequentially saves them to the task queue in the database module; the task execution module sequentially retrieves upgrade tasks from the task queue; based on the upgrade tasks, it downloads the latest image version of the container corresponding to the upgrade task from the image repository module and runs the container with the latest image version. In this solution, the current image version information and the latest image version information of each application's container are displayed to the currently logged-in user through the front-end interface. When the user selects multiple containers for batch upgrade, multiple upgrade tasks are generated and saved in sequence. The task execution module retrieves the upgrade tasks in sequence and calls the relevant interfaces to upgrade the container image versions, thereby realizing the goal of batch upgrading container image versions in Kubernetes and improving upgrade efficiency.

[0093] The specific architecture of the K8s cluster mentioned in the above embodiments of the present invention is as follows: Figure 3 The diagram shown is an architecture diagram of a K8s cluster disclosed in an embodiment of the present invention. The architecture includes: a task distribution module, a task execution module, an apiserver component, an api interface, a resource object, a kubelet component, and an application container engine.

[0094] The task distribution module and task execution module in this embodiment of the invention are related to... Figure 2 The task distribution module 203 and the task execution module 206 in the embodiments of the present invention are shown to correspond to each other.

[0095] In the specific implementation, the task execution module retrieves upgrade tasks sequentially from the task queue, interacts with the apiserver component of the Kubernetes cluster, and calls the API interface of the Kubernetes cluster to modify the current image version information in the YAML file of the corresponding resource object to the latest image version information.

[0096] Specifically, modifying the current image version information in the corresponding resource object's YAML file to the latest image version information includes:

[0097] Modify the version number of the current image version in the YAML file of the corresponding resource object to the version number of the latest image version.

[0098] By using the kubelet component (a proxy component for worker nodes in a container cluster), the open-source application container engine Docker is invoked to download the latest image version from the image repository to the local machine and run the container with the latest image version.

[0099] Based on the container image version upgrade system disclosed in the above embodiments of the present invention, upgrade tasks are sequentially obtained from the task queue, relevant interfaces and components are called, the latest image version is downloaded to the local machine, and the container is run with the latest image version, thereby achieving the purpose of batch upgrading the image version of application containers in a K8s cluster.

[0100] Based on the container image version upgrade system disclosed in the above embodiments of the present invention, such as Figure 4 The diagram shows a flowchart of a container image version upgrade method disclosed in an embodiment of the present invention. The method mainly includes the following steps:

[0101] Step S401: Obtain and display the application names of each application corresponding to the currently logged-in user.

[0102] In step S401, each application has only one corresponding user, and for any given application, only the corresponding user has the permission to upgrade the container image version of that application.

[0103] In the specific implementation step S401, based on the pre-stored correspondence between users and various applications, the application names of each application corresponding to the currently logged-in user are queried and displayed through the front-end page.

[0104] In one embodiment, the user's input username and password are obtained, and compared with the pre-stored username and password. If they match, the login is successful, and step S401 is executed. If the comparison fails, a prompt message is generated, indicating that the user's input username or password is incorrect.

[0105] Step S402: For each application, query and display the current image version information and the latest image version information of the application's container.

[0106] In step S402, the image version information includes at least: image name, image ID, and version number.

[0107] In the specific implementation step S401, the image version information of each application's container is obtained from the image repository. The image version information corresponding to each image version information is used to upgrade the application container. Each image version information is associated with an application. The pre-established database is used to save each image version information and the correspondence between each image version information and the application. Using the application name, the current image version information and the latest image version information of the application's container are retrieved from the database.

[0108] The image repository is used to store various image versions and image version information uploaded by developers.

[0109] Step S403: Receive upgrade instructions for containers of one or more applications from the currently logged-in user.

[0110] In step S403, the upgrade instruction is used to instruct the container image version of one or more applications to be upgraded to the latest image version.

[0111] Step S404: Generate one or more upgrade tasks according to the upgrade instructions and save them to the task queue in sequence.

[0112] In step S404, each upgrade task is used to instruct a corresponding container to be upgraded to the latest image version.

[0113] For example, if an upgrade instruction is used to instruct the container image versions corresponding to Application 1, Application 2, and Application 3 to be upgraded to the latest image version, then upgrade task 1, upgrade task 2, and upgrade task 3 will be generated accordingly, which are used to instruct the container image versions corresponding to Application 1, Application 2, and Application 3 to be upgraded to the latest image version, respectively.

[0114] In the specific implementation of step S404, one or more upgrade tasks are generated according to the upgrade instruction, and the upgrade tasks are saved to the task queue in the order in which they are generated.

[0115] Step S404: Retrieve upgrade tasks from the task queue in sequence.

[0116] In the specific implementation of step S404, the task queue is monitored in real time. When there are upgrade tasks in the task queue, upgrade tasks are retrieved from the task queue in the order in which they were stored.

[0117] Step S405: Download the latest image version of the container corresponding to the upgrade task from the image repository that stores each image version in advance, and run the container with the latest image version.

[0118] In step S405, the image repository pre-stores various image versions uploaded by developers and image version information for each image version.

[0119] Among them, the mirror version is a software package written and packaged by developers using a programming language.

[0120] In the specific implementation step S405, the application container that needs to be upgraded according to the upgrade task instructions interacts with the apiserver component of the k8s cluster, calls the k8s API interface, and modifies the current image version information in the YAML file of the resource object deployment corresponding to the container to the latest image version information. The kubelet container cluster worker node proxy component calls the open-source application container engine Docker to download the latest image version of the application container from the image repository to the local machine, and runs the container with the latest image version.

[0121] In one embodiment, when the application name input by the user is received, the current image version information and the latest image version information of the container of the application corresponding to the application name are queried.

[0122] The front-end page displays the current image version information and the latest image version information of the container corresponding to the application name.

[0123] In one embodiment, when an upgrade task is saved to a task queue, record information is generated indicating that the container corresponding to the upgrade task is upgraded from the current image version to the latest image version.

[0124] The recorded information should include at least the current image version information, the latest image version information, the operator, the object of the operation, the content of the operation, and the date of the operation.

[0125] In one embodiment, when an upgrade instruction for containers of one or more applications is received from the currently logged-in user, if the current image version information of any application's container is consistent with the latest image version information, then a text message is generated to prompt the user that the container's image version is the latest version.

[0126] Based on the container image version upgrade method disclosed in the above embodiments of the present invention, for each application corresponding to the currently logged-in user, the method queries and displays the current image version information and the latest image version information of the application's containers. It receives upgrade instructions for containers of one or more applications input by the currently logged-in user, generates one or more upgrade tasks according to the upgrade instructions, and saves them sequentially to a task queue. The method then retrieves upgrade tasks sequentially from the task queue, downloads the latest image version of the container corresponding to the upgrade task from the pre-stored image repository for each image version, and runs the container with the latest image version. In this solution, by displaying the current image version information and the latest image version information of the containers of each application to the currently logged-in user, when the user selects multiple containers for batch upgrades, multiple upgrade tasks are generated and saved sequentially. The task execution module retrieves the upgrade tasks sequentially and calls relevant interfaces to upgrade the container image versions, thus achieving batch upgrades of container image versions in Kubernetes and improving upgrade efficiency.

[0127] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0128] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0129] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A container image version upgrade system, characterized in that, include: The front-end module is used to retrieve and display the application names of each application corresponding to the currently logged-in user from the storage module; For each application, the system queries and displays the current and latest image version information of the application's container from the database module; it receives upgrade instructions for one or more containers of the application input by the currently logged-in user and sends the upgrade instructions to the task distribution module. The storage module is used to store the application names of each application; store the correspondence between each application and users; wherein each application has only one corresponding user, and the user has upgrade permissions for the container corresponding to the application; The task distribution module is used to obtain the image version information of each image version stored in the image repository module and send it to the database module for storage; receive the upgrade instruction, generate one or more upgrade tasks according to the upgrade instruction and save them sequentially to the task queue in the database module; each upgrade task is used to indicate the upgrade of a corresponding container; The image repository module is used to store various image versions and the image version information corresponding to each image version; The database module is used to store image version information of each image version obtained by the task distribution module from the image repository module; in response to the query of the front-end module, it returns the current image version information and the latest image version information of the application's container; and it receives the upgrade task and saves it to the task queue in sequence. The task execution module is used to sequentially retrieve the upgrade tasks from the task queue; based on the upgrade tasks, download the latest image version of the container corresponding to the upgrade task from the image repository module, and run the container with the latest image version; Specifically, the task execution module is used for: The upgrade tasks are retrieved sequentially from the task queue; based on the upgrade tasks, the API interface of the Kubernetes cluster is called to modify the current image version information in the YAML file of the corresponding resource object to the latest image version information, and Docker is called to download the latest image version of the container corresponding to the upgrade task from the image repository module, and the container is run with the latest image version.

2. The system according to claim 1, characterized in that, The front-end module is also used for: Receive the application name input by the user; query the current image version information and the latest image version information of the container corresponding to the application name from the database module; display the received application name, as well as the current image version information and the latest image version information of the container corresponding to the application name.

3. The system according to claim 1, characterized in that, The database module is also used for: When the task distribution module saves the upgrade task to the task queue, it generates record information indicating that the container corresponding to the upgrade task is upgraded from the current image version to the latest image version; the record information includes at least the current image version information, the latest image version information, the operator, the operation object, the operation content, and the operation date.

4. The system according to claim 1, characterized in that, The front-end module is also used for: When an upgrade instruction for one or more containers of the application is received from the currently logged-in user, if the current image version information of any container of the application is consistent with the latest image version information, a text message is generated to prompt the user that the image version of the container is the latest version.

5. A method for upgrading a container image version, characterized in that, include: Retrieve and display the application names of each application corresponding to the currently logged-in user; For each application, query and display the current image version information and the latest image version information of the application's container; Receive upgrade instructions for one or more containers of the application from the currently logged-in user; One or more upgrade tasks are generated according to the upgrade instructions and saved to the task queue in sequence; Each of the aforementioned upgrade tasks is used to instruct the upgrade of a corresponding container; The upgrade tasks are retrieved sequentially from the task queue; Download the latest image version of the container corresponding to the upgrade task from the image repository that stores various image versions in advance, and run the container with the latest image version; The step of downloading the latest image version of the container corresponding to the upgrade task from the image repository that stores various image versions in advance, and running the container with the latest image version, includes: Based on the upgrade task, the API interface of the Kubernetes cluster is called to modify the current image version information in the YAML file of the corresponding resource object to the latest image version information. The Docker command downloads the latest image version of the container corresponding to the upgrade task from the image repository that stores various image versions in advance, and runs the container with the latest image version.

6. The method according to claim 5, characterized in that, Also includes: Receive the application name input by the user; Query the current image version information and the latest image version information of the container corresponding to the application name; The front-end page displays the current and latest image version information of the container corresponding to the application name.

7. The method according to claim 5, characterized in that, Also includes: When the upgrade task is saved to the task queue, record information is generated that indicates the container corresponding to the upgrade task to be upgraded from the current image version to the latest image version; The recorded information includes at least the current image version information, the latest image version information, the operator, the object of the operation, the operation content, and the operation date.

8. The method according to claim 5, characterized in that, Also includes: When an upgrade instruction for one or more containers of the application is received from the currently logged-in user, if the current image version information of any container of the application is consistent with the latest image version information, a text message is generated to prompt the user that the image version of the container is the latest version.

Citation Information

Patent Citations

  • Cluster plug-in upgrading method and device and server

    CN112860282A

  • Road condition real-time publishing method and device based on container arrangement technology

    CN113992648A