CN118034727A - System for accurately updating multiple container mirror images - Google Patents

System for accurately updating multiple container mirror images Download PDF

Info

Publication number
CN118034727A
CN118034727A CN202311708926.1A CN202311708926A CN118034727A CN 118034727 A CN118034727 A CN 118034727A CN 202311708926 A CN202311708926 A CN 202311708926A CN 118034727 A CN118034727 A CN 118034727A
Authority
CN
China
Prior art keywords
container
controller
user
version
updating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311708926.1A
Other languages
Chinese (zh)
Inventor
张红亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianyi Cloud Technology Co Ltd
Original Assignee
Tianyi Cloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianyi Cloud Technology Co Ltd filed Critical Tianyi Cloud Technology Co Ltd
Priority to CN202311708926.1A priority Critical patent/CN118034727A/en
Publication of CN118034727A publication Critical patent/CN118034727A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a system for accurately updating images of multiple containers, which comprises: the user operation module is used for providing an interface for the outside and is used for a user to call; and also for interacting with a database; a database for storing a plurality of mirrored versions for selection by a user; the controller is used for updating or rolling back the container mirror version after the user selects any mirror version; the monitoring module is used for monitoring Annotations field update inside the controller; and the container mirror image updating module is used for acquiring container mirror image information according to the change of Annotations fields and updating the corresponding container mirror image version according to the mirror image information. The invention can carry out mirror image update on any container in the managed container without affecting the normal work of other application containers.

Description

System for accurately updating multiple container mirror images
Technical Field
The invention belongs to the field of container and cloud computing, and particularly relates to a system for accurately updating multiple container images.
Background
Currently, cloud computing technology is being developed vigorously, wherein a K8s container orchestration system is one of the main options, and is attracting attention. Many cloud service providers consider this as an important solution. In the K8s framework StatefulSet and Deployment are commonly used controllers for efficiently managing containerized workloads. Typically StatefulSet is used to deploy applications with state characteristics, while Deployment is suitable for stateless applications. In deploying applications with two controllers, it is often necessary to deploy multiple containers within one container when there are the following requirements:
1. shared network namespaces:
Sharing a network namespace enables containers to communicate directly with each other, sharing the same network interface and IP address, a very useful requirement in a particular scenario. For example, when implementing in a network element carrying traffic forwarding in a cloud computing system in combination with container technology and NFV technology, it is often necessary to monitor network configuration according to service needs, for example, IP of the network element, routing of the network element, and change monitoring needs according to service scenarios, so that the logic arrangement of monitoring is generally used as a container alone. In this case, the monitoring container and the network element container are generally deployed in the same container, and effective monitoring of the network container is achieved under the condition of sharing network space.
2. Multiplexing of shared storage volumes and log containers:
in a containerized environment, multiple containers may access the same data by sharing a storage volume. This is very useful for sharing configuration, log, or data between containers. Multiple containers can access the same data, ensuring consistency of the data. Sharing storage volumes reduces the need to copy the same data multiple times, thereby reducing the overhead of storage resources. In combination with the characteristic that the containers share the storage volume, the logic of log acquisition processing is often modularized and is deployed as a container independently, and the log acquisition analysis modules are relatively fixed and unified. Therefore, the log module is independently deployed as a container, so that the log module can be developed at one time and multiplexed at multiple places. In this case, the log container and the business container need to be deployed in the same container.
3. Sharing IPC namespaces:
Under certain specific requirements, such as when developing a high performance data processing application, the application requires fast processing of large amounts of data for complex calculations. Shared IPC naming (e.g., message queues, shared memory, semaphores, etc. are isolated) can directly access the same data without copying the data or communicating over a network. This greatly increases the speed of data processing as it reduces the overhead of data transmission. Different containers are responsible for different data processing logic, most typically one container is responsible for producing data and one container is responsible for consuming data, decoupled from each other.
In the above scenario, it is required to deploy two or more containers within the same container, which must be capable of independent operation. In this context, it is desirable to provide an optimization method to ensure that one container in a collection of containers is updated and released without negatively impacting the normal operation of the other containers.
Disclosure of Invention
In order to solve the problems, the invention provides a K8 s-based multi-container mirror image accurate updating system, when an application is deployed by using StatefulSet controllers and Deployment controllers, any container in the managed container can be subjected to mirror image updating without affecting the normal work of other application containers.
In order to achieve the above object, the present invention provides the following solutions: a system for accurately updating multiple container images, comprising:
The system comprises a user operation module, a database, a controller, a monitoring module and a container mirror image updating module;
the user operation module is used for providing an interface for the outside for a user to call; and also for interacting with the database;
The database is used for storing a plurality of mirror image versions for users to select;
the controller is used for updating or rolling back the container mirror version after the user selects any mirror version;
the monitoring module is used for monitoring Annotations field update inside the controller;
The container mirror image updating module is used for acquiring container mirror image information according to the change of the Annotations field and updating the corresponding container mirror image version according to the mirror image information.
Preferably, the controller comprises StatefulSet controller and Deployment controller;
The StatefulSet and Deployment controllers are used to write user-selected mirrored versions to the Annotations fields of the StatefulSet and Deployment controllers.
Preferably, the controller includes a user interface unit, a version visualization unit, an operation simplification unit;
the user interface unit is used for enabling a user to view and manage the mirror image version of the container by providing a user interface which is easy to understand and operate;
The version visualization unit is used for enabling a user to intuitively acquire the container mirror version condition, wherein the container mirror version comprises a currently running version and available updated versions;
the operation simplifying unit is used for simplifying the operation of a user and enabling the user to easily finish tasks through a user interface; the tasks include at least upgrading a container image, expanding an application, or rolling back to a previous version.
Preferably, the user interface is a controller unit presented in a graphical form for a user to intuitively view and manipulate the container image and to perform tasks related to the container image version.
Preferably, the tasks at least comprise traffic forwarding and collecting network element health;
The flow forwarding is based on network element container responsibility realization;
the health degree of the acquisition network element is realized based on the monitoring item acquisition container, and the image entry of the monitoring item acquisition container can be intuitively updated or rolled back according to the image version of the container.
Preferably, the monitoring module is configured to monitor the updates in Annotations fields of StatefulSet and Deployment controllers in the K8s controller, and when the updates occur, trigger ReconcileLoop mechanism execution of the K8s, and enter subsequent actions.
Preferably, the ReconcileLoop mechanism of K8s is based on a Kubernetes controller monitoring the creation/update/deletion event of the resource and triggering Reconcile function in response, completing the tuning loop based on the entire tuning process.
Preferably, the Reconcile function uses the namespace of K8s and the instance name to locate the resource and call the resource method, so that the actual state of the instance is consistent with the state of the resource defined by K8s, and the update flow of the resource is simplified based on the characteristics of declaration and idempotency.
Preferably, the Annotations field is used to store metadata or additional information about the object;
the purpose of Annotations field at least includes label and description, security policy, application configuration;
The labels and descriptions are used for providing labels and description information for the resources, so that the resources are easier to understand and identify;
The security policy is used for storing security policy information about resources;
the application configures configuration information for specifying the resource.
Preferably, the tag and descriptive information includes usage, responsible person and environmental information of the container.
Compared with the prior art, the invention has the following advantages and technical effects:
the invention provides a user-friendly interface, and reduces the technical threshold for operating the Kubernetes environment. This helps to reduce erroneous operations and improve operation efficiency, thereby enhancing user experience and promoting popularization and application of technology.
The invention realizes accurate updating of the container mirror image by monitoring Annotations fields in StatefulSet controllers and Deployment controllers. When the StatefulSet controller and the Deployment controller deploy the application, any container in the managed container can be subjected to mirror image update without affecting the normal work of other application containers.
The invention allows for mirror updates for a particular container without disturbing other containers, ensuring continuity and availability of the application. The usability and the stability of the containerized application are improved, the continuous running of the application is ensured by avoiding unnecessary interruption and stopping of external service, and the adverse influence of the application interruption on users and services is reduced. In particular for the scene of multi-container service, the invention meets the specific requirements of application and provides a more flexible container management mode.
The invention allows service decoupling between containers by introducing a flexible architecture so as to replace, update or expand different service components more easily without causing serious interference to the whole system, and can be widely applied to various containerized applications and scenes.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:
FIG. 1 is a schematic diagram of a conventional StatefulSet/Deployment pod update scheme according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a K8s pod accurate update scheme according to an embodiment of the present invention.
Detailed Description
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other. The application will be described in detail below with reference to the drawings in connection with embodiments.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowcharts, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
Noun interpretation
K8s (Kubernetes, container platform): an open-source container orchestration platform that can automatically perform many of the manual operations involved in deploying, managing, and expanding containerized applications.
NAT (Network Address Translator, network address translation): techniques for using private addresses in a local network, which in turn use global IP addresses when connecting to the internet. NAT is actually a technology developed to solve the shortage of IPv4 addresses.
VPN (Virtual Private Network ): techniques or services for establishing private and secure connections over a public network
NFV (Network Functions Virtualization, network function virtualization): a network technology and architecture is provided for decoupling network services and functions from conventional dedicated hardware devices and transferring them to virtualized software environments.
IPC (Inter-Process Communication, process communication): some techniques or methods of transferring data or signals between at least two processes or threads.
As shown in fig. 2, the system for accurately updating the images of multiple containers provided by the invention comprises,
And the user operation module is used for: the module is used for providing an interface for the outside for the user to call. And can interact with the database, the said database is used for storing a plurality of mirror image edition in the database, for users to choose, the convenience user can choose any mirror image edition to update or roll back. After the user selects the mirrored version, the mirrored version will be written into the Annotations fields of StatefulSet and Deployment controllers.
Compared with the traditional Kubernetes (K8 s) system shown in fig. 1, the embodiment introduces the controller module, through which a user can operate the Kubernetes system more conveniently, and an intuitively friendly way is provided for managing the container mirror version, so that the operation is more convenient. The traditional manner in which Kubernetes manages containers and mirrored versions may require the user to gain insight and process some technical details, may require writing YAML files or performing operations using kubectl command line tools. The controller module of the present embodiment makes these operations more intuitive and easy by providing a user-friendly interface.
In particular, the solution of the present embodiment provides enhanced functionality in the following aspects:
Friendly user interface unit: the controller module provides an easy to understand and operate user interface that allows a user to easily view and manage the container image version. The user interface of the embodiment is presented in a graphical form, reducing technical complexity.
The improved user interface of this embodiment is suitable for managing container image versions in a Kubernetes environment. The user interface is a graphical controller unit that allows a user to intuitively view and manipulate the container image and perform tasks related to the container image version. One container in the user page contains vrouter containers responsible for forwarding and exporter containers responsible for exposing the monitoring items to the outside. The container mirror entries may be upgraded or rolled back intuitively to exporter according to the container mirror version. Through the user interface, the technical threshold for operating the Kubernetes environment is reduced. This helps to reduce erroneous operations and improve operation efficiency, thereby enhancing user experience and promoting popularization and application of technology.
Version visualization unit: through the controller module, the user can intuitively understand the situation of the mirrored version of the container, including the version currently running and the available updated version. Such visualization helps the user to better grasp the system state.
Operation simplification unit: the controller module may simplify the operation of the user. The user can easily accomplish common tasks through the interface, such as upgrading the container image, expanding the application, or rolling back to a previous version. This reduces the command line operations that the user needs to perform, reducing the risk of errors occurring.
Monitoring module: the update in Annotations for implementing the K8s Controller (Controller) internal snoop StatefulSet Controller and Deployment Controller, when it occurs, triggers the ReconcileLoop mechanism of K8s to execute, entering the subsequent actions. The ReconcileLoop mechanism of K8s means that the Kubernetes controller will monitor the creation/update/deletion event of the resource and trigger Reconcile function in response, the whole tuning process is called "ReconcileLoop" (tuning loop). The Reconcile function uses the name space and the instance name of K8s to locate the resource and call the resource method, so that the actual state of the instance is consistent with the state of the resource defined by K8s, and the declaration and idempotent characteristics simplify the updating flow of the resource.
A container mirror update module: and the updating module is used for acquiring the container mirror image information according to the change of the Annotations field and updating the corresponding container mirror image version according to the mirror image information. The Annotations field in Kubernetes (K8 s) is typically used to store metadata or additional information about the object that does not directly affect the core functionality of the object, but is very useful for management and monitoring. The following are typical uses of some Annotations fields of this embodiment:
label and description: annotations can be used to provide labels and descriptive information for the resource, making it easier to understand and identify. For example, annotations is added to the container object to specify information about the use, responsible person, environment, etc. of the container.
Security policy: annotations may be used to store security policy information about the resource. For example, it may be specified which security policies should be applicable to a container or other resource.
Application configuration: annotations may be used to specify configuration information for the resource. This is very useful for automatically configuring applications in a K8s cluster, enabling the resource to adapt to different environments.
Heretofore, it has been common to have been limited to setting the container image version in the image field in the container of StatefulSet and Deployment controllers. However, since the K8s default controller is fixed for this portion of the process, all of the containers within the container will be restarted. Annotations is used as a resource of k8s, in this embodiment, the controller is redefined, logic of the controller is written by itself, and changes of specific mirror fields of Annotations are monitored to obtain mirror information, determine behaviors of the container, and update corresponding mirror versions of the container. Because the self-defined controller is more transparent and controllable in operation, and better in timeliness, the limitation of the K8s default controller is broken through, and the function of the self-defined controller is more focused and efficient.
The breakthrough of the embodiment for the traditional use of K8sAnnotations and the innovative operation of the mirror image updating mode for the StatefulSet controller and the Deployment controller in K8s enable the mirror image updating step to be transparent, efficient and controllable. A novel controller for updating the container mirror image is realized by utilizing a ReconcileLoop mechanism of k8s, and the working steps of the controller are as follows: the recorded container image information is first obtained from 'Annotations' in StatefulSet or Deployment controllers. These container images are then extracted and compared to corresponding container images in the container managed by either StatefulSet or Deployment controllers. When the two images are inconsistent, firstly verifying whether the images in the expected state exist in an image library or not to ensure the legitimacy of the images. If the mirroring is legal, only the affected ones of the containers will be updated without triggering a restart of all of the containers in the entire container.
In conventional approaches, updating the mirror image of one container may result in a stop and restart of the entire container set, meaning that connections to external services, such as network traffic forwarding, may be interrupted. This may affect the proper functioning and usability of the application.
The present embodiment can accurately determine which container images need to be updated by the controller listening to the Annotations fields in StatefulSet and Deployment controllers, and update only those needed containers without disturbing the other containers. This approach has the following advantages:
accurate mirror update: the controller of the present embodiment can accurately apply updates to a specified container without affecting other containers, which avoids unnecessary disruption and impact.
Improving application availability: by avoiding restarting the entire container set, the usability of the application can be improved, ensuring the continuity of external services.
The present embodiment enables accurate updates to the container image by listening to the Annotations fields in StatefulSet and Deployment controllers. This container management method allows for mirror updates for a particular container without disturbing other containers, ensuring continuity and availability of the application. The usability and the stability of the containerized application are improved, the continuous running of the application is ensured by avoiding unnecessary interruption and stopping of external service, and the adverse influence of the application interruption on users and services is reduced. In particular for the scene of multi-container service, the invention meets the specific requirements of application and provides a more flexible container management mode.
The generic container management method of the present embodiment emphasizes the idea of decoupling external services. In particular, by introducing a flexible architecture, service decoupling between containers is allowed to more easily replace, update or extend different service components without causing serious interference to the overall system. The method can be widely applied to various containerized applications and scenes, allows enterprises and developers to construct and maintain the containerized applications more flexibly, reduces system dependence and coupling, and improves maintainability, expandability and upgradeability of the system.
Description of the preferred embodiments
Edge computing network element container mirror update: and various network schemes under cloud computing are realized in a virtual network mode, and cloud network capabilities such as NAT, VPN, private line and the like are provided through network elements. The gateway is realized through a container deployed by a StatefulSet controller and a Deployment controller of K8s, a network element container which is responsible for providing flow forwarding is arranged in the container, and a monitoring item acquisition container which is responsible for acquiring the health degree of the network element is arranged in the container.
The present application is not limited to the above-mentioned embodiments, and any changes or substitutions that can be easily understood by those skilled in the art within the technical scope of the present application are intended to be included in the scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims (10)

1. A system for accurately updating multiple container images, comprising:
The system comprises a user operation module, a database, a controller, a monitoring module and a container mirror image updating module;
the user operation module is used for providing an interface for the outside for a user to call; and also for interacting with the database;
The database is used for storing a plurality of mirror image versions for users to select;
the controller is used for updating or rolling back the container mirror version after the user selects any mirror version;
the monitoring module is used for monitoring Annotations field update inside the controller;
The container mirror image updating module is used for acquiring container mirror image information according to the change of the Annotations field and updating the corresponding container mirror image version according to the mirror image information.
2. The system for accurately updating multiple container images according to claim 1, wherein,
The controller includes StatefulSet controller and Deployment controller;
The StatefulSet and Deployment controllers are used to write user-selected mirrored versions to the Annotations fields of the StatefulSet and Deployment controllers.
3. The system for accurately updating multiple container images according to claim 1, wherein,
The controller comprises a user interface unit, a version visualization unit and an operation simplification unit;
the user interface unit is used for enabling a user to view and manage the mirror image version of the container by providing a user interface which is easy to understand and operate;
The version visualization unit is used for enabling a user to intuitively acquire the container mirror version condition, wherein the container mirror version comprises a currently running version and available updated versions;
the operation simplifying unit is used for simplifying the operation of a user and enabling the user to easily finish tasks through a user interface; the tasks include at least upgrading a container image, expanding an application, or rolling back to a previous version.
4. The system for accurately updating multiple container images according to claim 3, wherein,
The user interface is a controller unit presented in a graphical form for a user to intuitively view and manipulate the container image and to perform tasks related to the container image version.
5. The system for accurately updating multiple container images according to claim 4, wherein,
The tasks at least comprise flow forwarding and network element health acquisition;
The flow forwarding is based on network element container responsibility realization;
the health degree of the acquisition network element is realized based on the monitoring item acquisition container, and the image entry of the monitoring item acquisition container can be intuitively updated or rolled back according to the image version of the container.
6. The system for accurately updating multiple container images according to claim 1, wherein,
The monitoring module is used for monitoring the update in the Annotations fields of the StatefulSet controller and the Deployment controller in the K8s controller, and triggering the ReconcileLoop mechanism of the K8s to execute when the update occurs, and entering the follow-up action.
7. The system for accurately updating multiple container images according to claim 6, wherein,
The ReconcileLoop mechanism of K8s is based on a Kubernetes controller monitoring the creation/update/deletion event of the resource and triggering Reconcile function in response, completing the tuning loop based on the whole tuning process.
8. The system for accurately updating multiple container images according to claim 7, wherein,
The Reconcile function uses the name space and the instance name of K8s to locate the resource and call the resource method, so that the actual state of the instance is consistent with the state of the resource defined by K8s, and the updating flow of the resource is simplified based on the characteristics of declaration and idempotency.
9. The system for accurately updating multiple container images according to claim 1, wherein,
The Annotations field is used to store metadata or additional information about the object;
the purpose of Annotations field at least includes label and description, security policy, application configuration;
The labels and descriptions are used for providing labels and description information for the resources, so that the resources are easier to understand and identify;
The security policy is used for storing security policy information about resources;
the application configures configuration information for specifying the resource.
10. The system for accurately updating multiple container images according to claim 9, wherein,
The tag and descriptive information includes usage, responsible person and environmental information of the container.
CN202311708926.1A 2023-12-13 2023-12-13 System for accurately updating multiple container mirror images Pending CN118034727A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311708926.1A CN118034727A (en) 2023-12-13 2023-12-13 System for accurately updating multiple container mirror images

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311708926.1A CN118034727A (en) 2023-12-13 2023-12-13 System for accurately updating multiple container mirror images

Publications (1)

Publication Number Publication Date
CN118034727A true CN118034727A (en) 2024-05-14

Family

ID=90988377

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311708926.1A Pending CN118034727A (en) 2023-12-13 2023-12-13 System for accurately updating multiple container mirror images

Country Status (1)

Country Link
CN (1) CN118034727A (en)

Similar Documents

Publication Publication Date Title
US20220091834A1 (en) Method, apparatus, electronic device and readable storage medium for deploying application
US8433948B2 (en) Method and apparatus for realizing application high availability
US8302077B2 (en) Method and system for configuring software modules to execute in an execution environment
CN109344000B (en) Block chain network service platform, recovery tool, fault processing method thereof and storage medium
US9086901B2 (en) Migration of applications from physical machines to virtual machines
US7979869B2 (en) Method and system for performing I/O operations using a hypervisor
US20190082004A1 (en) Systems and methods for instantiating services on top of services
CN110799942B (en) Method, apparatus and computer readable medium for managing network devices and services
US11249788B2 (en) Cloud management platform, and virtual machine management method and system
CN102200921A (en) Intelligent boot device selection and recovery
JP2004272912A (en) Architecture for distributed computing system and automated design, development and management of distributed application
JP2011060035A (en) System, method and program for deploying application
US11991094B2 (en) Metadata driven static determination of controller availability
US8875132B2 (en) Method and apparatus for implementing virtual proxy to support heterogeneous systems management
CN111984261A (en) Compiling method and compiling system
US8738746B2 (en) Configuration management for real-time server
CN114840223A (en) Resource processing method and device
CN116028163A (en) Method, device and storage medium for scheduling dynamic link library of container group
CN113849137B (en) Visualization block storage method and system for Shenwei container platform
CN115357198B (en) Mounting method and device of storage volume, storage medium and electronic equipment
CN111459619A (en) Method and device for realizing service based on cloud platform
CN118034727A (en) System for accurately updating multiple container mirror images
CN115913778A (en) Network strategy updating method, system and storage medium based on sidecar mode
US20220067065A1 (en) Providing instant and distributed access to a source blob via copy-on-read blobs and link blobs
KR101044173B1 (en) Architecture for distributed computing system and automated design, deployment, and management of distributed applications

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination