Container-based software self-maintenance upgrade method
By introducing a self-maintenance and upgrade mechanism for application software on the container platform, the inflexibility and unreliability of software program and database upgrades after containerization are solved, and secure isolation upgrade control and status monitoring are achieved, thereby improving the upgrade capabilities of the container platform.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NO 30 INST OF CHINA ELECTRONIC TECH GRP CORP
- Filing Date
- 2022-11-01
- Publication Date
- 2026-04-14
AI Technical Summary
In existing technologies, container platforms cannot effectively support the upgrade of software programs after application software is containerized, and cannot detect whether the database upgrade is successful, resulting in an inflexible and insecure upgrade process.
By establishing a self-maintenance and upgrade mechanism for application software on the container platform, including authentication and authorization, resource management and upgrade control processes, it is ensured that application software can upgrade autonomously and monitor the upgrade status, and the upgrade results are processed using an asynchronous query method.
It enables secure isolation and self-maintenance upgrades of application software on container platforms, improving the flexibility and reliability of upgrades and optimizing upgrade rollback capabilities.
Smart Images

Figure CN115686572B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of information security technology, and in particular relates to a container-based software self-maintenance and upgrade method. Background Technology
[0002] As microservices and cloud-native architectures are increasingly adopted by application software systems, container-based applications are widely deployed in cloud data centers, edge computing, and other scenarios. Container technology uses a layered approach to organize application software dependencies, resulting in read-only container image layers. Therefore, deploying applications using containers requires following container image updates. Typically, container platforms provide container application repository components to store containerized application templates and container images, and offer mechanisms such as storage volume backup, storage volume snapshots, rolling upgrades, blue-green upgrades, and canary upgrades to ensure the upgrade and updates of container-based applications.
[0003] Container platforms provide general application software upgrade and downgrade capabilities, but they can only detect whether the container microservices of application software are started and running normally from the perspective of container instances, lacking support for the following capabilities:
[0004] 1. After application software is containerized, it becomes difficult for the application software to upgrade the software programs inside the container instance;
[0005] 2. During the application software container instance upgrade process, the container platform cannot operate on the application software's own state, including the database table structure, and cannot detect whether the database upgrade was successful after the application software container instance upgrade. Summary of the Invention
[0006] The purpose of this invention is to overcome the shortcomings of existing technologies by providing a container-based software self-maintenance and upgrade method and an upgrade management mechanism for container instances based on a container platform. Based on this, it proposes methods and processes for authentication authorization, resource management and upgrade control required for application software self-maintenance and upgrade, thereby improving the flexibility, reliability and security of application software upgrades based on container platforms.
[0007] The objective of this invention is achieved through the following technical solution:
[0008] A container-based software self-maintenance and upgrade method, the method comprising:
[0009] Application software obtains certification and authorization from the container platform;
[0010] The authenticated and authorized application software sends an authentication request to the container platform with the tenant's authentication information to complete the self-maintenance upgrade.
[0011] Furthermore, the application software obtaining authentication authorization from the container platform includes:
[0012] When creating a tenant, associate the service account with the namespace and the project account with the repository project.
[0013] Furthermore, associating service accounts with namespaces and project accounts with repository projects specifically includes:
[0014] Based on the tenant A information submitted by the administrator, the container platform automatically creates container platform service account A and project account A;
[0015] Based on the tenant A information submitted by the administrator, the container platform automatically creates container namespace A and automatically associates it with service account A, granting tenant A the permission to access container namespace A only.
[0016] Based on the tenant A information submitted by the administrator, the container platform automatically creates application repository project A and automatically associates it with project account A, granting tenant A the permission to access application repository project A only.
[0017] Furthermore, the application software's self-maintenance and upgrade capabilities specifically include:
[0018] The container platform returns authorization tokens to the application software for pushing application template packages, application image packages, and application self-maintenance and upgrade operations;
[0019] The application software sends an authorization token to the container application repository to push the application template package, and the container platform provides feedback on the operation result.
[0020] The application software sends an authorization token to the container application repository to push the application image package, and the container platform provides feedback on the operation result.
[0021] The application software performs self-maintenance upgrades and backups. Once completed, it initiates a self-maintenance upgrade operation to the container platform. The container platform then starts a container instance, and the application software performs database and configuration upgrades.
[0022] Furthermore, the method also includes verifying whether the application software successfully performs database and configuration upgrades; if it fails, the application software is downgraded.
[0023] Furthermore, the method for verifying whether the application software successfully performed database and configuration upgrades includes asynchronously querying the self-maintenance upgrade results.
[0024] Furthermore, if the application software fails to perform self-maintenance and upgrade, a downgrade and restoration will be performed.
[0025] Furthermore, the specific steps of performing the downgrade and restore include:
[0026] The current version of the application software initiates an application self-maintenance degradation operation to the container platform. The container platform starts and executes the container instance before the upgrade, and the application software contained in the container instance before the upgrade performs database and configuration degradation.
[0027] Furthermore, after performing the database and configuration downgrade steps, the process also includes querying the self-maintaining downgrade results.
[0028] Furthermore, the method for querying self-maintained degradation results includes asynchronously querying self-maintained degradation results.
[0029] The beneficial effects of this invention are as follows:
[0030] Compared to the general upgrade capabilities provided by existing container platforms, this invention establishes a secure and isolated application software self-maintenance and upgrade resource management mechanism and control process based on the container platform and container application repository. This fully inherits and leverages the advantages of container instance rolling upgrades, blue-green upgrades, and canary upgrades, while also enabling application software to perceive and maintain its own upgrade status, further optimizing the upgrade rollback capability of application software on the container platform. Attached Figure Description
[0031] Figure 1 This is a schematic diagram of the container-based software self-maintenance and upgrade method provided by the present invention;
[0032] Figure 2 This is a schematic diagram of the self-maintenance, upgrade, authentication, authorization, and resource management mechanism of the application software of this invention;
[0033] Figure 3 This is a schematic diagram of the self-maintenance and upgrade control process of the application software of this invention;
[0034] Figure 4 This is a schematic diagram of the recovery control process after the application software of this invention fails to maintain or upgrade itself. Detailed Implementation
[0035] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, unless otherwise specified, the following embodiments and features described therein can be combined with each other.
[0036] 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.
[0037] Container platforms provide general application software upgrade and downgrade capabilities, but they can only detect whether the container microservices of application software are started and running normally from the perspective of container instances, lacking support for the following capabilities:
[0038] 1. After application software is containerized, it becomes difficult for the application software to upgrade the software programs inside the container instance;
[0039] 2. During the application software container instance upgrade process, the container platform cannot operate on the application software's own state, including the database table structure, and cannot detect whether the database upgrade was successful after the application software container instance upgrade.
[0040] To address the aforementioned technical problems, the following embodiments of the container-based software self-maintenance and upgrade method of the present invention are proposed.
[0041] Example 1
[0042] Reference Figure 1 ,like Figure 1 The diagram shown is a flowchart of a container-based software self-maintenance and upgrade method provided in this embodiment. The method specifically includes the following steps:
[0043] Step 1: The application software obtains authentication and authorization from the container platform.
[0044] Step 2: The authenticated and authorized application software sends an authentication request to the container platform with the tenant authentication information to complete the self-maintenance upgrade.
[0045] Specifically, this embodiment first describes the steps by which the application software obtains authentication and authorization from the container platform. (Refer to...) Figure 2 ,like Figure 2 The diagram shown is a schematic of the application software self-maintenance, upgrade authentication, authorization, and resource management mechanism in this embodiment.
[0046] The self-maintenance, upgrade, authentication, authorization, and resource management process for container-based application software is as follows:
[0047] (1) The administrator initiates a request to create container platform tenant A;
[0048] (2) The container platform automatically creates container platform service account A and project account A based on the tenant A information submitted by the administrator;
[0049] (3) Based on the tenant A information submitted by the administrator, the container platform automatically creates container namespace A and automatically associates it with service account A, authorizing tenant A to have and only have the permission to access container namespace A.
[0050] (4) The container platform automatically creates application repository project A based on the tenant A information submitted by the administrator, and automatically associates it with project account A, authorizing tenant A to have access to application repository project A only.
[0051] In this embodiment, when creating a tenant, resource objects such as container platform service accounts, project accounts, namespaces, and repository projects are automatically completed. Service accounts are associated with namespaces, and project accounts are associated with repository projects, ensuring secure isolation between tenants of the application software. Tenants can only access resources that the application software itself can access during upgrades, providing the prerequisites for authentication authorization and resource management required for subsequent self-maintenance and upgrades of the application software.
[0052] Next, the specific steps for self-maintenance and upgrade in this embodiment will be introduced. (Refer to...) Figure 3 ,like Figure 3 The diagram shown is a schematic of the self-maintenance and upgrade control process of the application software in this embodiment.
[0053] The self-maintenance and upgrade control process for container-based application software is as follows:
[0054] (1) The application software sends an authentication request to the container platform, carrying tenant authentication information;
[0055] (2) The container platform returns an authorization token (flag) to the application software for pushing application template packages, application image packages, and application self-maintenance and upgrade operations;
[0056] (3) The application software sends the application template package to the container application repository with the authorization mark, and the container platform provides feedback on the operation result;
[0057] (4) The application software sends the authorization mark to the container application repository to push the application image package, and the container platform provides feedback on the operation result.
[0058] (5) The application software performs self-maintenance upgrade backup. After completion, it initiates the application self-maintenance upgrade operation to the container platform. The container platform starts the container instance, and the application software performs database and configuration upgrade.
[0059] This embodiment is based on the application software self-maintenance and upgrade control mechanism of the container platform. The container platform provides authentication and authorization, application template package push, container image package push, application self-maintenance and upgrade operation, and application self-maintenance and upgrade query interface for application software self-maintenance and upgrade.
[0060] The container-based software self-maintenance and upgrade method provided in this embodiment, compared with the general upgrade capabilities provided by existing container platforms for containers, establishes a secure and isolated application software self-maintenance and upgrade resource management mechanism and control process based on the container platform and container application repository. It fully inherits and leverages the advantages of container instance rolling upgrade, blue-green upgrade, and canary upgrade mechanisms, while enabling application software to perceive and maintain its own upgrade status, further optimizing the upgrade rollback capability of application software on the container platform.
[0061] Example 2
[0062] Based on the foregoing embodiments, this embodiment also provides a solution for application software self-maintenance upgrade failures.
[0063] Reference Figure 4 ,like Figure 4 The diagram illustrates the control flow for restoring the application software after a self-maintenance upgrade failure in this embodiment. Based on the self-maintenance upgrade control flow for container-based application software provided in the previous embodiments, this embodiment adds an upgrade result query step and a downgrade / restoration step after an upgrade failure.
[0064] Specifically, the application software self-maintenance upgrade control process, which adds steps for querying upgrade results and downgrading / restoring after upgrade failure, is as follows:
[0065] (1) The application software sends an authentication request to the container platform, carrying tenant authentication information;
[0066] (2) The container platform returns an authorization token to the application software for pushing application template packages, application image packages, and application self-maintenance and upgrade operations;
[0067] (3) The application software sends the application template package to the container application repository with the authorization mark, and the container platform provides feedback on the operation result;
[0068] (4) The application software sends the authorization mark to the container application repository to push the application image package, and the container platform provides feedback on the operation result.
[0069] (5) The application software performs self-maintenance upgrade backup. After completion, it initiates the application self-maintenance upgrade operation to the container platform. The container platform starts the container instance, the application software performs database and configuration upgrades, and asynchronously queries the self-maintenance upgrade results to determine whether it is successful.
[0070] (6) If the application software fails to perform self-maintenance upgrade, a self-maintenance downgrade and restore operation will be performed. Specifically, the current version of the application software will initiate the application self-maintenance downgrade operation to the container platform. Then, the container platform will start the container instance of the previous version, and the application software of the previous version will perform database and configuration downgrade and asynchronously query the self-maintenance downgrade result.
[0071] It should be noted that, since upgrade and downgrade operations take a long time, synchronously querying upgrade and downgrade results can lead to blocking and waiting issues. Therefore, this embodiment uses an asynchronous query method to query upgrade and downgrade results.
[0072] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A container-based software self-maintenance and upgrade method, characterized in that, The method includes: Application software obtains certification and authorization from the container platform; Authentication and authorization applications send authentication requests to the container platform carrying tenant authentication information to complete self-maintenance upgrades; The application software obtains authentication and authorization from the container platform by associating the service account with the namespace and the project account with the repository project when creating a tenant. Specifically, this includes: the container platform automatically creates a container platform service account and a project account based on the tenant information submitted by the administrator, automatically creates a container namespace and associates it with the service account, and authorizes the tenant to access only the container namespace; at the same time, it automatically creates an application repository project and associates it with the project account, and authorizes the tenant to access only the application repository project. The application software completes self-maintenance and upgrades in the following specific ways: The container platform returns authorization tokens to the application software for pushing application template packages, application image packages, and application self-maintenance and upgrade operations; The application software sends an authorization token to the container application repository to push the application template package, and the container platform provides feedback on the operation result. The application software sends an authorization token to the container application repository to push the application image package, and the container platform provides feedback on the operation result. The application software performs self-maintenance upgrades and backups. Once completed, it initiates a self-maintenance upgrade operation to the container platform. The container platform then starts a container instance, and the application software performs database and configuration upgrades.
2. The container-based software self-maintenance and upgrade method as described in claim 1, characterized in that, The method also includes verifying whether the application software successfully performs database and configuration upgrades; if it fails, the application software is downgraded.
3. The container-based software self-maintenance and upgrade method as described in claim 2, characterized in that, The method for verifying whether the application software successfully performed database and configuration upgrades includes asynchronously querying the self-maintenance upgrade results.
4. The container-based software self-maintenance and upgrade method as described in claim 3, characterized in that, If the application software fails to perform self-maintenance and upgrade, a downgrade and restoration will be performed.
5. The container-based software self-maintenance and upgrade method as described in claim 4, characterized in that, The specific steps of performing the downgrade and restore include: The current version of the application software initiates an application self-maintenance degradation operation to the container platform. The container platform starts and executes the container instance before the upgrade, and the application software contained in the container instance before the upgrade performs database and configuration degradation.
6. The container-based software self-maintenance and upgrade method as described in claim 5, characterized in that, The process of executing the database and configuring downgrade also includes querying the self-maintaining downgrade results.
7. The container-based software self-maintenance and upgrade method as described in claim 6, characterized in that, The method for querying self-maintained degradation results includes asynchronous querying of self-maintained degradation results.
Citation Information
Patent Citations
Tenant management method and system of container cloud platform, electronic equipment and storage medium
CN110990150A
Automatic deployment method and device based on helm
CN112558987A