Container application management and control method, device and system, and electronic device
By connecting the DevOps platform and the container platform on the control server of the container application, obtaining control permission configuration information and determining the hierarchical control strategy, the complexity and cost of container application deployment and management in the existing technology are solved, and the rapid delivery and continuous management of cloud-native applications are achieved.
Patent Information
- Application Number
- CN202311828342.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-27
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2043-12-27
Smart Images

Figure CN117667127B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of container application technology, and in particular to a container application management and control method, device and system, and electronic equipment. Background Art
[0002] Container technology can encapsulate the characteristics of the entire runtime environment of microservices, and is naturally suitable for the construction, release and operation of microservices, allowing the originally slow-moving DevOps to develop rapidly. However, for multi-cloud environments, such as cloud environments with multiple manufacturers and multiple architectures, a single DevOps platform has no time to take care of the construction, deployment and delivery of complex microservices.
[0003] Cloud-native DevOps aims to solve the problem of continuous delivery and intelligent self-operation and maintenance capabilities for microservice applications that have been deployed in containerized form. It can achieve higher service quality and lower development and operation costs than traditional DevOps platforms, allowing R&D to focus on rapid business iteration. Therefore, it has gradually become the preferred tool for various companies to solve problems such as resource management in Docker and Kubernetes (K8s for short), microservice environment construction, and complexity and low efficiency of continuous integration.
[0004] However, on the one hand, some existing container platforms and DevOps platforms have not yet completed seamless docking, and the DevOps platform's container application deployment, version update, container start and stop capabilities have not realized the full CI / CD process. If cloud-native DevOps is to be implemented, the cost of transforming the existing DevOps platform or container platform is high. On the other hand, the continuous deployment and version control of container applications are not flexible enough, and there are many image versions of agile pipeline flows. Direct access to the image warehouse and container platform deployment can easily lead to chaotic management. In addition, enterprises generally have multiple environments that need to verify the image products corresponding to container applications, and the image products are continuously built, with multiple environments and multiple versions coexisting. Based on the multi-environment pipeline CI / CD scenario, it is very necessary to effectively control the image and application updates according to the environment, which can ensure the consistency of environmental variables and ensure that what is measured is what is obtained. Summary of the invention
[0005] Based on this, the embodiments of the present application provide a container application management and control method, device and system, and electronic device to achieve rapid delivery of cloud native applications and hierarchical management and control of container applications at low cost and quickly.
[0006] The present application embodiment adopts the following technical solutions:
[0007] In a first aspect, an embodiment of the present application provides a method for managing and controlling a container application, the method being executed by a management and control server of the container application, the management and control server of the container application being used to connect a DevOps platform and a container platform, the method comprising:
[0008] Receive container application deployment requests from the DevOps platform;
[0009] Acquire control authority configuration information of container application deployment according to the container application deployment request;
[0010] Determine the hierarchical control policy corresponding to the container application deployment request according to the control authority configuration information of the container application deployment, so as to deploy the container application on the container platform according to the hierarchical control policy corresponding to the container application deployment request.
[0011] Optionally, before receiving the container application deployment request from the DevOps platform, the method further includes:
[0012] Receive an application request from the DevOps platform, where the application request is used to apply for account activation and management and control permissions, including image storage and container application deployment management and control permissions;
[0013] Determine the account activation status based on the application request and configure the corresponding management and control permissions.
[0014] Optionally, the container application deployment request is a container application deployment request triggered by a new image. Before receiving the container application deployment request from the DevOps platform, the method further includes:
[0015] Receive new image storage requests from the DevOps platform;
[0016] Obtaining image storage management and control authority configuration information according to the new image storage request;
[0017] The hierarchical control policy corresponding to the new image entry request is determined according to the control authority configuration information of the image entry, so as to enter the new image into the image warehouse according to the hierarchical control policy corresponding to the new image entry request.
[0018] Optionally, determining the hierarchical control strategy corresponding to the new image storage request according to the image storage control authority configuration information includes:
[0019] If the control authority configuration information of the image storage is level one control, it is determined that the hierarchical control strategy corresponding to the new image storage request is the DevOps platform pipeline to directly store the new image;
[0020] If the control authority configuration information of the image storage is secondary control, the hierarchical control strategy corresponding to the new image storage request is determined as follows: after the pipeline of the DevOps platform submits the storage application and is approved by the control platform, the new image is stored by the pipeline and monitored by the control server of the container application;
[0021] If the control authority configuration information for the image entry is level three control, then the hierarchical control strategy corresponding to the new image entry request is determined as the DevOps platform pipeline submitting the entry application and after approval by the control platform, the new image will be entered into the warehouse by the control platform and monitored by the control server of the container application.
[0022] Optionally, determining the hierarchical control strategy corresponding to the container application deployment request according to the control authority configuration information of the container application deployment includes:
[0023] If the control authority configuration information of the container application deployment is first-level control, it is determined that the hierarchical control strategy corresponding to the container application deployment request is the pipeline of the DevOps platform to directly deploy the container application;
[0024] If the control authority configuration information of the container application deployment is secondary control, it is determined that the hierarchical control strategy corresponding to the container application deployment request is that after the DevOps platform pipeline submits the deployment application and it is approved by the control platform, the container application is deployed by the pipeline and monitored by the container application control server;
[0025] If the control authority configuration information of the container application deployment is three-level control, then the hierarchical control strategy corresponding to the container application deployment request is determined to be the DevOps platform's pipeline. After the deployment application is submitted and approved by the control platform, the container application is deployed by the control platform and monitored by the container application's control server.
[0026] Optionally, after receiving the container application deployment request from the DevOps platform, the method further includes:
[0027] Querying application information of the container application to be deployed according to the container application deployment request;
[0028] The deployment type of the container application to be deployed is determined according to the query result, so as to deploy the container application according to the hierarchical management and control strategy corresponding to the container application deployment request and the deployment type of the container application to be deployed, wherein the deployment type includes first deployment and update deployment.
[0029] Optionally, the method further comprises:
[0030] Providing an application interface so that the DevOps platform can implement corresponding interface functions by calling the application interface;
[0031] The application interface includes at least one of a query interface, a deployment interface and an update interface.
[0032] In a second aspect, an embodiment of the present application further provides a container application management and control device, the device is applied to a container application management and control server, the container application management and control server is used to connect a DevOps platform and a container platform, the device includes:
[0033] A receiving unit, used to receive a container application deployment request from a DevOps platform;
[0034] An acquisition unit, configured to acquire management and control authority configuration information of container application deployment according to the container application deployment request;
[0035] The first determination unit is used to determine the hierarchical control strategy corresponding to the container application deployment request according to the control authority configuration information of the container application deployment, so as to deploy the container application on the container platform according to the hierarchical control strategy corresponding to the container application deployment request.
[0036] In a third aspect, an embodiment of the present application further provides a container application management and control system, wherein the container application management and control system comprises a container application management and control server, a DevOps platform and at least one container platform, and the container application management and control server is used to execute any of the aforementioned methods.
[0037] In a fourth aspect, an embodiment of the present application further provides an electronic device, including:
[0038] Processor; and
[0039] A memory arranged to store computer executable instructions, which when executed cause the processor to perform any of the methods described above.
[0040] In a fifth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores one or more programs. When the one or more programs are executed by an electronic device including multiple application programs, the electronic device executes any of the aforementioned methods.
[0041] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects: the container application management method of the embodiment of the present application is executed by the container application management server, and the container application management server is used to connect the DevOps platform and the container platform, first receiving the container application deployment request of the DevOps platform; then obtaining the management permission configuration information of the container application deployment according to the container application deployment request; finally, determining the hierarchical management strategy corresponding to the container application deployment request according to the management permission configuration information of the container application deployment, so as to deploy the container application on the container platform according to the hierarchical management strategy corresponding to the container application deployment request. The container application management method of the present application can solve the problem of rapid delivery of cloud native applications at low cost and quickly, and can realize continuous management of images and container applications without modifying the existing container platform. At the same time, it can also realize hierarchical management of images and container applications, ensure the consistency of test environment deliverables, and can also realize docking with multiple container platforms with different architectures. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0043] Figure 1 A flowchart of a method for controlling container applications in an embodiment of the present application;
[0044] Figure 2 This is a schematic diagram of a management and control process of a container application in an embodiment of the present application;
[0045] Figure 3 A schematic diagram of the structure of a control device for a container application in an embodiment of the present application;
[0046] Figure 4 This is a schematic diagram of the architecture of a container application management and control system in an embodiment of the present application;
[0047] Figure 5 This is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0049] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0050] To facilitate the understanding of the embodiments of the present application, the main technical terms involved in the embodiments of the present application are first introduced:
[0051] Cloud native: a distributed cloud based on distributed deployment and unified operation and management, a set of cloud technology product systems built on technologies such as containers, microservices, and DevOps.
[0052] DevOps (a combination of Development and Operations): is a collective name for a group of processes, methods and systems that are used to promote communication, collaboration and integration between development (application / software engineering), technical operations and quality assurance (QA) departments. It is a culture, movement or practice that emphasizes communication and cooperation between "software developers (Dev)" and "IT operations and maintenance technicians (Ops)". By automating the processes of "software delivery" and "architecture changes", the building, testing and release of software can be faster, more frequent and more reliable.
[0053] 3) Docker: It is an open source application container engine that allows developers to package their applications and dependent packages into a portable image, and then publish it to any popular Linux or Windows operating system machine, and can also achieve virtualization. The container is completely sandboxed, and there is no interface between them.
[0054] 4) Container: A lightweight virtualization technology that allows the user space on the operating system to be divided into several independent units running in the kernel without interfering with each other. Such an independent space is called a "container". A container is an application running instance created based on an image, a specific process running an application, which can be started, started, stopped, and deleted, and these containers are isolated and invisible to each other.
[0055] 5) Image: Similar to the image of a virtual machine, it is generally understood as an installation file, which is equivalent to a container template. Different containers can be created based on different images. The relationship between images and containers can be understood as the relationship between classes and instance objects in object-oriented programming.
[0056] 6) Image repository: Similar to the code repository, it is a place where Docker stores image files. There are local image repositories Docker-Registry and public image repositories Docker Hub. Usually, you use the images in the local repository. If the local repository does not have them, you can download them from the public image repository.
[0057] The present application embodiment provides a method for managing and controlling container applications, such as Figure 1 As shown, a flow chart of a method for controlling a container application in an embodiment of the present application is provided. The method is executed by a control server of a container application. The control server of the container application is used to connect a DevOps platform and a container platform. The method includes at least the following steps S110 to S130:
[0058] Step S110, receiving a container application deployment request from the DevOps platform.
[0059] The control method of the container application in the embodiment of the present application can be executed by the control server of the independently deployed container application. The control server of the container application is used to connect the DevOps platform and the container platform, so as to quickly solve the problem of rapid delivery of cloud native applications, and there is no need to modify the existing container platform, further reducing the access cost. Of course, it should be noted that the control server of the container application in the embodiment of the present application can also be integrated in the DevOps platform or the container platform. The specific deployment can be flexibly set by those skilled in the art according to actual needs, and no specific limitation is made here.
[0060] The DevOps platform can build and deploy pipelines. The pipeline is based on subtask execution. The subtasks and operating environments correspond one to one. Both container environments and non-container environments are applicable. The embodiment of this application currently mainly reflects the container environment. If the non-container environment has similar product push, deployment, query and update functions, it can also adopt the process and control scheme of the embodiment of this application. The container platform can be a container cloud platform of any architecture and scale. The actual operating environment of the container corresponds one to one with the namespace of the application in the K8s cluster.
[0061] When managing and controlling container applications, you need to first receive container application deployment requests initiated by relevant personnel such as project developers on the DevOps platform. The container application deployment request here can be understood as a request to deploy an application on the container platform, which can include the deployment and update of new applications, as well as the expansion deployment of application copies.
[0062] Step S120: acquiring control authority configuration information of container application deployment according to the container application deployment request.
[0063] According to the container application to be deployed, it is necessary to further determine the control permission configuration information corresponding to the container application to be deployed. The control permission configuration information of the container application can be configured in advance for different R&D projects or container applications based on actual control needs. The control permission configuration information specifically reflects the control strategies that need to be adopted by different applications to be deployed during the application deployment stage.
[0064] Step S130, determining a hierarchical control policy corresponding to the container application deployment request according to the control authority configuration information of the container application deployment, so as to deploy the container application on the container platform according to the hierarchical control policy corresponding to the container application deployment request.
[0065] After obtaining the control permission configuration information for container application deployment, the hierarchical control strategy corresponding to the current container application to be deployed can be determined, that is, the control level according to which the deployment phase of the container application to be deployed is controlled. The hierarchical control strategy can be set to multiple levels according to the strictness of the control. Of course, the specific number of levels can be flexibly set by technical personnel in this field according to actual research and development needs, and no specific limitation is made here.
[0066] The container application management and control method of the present application can solve the problem of rapid delivery of cloud-native applications at a low cost and quickly. It can achieve continuous management of images and container applications without modifying the existing container platform. At the same time, it can also realize hierarchical management and control of images and container applications to ensure the consistency of test environment deliverables, and can also realize docking with multiple container platforms with different architectures.
[0067] In some embodiments of the present application, before receiving a container application deployment request from a DevOps platform, the method further includes: receiving an application request from the DevOps platform, the application request being used to apply for account activation and application for management and control permissions, the management and control permissions including management and control permissions for image warehousing and container application deployment; determining the account activation status based on the application request and configuring corresponding management and control permissions.
[0068] The accounts from the DevOps platform's pipeline to the image repository and container platform are in an inactivated state by default, so the corresponding personnel need to initiate account activation and apply for permissions to store images and deploy container applications before the pipeline is started. For the account activation status and permission application, this application can first allocate accounts through the management and control server, and then implement account activation and permission allocation through the account control script. If the / etc / passwd / sbin / nologin script is executed, the account is not activated and has no permission to continue executing the pipeline; if the / etc / passwd / bin / bash script is executed, the account is activated and has permission to continue executing the pipeline. Of course, the specific configuration of the control level of permissions can be flexibly configured according to the actual project development needs, and no specific restrictions are made here.
[0069] In some embodiments of the present application, the container application deployment request is a container application deployment request triggered by a new image. Before receiving the container application deployment request from the DevOps platform, the method also includes: receiving a new image entry request from the DevOps platform; obtaining image entry control permission configuration information based on the new image entry request; determining a hierarchical control policy corresponding to the new image entry request based on the image entry control permission configuration information, so as to enter the new image into the image warehouse according to the hierarchical control policy corresponding to the new image entry request.
[0070] Container application deployment requests are mainly triggered based on two situations. The first situation is that the developer builds a new image on the DevOps platform. When a new image is generated, it means that the corresponding container application needs to be deployed based on the new image in the container platform, which will trigger subsequent container application deployment requests. The second situation is that there is no new image generated at present, but due to business needs, it is necessary to expand and deploy container application copies on the container platform for existing images, which will also trigger subsequent container application deployment requests.
[0071] For the second case mentioned above, the logic of container application deployment does not depend on the logic of new image storage, that is, it can be completed based on the existing image in the image warehouse. The embodiment of the present application is mainly aimed at the first case mentioned above, that is, the situation where container application deployment needs to be triggered based on a new image.
[0072] When deploying container applications based on new images, it is necessary to first receive a new image storage request from the DevOps platform. Specifically, developers can first configure the pipeline on the DevOps platform and submit the code, and then build a new image in the Dockerfile mode. After the new image is built, a new image storage request is initiated through the DevOps platform. Furthermore, the embodiment of the present application also implements a hierarchical control strategy for the storage operation of the new image, so the image storage control authority configuration information can be obtained according to the new image storage request, and the hierarchical control strategy corresponding to the current image storage operation can be determined. The hierarchical control strategy set for the image storage operation can also be flexibly set according to the actual business scenario, and is not specifically limited here.
[0073] In some embodiments of the present application, determining the hierarchical control strategy corresponding to the new image entry request based on the control authority configuration information of the image entry includes: if the control authority configuration information of the image entry is level one control, then determining the hierarchical control strategy corresponding to the new image entry request is that the DevOps platform pipeline directly enters the new image into the warehouse; if the control authority configuration information of the image entry is level two control, then determining the hierarchical control strategy corresponding to the new image entry request is that the DevOps platform pipeline submits an entry application and after approval by the control platform, the new image is entered into the warehouse by the pipeline and monitored by the control server of the container application; if the control authority configuration information of the image entry is level three control, then determining the hierarchical control strategy corresponding to the new image entry request is that after the DevOps platform pipeline submits an entry application and after approval by the control platform, the new image is entered into the warehouse by the control platform and monitored by the control server of the container application.
[0074] The embodiment of the present application implements multi-level control measures for image storage, for example, it can be set as the following three-level control measures, which can be applicable to most business scenarios:
[0075] 1) Level 1 control: After the subtasks corresponding to the pipeline are completed, the image can be directly admitted into the warehouse, that is, the pipeline is automatically put into the warehouse, and the control server no longer needs to review and monitor.
[0076] 2) Secondary control: The subtasks corresponding to the assembly line need to be submitted for application and approved by the control server. The assembly line can be automatically put into storage and monitored by the control server in the background.
[0077] 3) Level 3 control: The subtasks corresponding to the assembly line must be submitted for application and approved by the environmental management personnel, who will then enter the warehouse and monitor them.
[0078] It should be noted that the above-mentioned secondary and tertiary controls require approval from the control server and background monitoring of the image storage status. For the approval method, if there is an online approval process or problem ticket process available, it can be directly reused. If not, it can be implemented directly through the offline approval process. For the monitoring method, it can be implemented based on existing operation and maintenance monitoring tools, and no specific restrictions are made here. In addition, if the current image storage operation is not subject to the above-mentioned hierarchical control measures, it can be directly stored after the account is activated.
[0079] In some embodiments of the present application, determining the hierarchical control strategy corresponding to the container application deployment request based on the control authority configuration information of the container application deployment includes: if the control authority configuration information of the container application deployment is level one control, then determining that the hierarchical control strategy corresponding to the container application deployment request is that the DevOps platform pipeline directly deploys the container application; if the control authority configuration information of the container application deployment is level two control, then determining that the hierarchical control strategy corresponding to the container application deployment request is that after the DevOps platform pipeline submits the deployment application and the application is approved by the control platform, the pipeline deploys the container application and is monitored by the control server of the container application; if the control authority configuration information of the container application deployment is level three control, then determining that the hierarchical control strategy corresponding to the container application deployment request is that after the DevOps platform pipeline submits the deployment application and the application is approved by the control platform, the control platform deploys the container application and is monitored by the control server of the container application.
[0080] The embodiment of the present application also implements multi-level control measures for container application deployment. For example, it can be set as the following three-level control measures, which can be applicable to most business scenarios:
[0081] 1) Level 1 control: The subtasks corresponding to the pipeline can directly upgrade the container application according to the new image, and the control server does not need to review and monitor the version status;
[0082] 2) Secondary control: The subtasks corresponding to the pipeline need to be submitted for application and approved by the control server. The pipeline triggers the upgrade of the container application, and the control server monitors the version status in the background.
[0083] 3) Level 3 control: The subtasks corresponding to the pipeline must submit an application and be approved by the control server. The control server configures the container application upgrade and monitors the version status in the background.
[0084] Similarly, it should be noted that the above-mentioned secondary and tertiary controls require approval from the control server and background monitoring of the container application deployment status. For the approval method, if there is an online approval process or problem ticket process available, it can be directly reused. If not, it can be implemented directly through the offline approval process. For the monitoring method, it can also be implemented based on existing operation and maintenance monitoring tools. In addition, if the current container application deployment operation is not subject to the above-mentioned hierarchical control measures, the application can be deployed directly after the account is activated.
[0085] Through the above embodiments, permission control management and monitoring of the container application life cycle in the test environment are implemented, including the approval of image storage permissions and the approval of container application continuous update permissions, thereby solving the problem of rapid delivery of cloud-native applications at a low cost and quickly.
[0086] In some embodiments of the present application, after receiving a container application deployment request from a DevOps platform, the method further includes: querying application information of the container application to be deployed according to the container application deployment request; determining the deployment type of the container application to be deployed according to the query result, so as to deploy the container application according to the hierarchical management and control strategy corresponding to the container application deployment request and the deployment type of the container application to be deployed, wherein the deployment type includes first deployment and update deployment.
[0087] When deploying container applications based on images, you can also query the application information of the container application to be deployed based on the container application deployment request. If the relevant application information can be queried, it means that the application has been deployed, and the container application deployment request triggered this time is a request for updating the deployment. If the relevant application information is not queried, it means that the application is being deployed for the first time.
[0088] The specific deployment logic of the first deployment and the update deployment may be different, but both can be applied to the hierarchical management and control measures adopted in the embodiments of the present application. Therefore, the container application can be deployed in combination with the hierarchical management and control strategy corresponding to the container application deployment request and the specific deployment type of the container application to be deployed.
[0089] In some embodiments of the present application, the method further includes: providing an application interface so that the DevOps platform implements corresponding interface functions by calling the application interface; the application interface includes at least one of a query interface, a deployment interface, and an update interface.
[0090] The embodiment of the present application also provides application interfaces with different functions based on the actual scene requirements, which can mainly realize functions such as container query, container deployment, and container update, which can be implemented based on the go language. Considering that the requirements for transmission security in some business scenarios are high, and compared with long connections, short connections can reduce the situation where long connections occupy resources to a certain extent, the embodiment of the present application can use http post short connections to establish communication. Of course, the communication method using long connections does not affect the solution of the technical problems of the present application. The basic format of sending a message can be parameter txt (key=value) returns json, and encryption can use algorithms such as HS256, for example. The specific encryption algorithm to be used can be flexibly selected by those skilled in the art according to actual needs, and is not specifically limited here.
[0091] Specifically, the application interface and its functions implemented in the embodiment of the present application are shown in Table 1 below:
[0092] Table 1:
[0093]
[0094] Based on the above application interface, functions such as application modification can be implemented. For example, when the application needs to be expanded or reduced, service suspended, service started, or forced restarted due to abnormal circumstances, the DevOps platform can call the modification interface. The platform can start, stop, and force restart the application by modifying the number of copies.
[0095] In order to facilitate the understanding of the above embodiments, Figure 2 As shown, a schematic diagram of the control process of a container application in an embodiment of the present application is provided. S1: The developer applies for account activation and configures the image storage on the control server; S2: The developer configures the pipeline on the DevOps platform and submits the code; S3: The developer generates the image in the Dockerfile mode on the DevOps platform and initiates a new image storage request; S4: According to the new image storage request, it is determined whether the new image is subject to hierarchical control; S5: If it is controlled, the control permission configuration information of the image storage is obtained, and the corresponding hierarchical control strategy is determined; S6: According to the hierarchical control strategy corresponding to the new image storage request, the new image storage operation is executed in the image warehouse; S7: If it is not controlled, it is directly stored.
[0096] S8: After the new image is stored in the library, the developer initiates a container application deployment request on the DevOps platform; S9: Determine whether the container application deployment is subject to hierarchical control based on the container application deployment request; S10: If it is controlled, obtain the control permission configuration information of the container application deployment and determine the corresponding hierarchical control strategy; S11: Execute the container application deployment operation on the container platform according to the hierarchical control strategy corresponding to the container application deployment; S12: If it is not controlled, directly deploy the container application.
[0097] The key points of the container application management and control method of this application are:
[0098] 1) The solution of this application can achieve continuous management of images and container applications without modifying the existing container platform;
[0099] 2) It can connect to multiple container platforms with different architectures. The number and architecture of container platforms are not limited. You only need to add and maintain the information of the container platforms that need to be connected;
[0100] 3) Image version updates can be managed and monitored at different levels;
[0101] 4) Container application version updates can be hierarchically controlled and monitored;
[0102] 5) It can ensure the consistency and accuracy of container versions in multiple environments.
[0103] In summary, the container application management and control method of the present application has achieved at least the following technical effects:
[0104] This application can solve the problem of rapid delivery of cloud-native applications at low cost and quickly. It can be based on the DevOps platform without modifying the existing container platform. Through this application, continuous management of images and container applications can be achieved, and hierarchical management and control of container images and container applications can be achieved. It can also achieve docking with multiple container platforms with different architectures, and ensure the consistency of test environment deliverables.
[0105] The present application embodiment also provides a container application management and control device 300, such as Figure 3 As shown, a schematic diagram of the structure of a control device for a container application in an embodiment of the present application is provided. The device is applied to a control server of a container application. The control server of the container application is used to connect a DevOps platform and a container platform. The device 300 includes:
[0106] The receiving unit 310 is used to receive a container application deployment request from the DevOps platform;
[0107] An acquisition unit 320 is used to acquire the management and control authority configuration information of the container application deployment according to the container application deployment request;
[0108] The first determination unit 330 is used to determine the hierarchical control policy corresponding to the container application deployment request according to the control authority configuration information of the container application deployment, so as to deploy the container application on the container platform according to the hierarchical control policy corresponding to the container application deployment request.
[0109] In some embodiments of the present application, the receiving unit 310 is also used to: before receiving the container application deployment request of the DevOps platform, receive an application request from the DevOps platform, the application request is used to apply for account activation and apply for management and control permissions, and the management and control permissions include management and control permissions for image warehousing and container application deployment; the device also includes: a configuration unit, used to determine the account activation status according to the application request and configure corresponding management and control permissions.
[0110] In some embodiments of the present application, the container application deployment request is a container application deployment request triggered by a new image, and the receiving unit 310 is also used to: receive a new image entry request from the DevOps platform before receiving the container application deployment request from the DevOps platform; the acquisition unit is also used to: obtain the image entry management and control permission configuration information according to the new image entry request; the first determination unit is also used to: determine the hierarchical management and control policy corresponding to the new image entry request according to the image entry management and control permission configuration information, so as to enter the new image into the image warehouse according to the hierarchical management and control policy corresponding to the new image entry request.
[0111] In some embodiments of the present application, the first determination unit 330 is also used for: if the control authority configuration information of the image entry is the first-level control, then determining that the hierarchical control strategy corresponding to the new image entry request is that the DevOps platform pipeline directly enters the new image into the warehouse; if the control authority configuration information of the image entry is the second-level control, then determining that the hierarchical control strategy corresponding to the new image entry request is that the DevOps platform pipeline submits the entry application and after the approval of the control platform, the new image is entered into the warehouse by the pipeline and monitored by the control server of the container application; if the control authority configuration information of the image entry is the third-level control, then determining that the hierarchical control strategy corresponding to the new image entry request is that the DevOps platform pipeline submits the entry application and after the approval of the control platform, the new image is entered into the warehouse by the control platform and monitored by the control server of the container application.
[0112] In some embodiments of the present application, the first determination unit 330 is also used for: if the control authority configuration information of the container application deployment is the first-level control, then determining that the hierarchical control strategy corresponding to the container application deployment request is the DevOps platform pipeline to directly deploy the container application; if the control authority configuration information of the container application deployment is the second-level control, then determining that the hierarchical control strategy corresponding to the container application deployment request is that after the DevOps platform pipeline submits the deployment application and the application is approved by the control platform, the pipeline will deploy the container application and be monitored by the control server of the container application; if the control authority configuration information of the container application deployment is the third-level control, then determining that the hierarchical control strategy corresponding to the container application deployment request is that after the DevOps platform pipeline submits the deployment application and the application is approved by the control platform, the control platform will deploy the container application and be monitored by the control server of the container application.
[0113] In some embodiments of the present application, the device also includes: a query unit, which is used to query application information of the container application to be deployed according to the container application deployment request after receiving the container application deployment request of the DevOps platform; a second determination unit, which is used to determine the deployment type of the container application to be deployed according to the query result, so as to deploy the container application according to the hierarchical management and control strategy corresponding to the container application deployment request and the deployment type of the container application to be deployed, and the deployment type includes the first deployment and the update deployment.
[0114] In some embodiments of the present application, the device also includes: an interface unit, used to provide an application interface so that the DevOps platform implements corresponding interface functions by calling the application interface; the application interface includes at least one of a query interface, a deployment interface and an update interface.
[0115] It can be understood that the above-mentioned control device of the container application can implement each step of the control method of the container application provided in the above-mentioned embodiment. The relevant explanations about the control method of the container application are applicable to the control device of the container application and will not be repeated here.
[0116] The present application also provides a container application management and control system. Figure 4 As shown, a schematic diagram of the architecture of a management and control system for a container application in an embodiment of the present application is provided, wherein the management and control system for the container application includes a management and control server for the container application, a DevOps platform, and at least one container platform, and the management and control server for the container application is used to execute any of the aforementioned embodiments.
[0117] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 5 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the electronic device may also include hardware required for other services.
[0118] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0119] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.
[0120] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a control device for container applications at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:
[0121] Receive container application deployment requests from the DevOps platform;
[0122] Acquire control authority configuration information of container application deployment according to the container application deployment request;
[0123] Determine the hierarchical control policy corresponding to the container application deployment request according to the control authority configuration information of the container application deployment, so as to deploy the container application on the container platform according to the hierarchical control policy corresponding to the container application deployment request.
[0124] The above application Figure 1 The method executed by the control device of the container application disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in software form. The above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in a decoding processor. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0125] The electronic device may also perform Figure 1 A method for executing a control device of a container application in a container, and realizing the control device of the container application in Figure 1 The functions of the illustrated embodiment will not be described in detail in the embodiments of the present application.
[0126] The present application also provides a computer-readable storage medium, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by an electronic device including multiple application programs, enable the electronic device to execute Figure 1 The method executed by the control device of the container application in the illustrated embodiment is specifically used to execute:
[0127] Receive container application deployment requests from the DevOps platform;
[0128] Acquire control authority configuration information of container application deployment according to the container application deployment request;
[0129] Determine the hierarchical control policy corresponding to the container application deployment request according to the control authority configuration information of the container application deployment, so as to deploy the container application on the container platform according to the hierarchical control policy corresponding to the container application deployment request.
[0130] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0131] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0132] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0133] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0134] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0135] Memory may include non-permanent storage in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0136] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0137] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0138] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0139] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A method for managing and controlling container applications, characterized in that: The method is executed by a management and control server of a container application, and the management and control server of the container application is used to connect a DevOps platform and a container platform. The method includes: Receive container application deployment requests from the DevOps platform; Acquire control authority configuration information of container application deployment according to the container application deployment request; Determine the hierarchical control policy corresponding to the container application deployment request according to the control authority configuration information of the container application deployment, so as to deploy the container application on the container platform according to the hierarchical control policy corresponding to the container application deployment request; The step of determining the hierarchical control strategy corresponding to the container application deployment request according to the control authority configuration information of the container application deployment includes: If the control authority configuration information of the container application deployment is first-level control, it is determined that the hierarchical control strategy corresponding to the container application deployment request is the pipeline of the DevOps platform to directly deploy the container application; If the control authority configuration information of the container application deployment is secondary control, it is determined that the hierarchical control strategy corresponding to the container application deployment request is that after the DevOps platform pipeline submits the deployment application and it is approved by the control platform, the container application is deployed by the pipeline and monitored by the container application control server; If the control authority configuration information of the container application deployment is three-level control, then the hierarchical control strategy corresponding to the container application deployment request is determined to be the DevOps platform's pipeline. After the deployment application is submitted and approved by the control platform, the container application is deployed by the control platform and monitored by the container application's control server.
2. The method for controlling container applications according to claim 1, characterized in that: Before receiving the container application deployment request from the DevOps platform, the method further includes: Receive an application request from the DevOps platform, where the application request is used to apply for account activation and management and control permissions, including image storage and container application deployment management and control permissions; Determine the account activation status based on the application request and configure the corresponding management and control permissions.
3. The method for controlling container applications according to claim 1, characterized in that: The container application deployment request is a container application deployment request triggered by a new image. Before receiving the container application deployment request from the DevOps platform, the method further includes: Receive new image storage requests from the DevOps platform; Obtaining image storage management and control authority configuration information according to the new image storage request; The hierarchical control policy corresponding to the new image entry request is determined according to the control authority configuration information of the image entry, so as to enter the new image into the image warehouse according to the hierarchical control policy corresponding to the new image entry request.
4. The method for controlling container applications according to claim 3, characterized in that: The step of determining the hierarchical control strategy corresponding to the new image storage request according to the image storage control authority configuration information includes: If the control authority configuration information of the image storage is level one control, it is determined that the hierarchical control strategy corresponding to the new image storage request is the DevOps platform pipeline to directly store the new image; If the control authority configuration information of the image storage is secondary control, the hierarchical control strategy corresponding to the new image storage request is determined as follows: after the pipeline of the DevOps platform submits the storage application and is approved by the control platform, the new image is stored by the pipeline and monitored by the control server of the container application; If the control authority configuration information for the image entry is level three control, then the hierarchical control strategy corresponding to the new image entry request is determined as the DevOps platform pipeline submitting the entry application and after approval by the control platform, the new image will be entered into the warehouse by the control platform and monitored by the control server of the container application.
5. The method for controlling container applications according to claim 1, characterized in that: After receiving the container application deployment request from the DevOps platform, the method further includes: Querying application information of the container application to be deployed according to the container application deployment request; The deployment type of the container application to be deployed is determined according to the query result, so as to deploy the container application according to the hierarchical management and control strategy corresponding to the container application deployment request and the deployment type of the container application to be deployed, wherein the deployment type includes first deployment and update deployment.
6. The method for controlling container applications according to any one of claims 1 to 5, characterized in that: The method further comprises: Providing an application interface so that the DevOps platform can implement corresponding interface functions by calling the application interface; The application interface includes at least one of a query interface, a deployment interface and an update interface.
7. A container application management and control device, characterized in that: The device is applied to a management and control server of a container application, and the management and control server of the container application is used to connect a DevOps platform and a container platform. The device includes: A receiving unit, used to receive a container application deployment request from a DevOps platform; An acquisition unit, configured to acquire the management and control authority configuration information of the container application deployment according to the container application deployment request; A first determining unit is used to determine the hierarchical control policy corresponding to the container application deployment request according to the control authority configuration information of the container application deployment, so as to deploy the container application on the container platform according to the hierarchical control policy corresponding to the container application deployment request; The first determining unit is further configured to: If the control authority configuration information of the container application deployment is first-level control, it is determined that the hierarchical control strategy corresponding to the container application deployment request is the pipeline of the DevOps platform to directly deploy the container application; If the control authority configuration information of the container application deployment is secondary control, it is determined that the hierarchical control strategy corresponding to the container application deployment request is that after the DevOps platform pipeline submits the deployment application and it is approved by the control platform, the container application is deployed by the pipeline and monitored by the container application control server; If the control authority configuration information of the container application deployment is three-level control, then the hierarchical control strategy corresponding to the container application deployment request is determined to be the DevOps platform's pipeline. After the deployment application is submitted and approved by the control platform, the container application is deployed by the control platform and monitored by the container application's control server.
8. A container application management and control system, characterized in that: The management and control system of the container application includes a management and control server of the container application, a DevOps platform and at least one container platform, and the management and control server of the container application is used to execute any method described in claims 1 to 6.
9. An electronic device, comprising: processor; as well as A memory arranged to store computer executable instructions, which when executed cause the processor to perform any of the methods of claims 1 to 6.
10. A computer-readable storage medium storing one or more programs, which, when executed by an electronic device including a plurality of application programs, causes the electronic device to execute any one of the methods of claims 1 to 6.
Citation Information
Patent Citations
Cloud native platform Kubernetes-based cloud native big data component management system
CN115827008A