A container startup method and device based on multi-tenant sharing
By obtaining tenant requests, determining the target container instance and creating cloud disks and virtual machines in the Serverless container engine shared by multi-tenant, the problem of unstable container startup is solved, and fast and stable container startup and expansion is achieved.
Patent Information
- Application Number
- CN202411773084.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-04-08
AI Technical Summary
In the Serverless container engine shared by multi-tenant, there are problems of resource competition and security isolation, especially when containers are started, the pulling and parsing of image files is affected by the network and image size, resulting in unstable startup and cannot meet the needs of rapid orchestration and elastic scaling.
By obtaining the tenant's container startup request, determine the target elastic container instance, and create cloud disks and virtual machines based on the pre-established snapshot information. Start the target elastic container instance through the virtual machine to realize container startup shared by multiple tenants.
This method realizes image sharing and rapid expansion by preparing local mirrors and cloud disk snapshots in advance, avoiding the network dependence and mirror pulling process during container startup, and improving startup stability and efficiency.
Smart Images

Figure CN119781902A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a container startup method and device based on multi-tenant sharing. Background Art
[0002] With the development of cloud-native technology, serverless technology has become more mature and has been fully verified in large-scale service applications.
[0003] The Serverless container engine can shield the deployment management cluster, allowing users to quickly create Kubernetes container applications without having to manage and maintain the cluster. At present, there are many ways to implement the Serverless container engine, and it has undergone multiple iterations.
[0004] One way is to orchestrate the workload in the tenant cluster, such as kube-apiserver, kube-controller-manager, etcd, and multiple tenants share meta-cluster resources, which are isolated through Kubernetes namespace. The main problem with this method is that the tenant cluster control plane components are deployed in containers, and multiple tenants share the same cluster, which leads to resource competition and security isolation issues.
[0005] To solve the security isolation problem, it is necessary to provide an independent container operating environment for each tenant. The implementation of elastic container instances solves the security isolation problem. Elastic container instances use lightweight virtual machines as container operating hosts, and each workload uses an independent lightweight virtual machine. Elastic container instance orchestration uses lightweight virtual machines as the first orchestration object to provide a clean and independent operating environment for containers. Because each workload uses an independent lightweight virtual machine, the necessary image files need to be pulled and parsed when the container is started. Affected by the network and image size, container startup is unstable. This is unacceptable for Serverless container orchestration's pursuit of fast orchestration and elastic expansion and contraction. Therefore, how to achieve multi-tenant container startup and stable startup is an urgent problem that needs to be solved. Summary of the invention
[0006] The present application shows a container startup method and device based on multi-tenant sharing.
[0007] In a first aspect, the present application provides a container startup method based on multi-tenant sharing, the method comprising:
[0008] Get the container start request sent by the tenant;
[0009] Determine a target elastic container instance corresponding to the tenant according to the pre-stored elastic container instance;
[0010] Creating a cloud disk corresponding to the target elastic container instance according to the pre-established snapshot information;
[0011] Creating a virtual machine corresponding to the target elastic container instance according to the cloud disk;
[0012] The target elastic container instance corresponding to the tenant is controlled to start through the virtual machine.
[0013] Optionally, the method further comprises:
[0014] Create a temporary elastic container instance based on the Kubernetes cluster;
[0015] Controlling the startup of the temporary elastic container instance;
[0016] According to the temporary elastic container instance, multiple cloud disk snapshots are created, and the cloud disk snapshots are stored.
[0017] Optionally, the method further comprises:
[0018] After the cloud disk snapshot is created, the temporary elastic container instance is deleted.
[0019] Optionally, the method further comprises:
[0020] Creating a cloud disk corresponding to the cloud disk snapshot according to the pre-stored local image and the pre-stored cloud disk snapshot;
[0021] The elastic container instance is expanded according to the cloud disk.
[0022] In a second aspect, the present application shows a container startup device based on multi-tenant sharing, the device comprising:
[0023] The acquisition module is used to obtain the container startup request sent by the tenant;
[0024] A determination module, configured to determine a target elastic container instance corresponding to the tenant according to pre-stored elastic container instances;
[0025] A creation module, used to create a cloud disk corresponding to the target elastic container instance according to the pre-established snapshot information;
[0026] A generation module, configured to create a virtual machine corresponding to the target elastic container instance according to the cloud disk;
[0027] A startup module is used to control the startup of a target elastic container instance corresponding to the tenant through the virtual machine.
[0028] Optionally, the startup module is used to:
[0029] Create a temporary elastic container instance based on the Kubernetes cluster;
[0030] Controlling the startup of the temporary elastic container instance;
[0031] According to the temporary elastic container instance, multiple cloud disk snapshots are created, and the cloud disk snapshots are stored.
[0032] Optionally, the startup module is used to:
[0033] After the cloud disk snapshot is created, the temporary elastic container instance is deleted.
[0034] Optionally, the startup module is used to:
[0035] Creating a cloud disk corresponding to the cloud disk snapshot according to the pre-stored local image and the pre-stored cloud disk snapshot;
[0036] The startup of the elastic container instance is expanded according to the cloud disk.
[0037] In a third aspect, the present application shows an electronic device, which includes: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the method described in any of the above aspects.
[0038] In a fourth aspect, the present application illustrates a non-temporary computer-readable storage medium, which, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute a method as described in any of the above aspects.
[0039] In a fifth aspect, the present application illustrates a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device is enabled to execute the method described in any of the above aspects.
[0040] The technical solution provided by the present application may include the following beneficial effects: the container startup method and device based on multi-tenant sharing provided in the embodiment of the present application obtain a container startup request sent by a tenant; determine the target elastic container instance corresponding to the tenant according to a pre-stored elastic container instance; create a cloud disk corresponding to the target elastic container instance according to pre-established snapshot information; create a virtual machine corresponding to the target elastic container instance according to the cloud disk; and control the startup of the target elastic container instance corresponding to the tenant through the virtual machine. The embodiment of the present application saves the local image, which is a cluster-level resource that can be shared by multiple tenants to achieve image sharing. The local image is prepared for the hot spot image in advance, and is prepared once for multi-tenant sharing. If the local image is not used, in the elastic container instance, containers of different tenants using the same image still need to pull the image again. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 This is a flowchart of the steps of a container startup method based on multi-tenant sharing in the present application.
[0042] Figure 2 This is a flowchart of the steps of another method for starting a container based on multi-tenant sharing in the present application.
[0043] Figure 3 It is a schematic diagram of a system structure diagram of the present application.
[0044] Figure 4 It is a schematic diagram of the preparation and use process of the present application.
[0045] Figure 5 This is a structural block diagram of a container startup device based on multi-tenant sharing in the present application.
[0046] Figure 6 It is a block diagram of an electronic device of the present application.
[0047] Figure 7 It is a block diagram of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are 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 creative work are within the scope of protection of this application.
[0049] Glossary:
[0050] Serverless architecture, or serverless computing architecture, allows developers to focus more on business logic without having to manage and maintain clusters. Especially in AI model training, the training platform can be quickly built based on the Serverless container engine.
[0051] Elastic container instance is a lightweight virtual machine as a container running host. After trimming, only components such as Containerd runtime and file mounting are retained. Compared with ordinary virtual machines, lightweight virtual machines have the characteristics of fast startup. Elastic container orchestration takes lightweight virtual machines as the first orchestration object. Each Pod has a clean and independent operating environment and a virtual machine life cycle.
[0052] Cloud disk is a high-availability, low-cost block storage device provided by cloud vendors. Cloud disk has the ability to take snapshots and restore specific version snapshots, and also supports the rapid creation of cloud disks using specific snapshot versions.
[0053] A local image is a container image file stored in a cloud disk and a cloud disk snapshot is created. A cloud disk is created from a cloud disk snapshot and used as a system disk for an elastic container lightweight virtual machine. The container can be started using the local image file of the virtual machine.
[0054] Custom Resources are an extension of the Kubernetes API. When configuring a custom controller, custom resources can provide a declarative API and implement custom resource management.
[0055] From the above, it can be seen that in order to solve the security isolation problem, an independent container operating environment must be provided for each tenant. The implementation of elastic container instances solves the security isolation problem. Elastic container instances use lightweight virtual machines as container running hosts, and each workload uses an independent lightweight virtual machine. Elastic container instance orchestration uses lightweight virtual machines as the first orchestration object to provide a clean and independent operating environment for containers. Because each workload uses an independent lightweight virtual machine, the necessary image files need to be pulled and parsed when the container is started. Affected by the network and image size, the container startup is unstable. This is unacceptable for Serverless container orchestration that pursues fast orchestration and elastic scaling. Therefore, this application provides a container startup method based on multi-tenant sharing to achieve multi-tenant container startup, and stable startup is an urgent problem that needs to be solved.
[0056] The following is a description of the container startup method based on multi-tenant sharing provided by this application.
[0057] Reference Figure 1 , shows a flowchart of the steps of a container startup method based on multi-tenant sharing of the present application, which can be applied to an electronic device, wherein the method can specifically include the following steps:
[0058] S101. Obtain a container startup request sent by a tenant;
[0059] S102: Determine a target elastic container instance corresponding to the tenant according to the pre-stored elastic container instances;
[0060] S103: Create a cloud disk corresponding to the target elastic container instance according to the pre-established snapshot information;
[0061] S104. Create a virtual machine corresponding to the target elastic container instance according to the cloud disk;
[0062] S105: Control the start of a target elastic container instance corresponding to the tenant through the virtual machine.
[0063] For large images, downloading takes a long time, and the stability of pulling the image is affected by network bandwidth, and multiple tenants pulling the same image at the same time indirectly causes bandwidth waste. The present invention includes three parts: local image preparation, multi-tenant shared use, and support for rapid capacity expansion.
[0064] The elastic container uses Kubernetes Custom Resource to customize resource definitions, with CRD as ElatiContainer, and deploys Elatic-Container-Controller to orchestrate the elastic container.
[0065] The elastic container orchestration of multiple tenants is isolated through Kubernetes namespace. The elastic container instances of each tenant are recorded in an independent namespace. The purpose is to prepare local images in advance and share them among multiple tenants. The local images are used to start elastic container instances without pulling and decompressing images. The containers can be started in seconds and support rapid expansion.
[0066] The container startup method based on multi-tenant sharing provided in the embodiment of the present application obtains a container startup request sent by a tenant; determines a target elastic container instance corresponding to the tenant according to a pre-stored elastic container instance; creates a cloud disk corresponding to the target elastic container instance according to pre-established snapshot information; creates a virtual machine corresponding to the target elastic container instance according to the cloud disk; and controls the startup of the target elastic container instance corresponding to the tenant through the virtual machine. The embodiment of the present application saves local images, which are cluster-level resources that can be shared by multiple tenants to achieve image sharing. Local images are prepared for hot spots in advance, and are prepared once for multi-tenant sharing. If local images are not used, in the elastic container instance, containers of different tenants using the same image still need to pull the image again.
[0067] Another embodiment of the present application further supplements the container startup method based on multi-tenant sharing provided in the above embodiment.
[0068] like Figure 2 As shown, the method also includes:
[0069] Create a temporary elastic container instance based on the Kubernetes cluster;
[0070] Controlling the startup of the temporary elastic container instance;
[0071] According to the temporary elastic container instance, multiple cloud disk snapshots are created, and the cloud disk snapshots are stored.
[0072] The method further comprises:
[0073] After the cloud disk snapshot is created, the temporary elastic container instance is deleted.
[0074] The method further comprises:
[0075] Creating a cloud disk corresponding to the cloud disk snapshot according to the pre-stored local image and the pre-stored cloud disk snapshot;
[0076] The elastic container instance is expanded according to the cloud disk.
[0077] The following is a detailed description of the container startup method based on multi-tenant sharing of the present application in conjunction with a specific example. It should be noted that the embodiment of the present application includes three parts: local image preparation, multi-tenant sharing and support for rapid expansion.
[0078] Specifically, the elastic container uses Kubernetes Custom Resource to customize resource definitions, with CRD as ElatiContainer, and deploys Elatic-Container-Controller to orchestrate the elastic container.
[0079] Multi-tenant elastic container orchestration is isolated through Kubernetes namespace, and the elastic container instances of each tenant are recorded in an independent namespace.
[0080] (1) Local image preparation:
[0081] The local image is defined using Kubernetes Custom Resource, with CRD as LocalImage, and LocalImage-Controller is deployed to manage the image cache lifecycle. The multi-tenant shared image cache is recorded in the cluster and shared within the cluster.
[0082] The local image CRD is defined as follows:
[0083]
[0084]
[0085]
[0086]
[0087] (II) Preparation process:
[0088] 1. Load LocalImage CustomResourceDefine in the Kubernetes cluster and deploy the LocalImage-Controller stateless workload;
[0089] 2. LocalImage-Controller monitors the creation of new LocalImage CR and starts local image preparation;
[0090] 3. LocalImage-Controller uses the LocalImage configured by CR to start a temporary elastic container instance pod and wait for the container to start;
[0091] 4. After all containers of the elastic container instance are running, create a cloud disk snapshot for the lightweight VM system disk of the elastic container instance and record the cloud disk snapshot ID in the LocalImage CR;
[0092] 5. Delete the temporary elastic container instance pod to release resources such as lightweight virtual machines and system disks;
[0093] 6. Change the CR status, status.phase to Ready, and add the image-ref tag for filtering and querying, marking the local image as available;
[0094] (III) Multi-tenant shared use process:
[0095] 1. When Elatic-Container-Controller orchestrates elastic containers, it uses the image-ref tag to filter the LocalImage CR query image matching local images in the cluster;
[0096] 2. If a Ready local image exists, modify the LocalImage CR and add an Annotation to mark the elastic container instance to use the local image;
[0097] 3. After LocalImage-Controller monitors that the local image is marked, it uses the cloud disk snapshot ID recorded in the local image to create a new cloud disk and record it in the LocalImage CR;
[0098] 4. After waiting for the cloud disk to be created, Elatic-Container-Controller uses the cloud disk as the system disk to create a lightweight virtual machine and start the elastic container instance. The container uses the lightweight virtual machine local image file to start the container;
[0099] (IV) Supporting rapid capacity expansion:
[0100] 1. For the ready and commonly used local images, LocalImage-Controller prepares multiple cloud disks created by snapshots in advance and records them in CR
[0101] 2. Elatic-Container-Controller orchestrates elastic container instances. When matching available local images, if there is a local image cloud disk that has been prepared in advance, it directly uses the pre-prepared cloud disk as the system disk to create a lightweight virtual machine, reducing the time spent waiting for the cloud disk to be created.
[0102] like Figure 3 and Figure 4 As shown, the container startup method based on multi-tenant sharing provided in the embodiment of the present application includes:
[0103] 1. Prepare 5 hosts with 16GiB memory and 8-core CPU, and deploy a highly available (3 Master nodes) Kubernetes cluster;
[0104] 2. Prepare an OpenStack cluster that can create virtual machines or use a cloud host service provided by a cloud vendor that supports API calls;
[0105] 3. Each node deploys the kubelet node agent and container runtime Containerd container manager components;
[0106] 4. Create ElatiContainer CRD and deploy Elatic-Container-Controller in the cluster to orchestrate elastic container instances;
[0107] 5. Create LocalImage CRD and deploy LocalImage-Controller in the cluster to orchestrate local images;
[0108] 6. Create a LocalImage CR named demo, wait for the local image to be prepared, and confirm whether the elastic container instance is deleted;
[0109] 7. Use the same image to create an ElatiContainer CR named demo and wait for the elastic container instance to be created by orchestration;
[0110] 8. Use kubectl describe localimage demo to confirm whether the Image CR is matched by the tag;
[0111] 9. Use kubectl describe elaticontainer demo to confirm whether the elastic container instance uses the cloud disk created by the local image as the system disk;
[0112] The image in the embodiment of the present application is transferred through a cloud disk, and a new local image is quickly created through a snapshot, saving the network bandwidth consumption of pulling the image. Compared with pulling through the image warehouse, it avoids the impact of network fluctuations. By preparing in advance, local deployment can be achieved. The local image is a cluster-level resource that can be shared by multiple tenants to achieve image sharing. Prepare local images for hot images in advance, and prepare them for multi-tenant sharing at one time. If the local image is not used, in the elastic container instance, containers using the same image for different tenants still need to re-pull the image. When Containerd is running in the elastic container instance, the local image file can be directly used, eliminating the time-consuming and computing-intensive operations of pulling and parsing the image, and the container can be started in seconds. By preparing the local image in advance and creating multiple cloud disks in advance through cloud disk snapshots, the pre-created cloud disk can be used as the system disk to quickly start the elastic container instance during rapid expansion.
[0113] The implementation of the Serverless container engine enables users to quickly build a Kubernetes cluster, and based on elastic containers, orchestrate independent virtual machines as container hosts to build secure container applications. Because each Pod is built on an independent elastic container instance, that is, an independent and clean virtual machine, an image needs to be pulled. The following problems exist when deploying applications through the Serverless platform to orchestrate elastic containers:
[0114] 1. For large images, downloading takes a long time, and the stability of pulling images is affected by network bandwidth and other factors.
[0115] 2. Pulling the same image at the same time by multiple tenants indirectly causes bandwidth waste.
[0116] 3. Because each elastic container instance needs to pull, parse and load the image file when it is started, it is impossible to achieve rapid expansion.
[0117] The embodiment of the present application prepares a local image in advance and shares it among multiple tenants, and uses the local image to start an elastic container instance without pulling or decompressing the image, thereby enabling container startup in seconds and supporting rapid capacity expansion.
[0118] It should be noted that each implementable method in this embodiment may be implemented separately, or may be implemented in combination in any combination without conflict, and this application is not limited thereto.
[0119] The container startup method based on multi-tenant sharing provided in the embodiment of the present application obtains a container startup request sent by a tenant; determines a target elastic container instance corresponding to the tenant according to a pre-stored elastic container instance; creates a cloud disk corresponding to the target elastic container instance according to pre-established snapshot information; creates a virtual machine corresponding to the target elastic container instance according to the cloud disk; and controls the startup of the target elastic container instance corresponding to the tenant through the virtual machine. The embodiment of the present application saves local images, which are cluster-level resources that can be shared by multiple tenants to achieve image sharing. Local images are prepared for hot spots in advance, and are prepared once for multi-tenant sharing. If local images are not used, in the elastic container instance, containers of different tenants using the same image still need to pull the image again.
[0120] Another embodiment of the present application provides a container startup device based on multi-tenant sharing, which is used to execute the container startup method based on multi-tenant sharing provided in the above embodiment.
[0121] The following is a description of the container startup device based on multi-tenant sharing provided by the present application.
[0122] like Figure 5 , which is a schematic diagram of the structure of a container startup device based on multi-tenant sharing provided in an embodiment of the present application. The container startup device based on multi-tenant sharing includes an acquisition module 501, a determination module 502, a creation module 503, a generation module 504 and a startup module 505, wherein:
[0123] The acquisition module 501 is used to acquire the container startup request sent by the tenant;
[0124] The determination module 502 is used to determine a target elastic container instance corresponding to the tenant according to pre-stored elastic container instances;
[0125] The creation module 503 is used to create a cloud disk corresponding to the target elastic container instance according to the pre-established snapshot information;
[0126] The generation module 504 is used to create a virtual machine corresponding to the target elastic container instance according to the cloud disk;
[0127] The startup module 505 is used to control the startup of the target elastic container instance corresponding to the tenant through the virtual machine.
[0128] Regarding the device in this embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0129] The container startup method and device based on multi-tenant sharing provided in the embodiment of the present application obtain a container startup request sent by a tenant; determine the target elastic container instance corresponding to the tenant according to a pre-stored elastic container instance; create a cloud disk corresponding to the target elastic container instance according to pre-established snapshot information; create a virtual machine corresponding to the target elastic container instance according to the cloud disk; and control the startup of the target elastic container instance corresponding to the tenant through the virtual machine. The embodiment of the present application saves the local image, which is a cluster-level resource that can be shared by multiple tenants to achieve image sharing. The local image is prepared for the hot spot image in advance, and is prepared once for multi-tenant sharing. If the local image is not used, in the elastic container instance, containers of different tenants using the same image still need to pull the image again.
[0130] Another embodiment of the present application further supplements the container startup device based on multi-tenant sharing provided in the above embodiment.
[0131] The startup module is used to:
[0132] Create a temporary elastic container instance based on the Kubernetes cluster;
[0133] Controlling the startup of the temporary elastic container instance;
[0134] According to the temporary elastic container instance, multiple cloud disk snapshots are created, and the cloud disk snapshots are stored.
[0135] The startup module is used to:
[0136] After the cloud disk snapshot is created, the temporary elastic container instance is deleted.
[0137] The startup module is used to:
[0138] Creating a cloud disk corresponding to the cloud disk snapshot according to the pre-stored local image and the pre-stored cloud disk snapshot;
[0139] The startup of the elastic container instance is expanded according to the cloud disk.
[0140] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0141] The container startup method and device based on multi-tenant sharing provided in the embodiment of the present application obtain a container startup request sent by a tenant; determine the target elastic container instance corresponding to the tenant according to a pre-stored elastic container instance; create a cloud disk corresponding to the target elastic container instance according to pre-established snapshot information; create a virtual machine corresponding to the target elastic container instance according to the cloud disk; and control the startup of the target elastic container instance corresponding to the tenant through the virtual machine. The embodiment of the present application saves the local image, which is a cluster-level resource that can be shared by multiple tenants to achieve image sharing. The local image is prepared for the hot spot image in advance, and is prepared once for multi-tenant sharing. If the local image is not used, in the elastic container instance, containers of different tenants using the same image still need to pull the image again.
[0142] Optionally, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0143] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0144] In addition, the present application also provides a cloud hard disk. When the cloud hard disk program is executed by the processor, the various processes of the above-mentioned method embodiment are implemented; the cloud hard disk provides high-performance, high-reliability, rich-specification and elastically scalable block storage services for computing services such as elastic cloud hosts ECS and physical machines DPS. The cloud hard disk supports multiple configuration specifications and can be mounted to the cloud host as a data disk and system disk; when the cloud hard disk space is insufficient, the user can expand the capacity of the cloud hard disk, that is, expand the capacity of the cloud hard disk.
[0145] There are two ways to expand the capacity of a cloud disk:
[0146] Apply for a new cloud hard disk and mount it to the cloud host.
[0147] Expand the original cloud hard disk space. Both system disks and data disks support expansion.
[0148] Figure 6800 is a block diagram of an electronic device 800 shown in the present application. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0149] Reference Figure 6 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0150] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0151] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, images, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0152] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.
[0153] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0154] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0155] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0156] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0157] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast operation information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0158] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0159] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of an electronic device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0160] Figure 7 19 is a block diagram of a computer-readable storage medium 1900 shown in the present application. For example, the computer-readable storage medium 1900 may be provided as a server.
[0161] Reference Figure 7 , the computer-readable storage medium 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions, such as an application, that can be executed by the processing component 1922. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.
[0162] The computer readable storage medium 1900 may also include a power supply component 1926 configured to perform power management of the computer readable storage medium 1900, a wired or wireless network interface 1950 configured to connect the computer readable storage medium 1900 to a network, and an input / output (I / O) interface 1958. The computer readable storage medium 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.
[0163] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0164] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0165] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
[0166] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0167] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0168] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0169] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0170] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0171] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0172] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A container startup method based on multi-tenant sharing, characterized in that: The method comprises: Get the container start request sent by the tenant; Determine a target elastic container instance corresponding to the tenant according to the pre-stored elastic container instance; Creating a cloud disk corresponding to the target elastic container instance according to the pre-established snapshot information; Creating a virtual machine corresponding to the target elastic container instance according to the cloud disk; The target elastic container instance corresponding to the tenant is controlled to start through the virtual machine.
2. The container startup method based on multi-tenant sharing according to claim 1 is characterized in that: The method further comprises: Create a temporary elastic container instance based on the Kubernetes cluster; Controlling the startup of the temporary elastic container instance; According to the temporary elastic container instance, multiple cloud disk snapshots are created, and the cloud disk snapshots are stored.
3. The container startup method based on multi-tenant sharing according to claim 2 is characterized in that: The method further comprises: After the cloud disk snapshot is created, the temporary elastic container instance is deleted.
4. The container startup method based on multi-tenant sharing according to claim 1 is characterized in that: The method further comprises: Creating a cloud disk corresponding to the cloud disk snapshot according to the pre-stored local image and the pre-stored cloud disk snapshot; The elastic container instance is expanded according to the cloud disk.
5. A container startup device based on multi-tenant sharing, characterized in that: The device comprises: The acquisition module is used to obtain the container startup request sent by the tenant; A determination module, configured to determine a target elastic container instance corresponding to the tenant according to pre-stored elastic container instances; A creation module, used to create a cloud disk corresponding to the target elastic container instance according to the pre-established snapshot information; A generation module, configured to create a virtual machine corresponding to the target elastic container instance according to the cloud disk; A startup module is used to control the startup of a target elastic container instance corresponding to the tenant through the virtual machine.
6. The container startup device based on multi-tenant sharing according to claim 5 is characterized in that: The startup module is used to: Create a temporary elastic container instance based on the Kubernetes cluster; Controlling the startup of the temporary elastic container instance; According to the temporary elastic container instance, multiple cloud disk snapshots are created, and the cloud disk snapshots are stored.
7. The container startup device based on multi-tenant sharing according to claim 6 is characterized in that: The startup module is used to: After the cloud disk snapshot is created, the temporary elastic container instance is deleted.
8. The container startup device based on multi-tenant sharing according to claim 5 is characterized in that: The startup module is used to: Creating a cloud disk corresponding to the cloud disk snapshot according to the pre-stored local image and the pre-stored cloud disk snapshot; The startup of the elastic container instance is expanded according to the cloud disk.
9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the method according to any one of claims 1 to 4 when executed by the processor.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.