A method and device for creating a public cloud container instance
By installing the container instance management component in an independent management virtual machine in a public cloud platform and using proxy components to create container instances, the problem of resource occupation and security vulnerabilities is solved, and resource utilization and security is improved.
Patent Information
- Application Number
- CN202111463335.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-02
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2041-12-02
AI Technical Summary
In a public cloud platform, container instance management components occupy virtual machine resources, resulting in a decrease in available resources, and there are security vulnerabilities that affect the security of computing nodes.
Install the container instance management component in a separate management virtual machine, instead of a container virtual machine, and create container instance creation and management by creating request proxy components and container production proxy components, and build security boundaries using the isolation function of the virtual machine.
Effectively utilize virtual machine resources, avoiding the preemption of resources by container instance management components, and improving the security of computing nodes, preventing security vulnerabilities of open source components from affecting the host.
Smart Images

Figure CN114385310B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of computer application technology, and in particular, to a method and device for creating a public cloud container instance. Background Art
[0002] Container technology is an operating system layer virtualization technology. It can be used to virtualize multiple independent and non-interfering containers on a physical host. Each container provides an independent application running environment for the application running in the container. With the development of cloud computing services, some cloud platforms that provide cloud computing services provide container services in public cloud scenarios. Users can create and use container instances on the cloud platform.
[0003] The container instance creation process requires the participation of container instance management components, such as kublet and containerd. The container instance management component is responsible for producing containers after receiving container production instructions. In addition, the container instance management component is also responsible for maintaining the environment when the container is running.
[0004] Container instances on cloud platforms are generally created in virtual machines. In some cases, container instance management components occupy virtual machine resources within the container instance, reducing available resources for the container instance. Summary of the invention
[0005] In view of this, one or more embodiments of the present specification provide a method and apparatus for creating a public cloud container instance.
[0006] According to a first aspect of one or more embodiments of the present specification, a method for creating a public cloud container instance is proposed, which is applied to a computing node, the computing node is used to carry a container instance, and the computing node is configured with a management virtual machine and a container virtual machine; the computing node is also configured with the following components: a container instance management component, a container production agent component, and a creation request agent component; wherein the container instance management component is configured in the management virtual machine;
[0007] The method comprises:
[0008] The creation request proxy component sends a container instance creation instruction to the container instance management component that manages the virtual machine according to the received container instance creation request;
[0009] The container instance management component receives the container instance creation instruction and sends the production instruction to the container production agent component through the management virtual machine;
[0010] The container production agent component triggers the startup of the container virtual machine according to the production instruction, and calls the container production agent component in the container virtual machine to produce a container in the container virtual machine to create a container instance.
[0011] According to a second aspect of one or more embodiments of the present specification, a computing node is provided, wherein the computing node is used to carry a container instance; the computing node is used to carry a container instance, and the computing node is configured with a management virtual machine and a container virtual machine; the computing node is also configured with the following components: a container instance management component, a container production agent component, and a creation request agent component; wherein the container instance management component is configured in the management virtual machine;
[0012] Each component in the computing node executes the following method to create a public cloud container instance:
[0013] The creation request proxy component sends a container instance creation instruction to the container instance management component that manages the virtual machine according to the received container instance creation request;
[0014] The container instance management component receives the container instance creation instruction and sends the production instruction to the container production agent component through the management virtual machine;
[0015] The container production agent component triggers the startup of the container virtual machine according to the production instruction, and calls the container production agent component in the container virtual machine to produce a container in the container virtual machine to create a container instance.
[0016] According to a third aspect of the embodiments of this specification, a computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, the above-mentioned public cloud container instance creation method is implemented.
[0017] According to a fourth aspect of the embodiments of this specification, a computer program is provided, which implements the above-mentioned method for creating a public cloud container instance when the computer program is executed.
[0018] According to a fifth aspect of one or more embodiments of the present specification, a container service system is provided, the container service system comprising at least a management virtual machine and a container virtual machine; the container service system is further configured with the following components: a container instance management component, a container production agent component, and a creation request agent component; wherein the container instance management component is configured in the management virtual machine;
[0019] Each part of the container service system executes the following method to create a public cloud container instance:
[0020] The creation request proxy component sends a container instance creation instruction to the container instance management component that manages the virtual machine according to the received container instance creation request;
[0021] The container instance management component receives the container instance creation instruction and sends the production instruction to the container production agent component through the management virtual machine;
[0022] The container production agent component triggers the startup of the container virtual machine according to the production instruction, and calls the container production agent component in the container virtual machine to produce a container in the container virtual machine to create a container instance.
[0023] In one or more embodiments of the present specification, a method for creating a public cloud container instance is provided. The method is applied to a computing node. The container instance and the container instance management component on the computing node are respectively configured in a container virtual machine and a management virtual machine. The computing node also has a container production agent component and a creation request agent component. The creation process of the container instance includes: the creation request agent component sends a container instance creation instruction to the management virtual machine according to the received container instance creation request, so that the container instance management component in the management virtual machine receives the container instance creation instruction; the container instance management component receives the container instance creation instruction, and sends a production instruction to the container production agent component through the management virtual machine; the container production agent component triggers the startup of the container virtual machine according to the production instruction, and calls the container production agent component in the container virtual machine to produce a container in the container virtual machine to create a container instance. By not installing the container instance management component in the container virtual machine, the resources in the container virtual machine will not be preempted by the container instance management component. In addition, the container instance management component is installed in a management virtual machine independent of the container virtual machine. Through the isolation function of the virtual machine, the container instance management component will not affect the security of the host machine (i.e., the computing node) after being attacked, and a security boundary is built through the management virtual machine.
[0024] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present specification. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the specification and, together with the description, serve to explain the principles of the specification.
[0026] Figure 1 It is a structural diagram of a computing node shown in this specification according to an embodiment.
[0027] Figure 2 It is a schematic diagram of the structure of another computing node shown in this specification according to an embodiment.
[0028] Figure 3 The present specification is a flowchart of a method for creating a public cloud container instance according to an exemplary embodiment.
[0029] Figure 4 It is a structural diagram of another computing node shown in this specification according to an embodiment.
[0030] Figure 5It is a structural diagram of a computing node shown in this specification according to a specific embodiment.
[0031] Figure 6 It is a hardware structure diagram of a computing node shown in this specification according to an exemplary embodiment. DETAILED DESCRIPTION
[0032] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0033] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0034] Public cloud generally refers to a cloud platform that provides cloud computing services to users on the Internet. Cloud platforms provide users with a variety of cloud computing services, such as container services. By using container services, cloud platform users can create and use container instances on the cloud platform.
[0035] For container instances created through container services in public cloud scenarios, since public clouds provide container services to multiple users and multiple container instances are created on a computing node (node), there may be container instances of different users on a computing node, which requires isolation measures to prevent different container instances from affecting each other. A common method is to create container instances in virtual machines, each of which only carries one container instance, and virtual machines have isolation functions, so different container instances are isolated through different virtual machines.
[0036] For container instances, a container instance is a pod, and a pod includes multiple containers. The production of containers generally requires the participation of container instance management components. Container instance management components generally include components such as kublet that are responsible for managing running pods, and container runtimes such as containerd. However, since container instance management components generally cannot control the startup of virtual machines, when creating a container instance, you need to start a virtual machine to host the container instance first. Therefore, in order to complete the startup of the virtual machine and then complete the process of creating a container instance, the container instance management component is generally also installed inside the virtual machine.
[0037] The billing rules for container instances are generally based on the size of resources used by the container instance, that is, based on the size of available resources of the virtual machine where the container instance is located. Before creating a container instance, users need to purchase available resources of a fixed specification as available resources for the container instance. The available resources of each virtual machine are limited, and the container instance management component running in the virtual machine will preempt the virtual machine resources, making the available resources of each container instance less. This creates the need to install the container instance management component outside the virtual machine (on the host machine).
[0038] In the related art, the reason why the container instance management component cannot be installed outside the virtual machine is that the container instance management component cannot control the startup of the virtual machine. With the development of the technology, a lightweight virtual machine developed specifically for containers has emerged in the related art, such as runV, which can be started by the container instance component (this virtual machine is hereinafter referred to as a container virtual machine). Based on the container virtual machine, the container can be produced normally without installing the container instance management component in the container virtual machine. The use of the container virtual machine will ensure that the available resources of the container virtual machine will not be squeezed.
[0039] In this case (the container instance management component is not installed in the container virtual machine, but installed on the host machine), a multi-tenant architecture is implemented, that is, a container instance management component manages all container instances on the computing node. In this case, the process of creating a container instance is generally that the control server of the container service forwards the container instance creation request to the creation request proxy component on a computing node after receiving the container instance creation request from the user. After receiving the container instance creation request, the creation request proxy component sends the container instance creation instruction to the container instance management component. The container instance management component controls the startup of the container virtual machine and creates the container instance in the started container virtual machine.
[0040] Furthermore, considering that container instance management components are generally open source components, if these open source components themselves are unreliable, they will be vulnerable to attacks, which will affect the security of the entire computing node. Considering that container instance management components generally have some security vulnerabilities, such as kublet has some open ports, and these open ports may leak sensitive information, and attackers may attack through this sensitive information. If the open source components are directly installed in the computing node without any protective measures, the computing node will be threatened by the security vulnerabilities of the open source components (that is, the attack is easy to spread to the host machine).
[0041] In order to solve the above problem, considering that the virtual machine has the isolation function, the container instance management component can be installed in a separate virtual machine (in order to distinguish the separate virtual machine from the container virtual machine, the virtual machine is called the management virtual machine). Figure 1 In the structure shown in the figure, the container instance management component and the container instance are in different virtual machines. Figure 1 Only three container virtual machines are shown, which does not mean that there will only be three container virtual machines in a computing node (one container virtual machine corresponds to one container instance).
[0042] exist Figure 1 In this structure, since the container instance is placed in the management virtual machine and cannot directly communicate with other components on the computing node, a problem arises: how does the container instance management component in the virtual machine communicate with other components?
[0043] First, for the communication between the container instance component and the creation request proxy component, considering that the host machine and the management virtual machine where the container instance component is located are two logical devices, they can communicate in a device-to-device manner, such as through a communication protocol. Taking the IP protocol as an example, the host machine and the management virtual machine can generally set an IP address, so different LAN IP addresses can be set for the management virtual machine and the computing node (host machine) respectively, so that the two can communicate through the IP protocol.
[0044] Secondly, for the container instance management component and the container virtual machine, considering that the container virtual machine is generally a lightweight virtual machine, it is impossible to set an IP address and communicate through the IP protocol or other communication protocols; and before the container virtual machine is started, the container virtual machine does not exist and it is impossible to communicate through the communication protocol. Considering that a component that can forward container instance management instructions can be set in the computing node to forward the instructions of the container instance management component (this component is hereinafter referred to as the container production agent component). This solves the communication problem of the container instance management component.
[0045] Based on the above analysis, this specification provides a method for creating a public cloud container instance, which is applied to a computing node. The container instance and the container instance management component on the computing node are respectively configured in the container virtual machine and the management virtual machine, and the computing node also has a container production agent component and a creation request agent component. The creation process of the container instance includes: the creation request agent component sends a container instance creation instruction to the management virtual machine according to the received container instance creation request, so that the container instance management component in the management virtual machine receives the container instance creation instruction; the container instance management component receives the container instance creation instruction, and sends a production instruction to the container production agent component through the management virtual machine; the container production agent component triggers the startup of the container virtual machine according to the production instruction, and calls the container production agent component in the container virtual machine to produce a container in the container virtual machine to create a container instance. By not installing the container instance management component in the container virtual machine, the resources in the container virtual machine will not be preempted by the container instance management component. In addition, the container instance management component is installed in the management virtual machine independent of the container virtual machine. Through the isolation function of the virtual machine, the container instance management component will not affect the security of the host machine (i.e., the computing node) after being attacked, and a security boundary is built through the management virtual machine. At the same time, by installing the container instance management component in the management virtual machine, the original structure of one container instance management component corresponding to one container instance is broken, and a multi-tenant structure is realized, that is, a container instance management component manages the structure that provides services for all container instances on the computing node.
[0046] Next, a method for creating a public cloud container instance provided in this specification will be described in detail.
[0047] First of all, it should be noted that the public cloud container instance creation method provided in this specification is applied to computing nodes. The computing node is used to carry container instances, and the computing node is configured with a management virtual machine and a container virtual machine; the computing node is also configured with the following components: a container instance management component, a container production agent component and a creation request agent component; wherein the container instance management component is configured in the management virtual machine. The container instance and the container instance management component are respectively configured in different virtual machines, and the container production agent component is used for communication between the container virtual machine and the management virtual machine, and the creation request agent component is used to proxy the control server to send container instance creation instructions to the container instance management component. An overall structure of the above-mentioned computing node is as follows Figure 2 As shown, it should be noted that although Figure 2 Two container virtual machines are shown in the figure, but this does not limit the number of container instances that can be hosted by the computing node in this specification.
[0048] The computing node is a server used to host container instances in the cloud platform. It is a node for producing containers in the entire system. Correspondingly, the management and control server is equivalent to the master node, which is responsible for managing multiple computing nodes, receiving and processing requests sent by users, etc.
[0049] After the overall description of the structure of the computing node used in the public cloud container instance creation method, the specific steps of the public cloud container instance creation method will be described in detail. Figure 3 As shown, the public cloud container instance creation method provided in this specification includes the following steps:
[0050] Step 301: The creation request proxy component sends a container instance creation instruction to a container instance management component that manages a virtual machine according to a received container instance creation request.
[0051] First, the terms appearing in step 301 are explained. In some cases, the creation request proxy component is connected to the management and control server of the container service to receive the container instance creation request. Of course, the creation request proxy component can also directly connect to the user device to directly receive the container instance creation request sent by the user device.
[0052] As for the difference between the container instance creation request and the container instance creation instruction, in some cases, the container instance creation request cannot be directly parsed by the container instance management component, and the creation request proxy component is responsible for converting the container instance creation request into a container instance creation instruction that can be parsed by the container instance management component, and sending the container instance creation instruction to the management virtual machine. In addition, if the container instance creation request can be parsed by the container instance management component, the creation request proxy component can forward the container instance creation request directly to the management virtual machine. In this case, the contents of the container instance creation instruction and the container instance creation request in step 301 are the same.
[0053] Among them, for the contents of the container instance creation request and the container instance creation instruction, both include the user ID, the container instance creation configuration (such as the sandbox configuration corresponding to the container virtual machine, the CPU and memory size, etc.). In some cases, the creation request proxy component will obtain the network card and disk of the container virtual machine according to the container instance creation instruction (so that the container virtual machine has network communication and storage functions). In this case, the container instance creation instruction will have more than the container instance creation request: the content used to mark the obtained network card and disk, so that the container instance management component can find the obtained network card and disk, and start the container virtual machine based on the obtained network card and disk.
[0054] In addition, it is necessary to explain a problem solved in step 301, that is, how the creation request proxy component and the container instance management component communicate. The creation request proxy component and the container instance management component are not in the same logical device, and the creation request proxy component cannot communicate directly with the container instance management component. Therefore, if the creation request proxy component wants to send a message to the container instance management component, it needs to send it through the management virtual machine where the container instance management component is located, that is, through the method of interaction between logical devices, so that the container instance management component in the management virtual machine can communicate with the creation request proxy component in the host machine.
[0055] The specific communication method may be, for example, communication through a specific communication protocol. For example, communication is performed through the IP protocol, that is, the management virtual machine and the host machine (computing node) are pre-configured with different LAN IP addresses, and then communicate by sending messages. Specifically, the management virtual machine and the computing node are pre-configured with IP addresses; step 301 specifically includes: the creation request proxy component sends a container instance creation instruction to the management virtual machine through the transmission method of the IP protocol according to the received container instance creation request.
[0056] Through the above method, the communication between the creation request proxy component and the container instance management component in two different logical devices is realized.
[0057] Step 303: The container instance management component receives the container instance creation instruction and sends a production instruction to the container production agent component through the management virtual machine.
[0058] In step 305, the container production agent component triggers the startup of the container virtual machine according to the production instruction, and calls the container production agent component in the container virtual machine to produce a container in the container virtual machine to create a container instance.
[0059] Next, step 303 and step 305 will be described collectively.
[0060] First, the specific terms appearing in step 303 and step 305 are explained. Among them, the production instruction is used to control the startup of the container virtual machine and enable the container production agent component in the container virtual machine to produce the container. The production instruction includes the sandbox configuration required for the startup of the container virtual machine, as well as resource configuration (such as CPU and memory size, etc.).
[0061] The container production proxy component refers to a component that can produce containers according to production instructions. If the container instance management component and the container instance are in the same logical device, the container instance management component can directly produce containers, so the container production proxy component is not needed. However, since the container instance and the container instance management component are not in the same logical device, the container instance management component cannot control the production of containers in the container virtual machine, so the container production proxy component is needed to help produce containers. Since the container production proxy component only acts as an agent for the process of producing containers, compared with the container instance management component with more functions, the container production proxy component occupies fewer resources (memory and CPU), allowing the container instance to use more resources in the container virtual machine.
[0062] In addition, it is necessary to explain the problems solved by step 303 and step 305. The problem solved by step 303 is how to enable the container instance management component in the management virtual machine to control the startup of the container virtual machine, and how to enable the container instance management component in the management virtual machine to complete subsequent communication with the container instance.
[0063] First, with regard to the startup of the container virtual machine, as mentioned above, since the container virtual machine cannot communicate with it through the communication protocol before it is started, it is necessary to use the container production agent component to forward the production instructions of the container instance management component in the management virtual machine, so as to control the quick startup of the container virtual machine through the snapshot function.
[0064] As for the method of forwarding production instructions by the container production agent component, the container instance management component may send the production instructions through the predetermined port of the management virtual machine, and the container production agent component is responsible for listening to the predetermined port, thereby receiving the production instructions sent by the container instance management component in the management virtual machine. In other words, the container instance management component receives the container instance creation instruction, and sends the production instruction to the container production agent component through the management virtual machine, including: the container instance management component receives the container instance creation instruction, and sends the production instruction through the predetermined port of the management virtual machine; the container production agent component receives the production instruction issued by the predetermined port of the management virtual machine according to the predetermined port of the management virtual machine. Of course, it can also be implemented through other communication methods between virtual machines and host components, and this specification does not limit it here.
[0065] Second, for the communication between the container instance management component and the container instance. After the container virtual machine is started, if the container virtual machine can set an IP address, communication can be carried out through the IP protocol. However, in some cases, since the container virtual machine is a lightweight virtual machine developed specifically for containers, the container virtual machine generally cannot set an IP address. In this case, communication can be carried out through other communication methods.
[0066] For example, the message sent by the container instance management component can be forwarded by a container production agent component or other components. Specifically, when the container virtual machine is started, a domain socket (unix domainsocket) is exposed in the host machine. The container production agent component sends the production instruction to the container virtual machine through the socket, so that the container production agent component in the container virtual machine can receive the production instruction. In other words, calling the container production agent component in the container virtual machine to produce a container in the container virtual machine includes: the container production agent component forwards the production instruction to the container virtual machine by means of domain socket communication, so as to call the container production agent component in the container virtual machine to produce a container in the container virtual machine.
[0067] In addition, the management virtual machine and the container virtual machine can also communicate by means of vsock. The management virtual machine is pre-set with a vsock identifier; the method also includes: the container instance management component calls the resource allocation component to allocate a vsock identifier to the started container virtual machine; the calling of the container production agent component in the container virtual machine to produce a container in the container virtual machine includes: the container instance management component calls the container production agent component in the container virtual machine through vsock to produce a container in the container virtual machine.
[0068] In other words, the management VM and the container VM are configured with vsock identifiers, so that the two can communicate with each other. In addition, in addition to the need for the container VM to communicate with the management VM during container production, after container production is completed, the container instance management component in the management VM can still send messages to the operation and maintenance agent component in the container VM through vsock, thereby enabling the container instance management component to manage the container instance.
[0069] After describing steps 301 to 305, it is also necessary to explain the method for obtaining the network card and disk of the computing node and the container virtual machine.
[0070] For computing nodes, some computing nodes include two layers, namely the resource management layer and the software layer. The resource management layer is used to manage the hardware resources of the computing node, and the software layer is used to process the container instance creation logic. In this case, the distribution of various components in the computing node is as follows: Figure 4 As shown, it should be noted that although Figure 2 Two container virtual machines are shown in the figure, but this does not limit the number of container instances that can be carried by the computing node in this specification. The creation request agent component is located at the resource management layer, and the container instance management component, the container virtual machine, the management virtual machine and the container production agent component are located at the software layer. In addition, if there is a resource allocation component, the resource allocation component is also located at the software layer.
[0071] When applied to the above computing node, if the creation request agent component and the container instance management component communicate through the IP protocol, in this case, the resource management layer and the software layer of the computing node belong to two logical devices, then the resource management layer and the software layer have their own IP addresses.
[0072] As for the method of obtaining the network card and disk of the container virtual machine, since the computing nodes often do not have the ability to communicate with the external network and do not have enough storage space, the network card and disk of the container virtual machine need to be implemented through other cloud services. For example, a network card is provided for the container virtual machine through a private network (Virtual Private Cloud, VPC), and a disk is provided for the container virtual machine through a cloud storage service. The cloud storage service can be any service that can provide cloud storage space, and this manual does not limit it here.
[0073] Specifically, the above method also includes: creating a request proxy component to accept the call of the control server, controlling the network card acquisition component and the cloud storage acquisition component to obtain the network card and cloud storage space from the VPC server and the cloud storage server respectively; during the startup process of the container virtual machine, the network card and cloud storage space obtained by the creation request proxy component are used as the network card and storage of the container virtual machine. Among them, the control network card acquisition component and the cloud storage acquisition component to obtain the network card and cloud storage space can also be other components of the resource management layer, which is not limited in this specification.
[0074] In addition, when the method is applied to computing nodes including two layers, the process of obtaining network cards and disks is specifically as follows: create a request proxy component to accept the call of the management and control server, and control the network card acquisition component and the cloud storage acquisition component to obtain network cards and cloud storage space from the VPC server and the cloud storage server respectively. Since the network card acquisition component and the cloud storage acquisition component are components of the resource management layer, the obtained network cards and cloud storage space cannot be directly used by the software layer, and the creation request proxy component needs to map the obtained network cards and cloud storage to the software layer in the form of files.
[0075] Through the above method, while ensuring that the container instance can use more virtual machine resources, a security boundary is also built for the container instance management component, so that even if the open source component is attacked, the security of the host machine (computing node) will not be threatened.
[0076] Next, the cloud platform container instance creation method described in this specification will be explained through a specific embodiment.
[0077] like Figure 5 As shown, Figure 5 The structure of the computing node in the specific embodiment and the communication relationship between other devices involved in the method and the computing node are shown. It should be noted that although Figure 5 Only one container virtual machine is shown, but this does not limit the number of container instances that can be hosted by a computing node in this specification. Some components in the figure are components explained in the previous text, and the functions of these components will not be repeated.
[0078] The following will explain the components that have not been explained in the previous article. The network card storage preparation component is responsible for receiving calls from the management and control server, calling the network card acquisition component and the cloud storage acquisition component to obtain the network card and disk. The device simulation component is responsible for producing the iohub instance so that the iohub instance maps the acquired network card and disk to the software layer in the form of a bdf file. The data forwarding component and the container production agent component have similar functions. Both serve as a bridge for communication between the management virtual machine and the container virtual machine. The difference between the two is that the container production agent component is responsible for forwarding control instructions, and the data forwarding component is responsible for forwarding information at the data level. The two are separated to decouple the control plane and the data plane to prevent problems on one side from affecting the other. The container production agent component is mainly used to transmit instructions, and the data forwarding component is mainly used to transmit logs and information such as the current status of the container instance.
[0079] In addition to the components shown in the figure, the container instance agent component inside the management virtual machine consists of two parts, namely kublet and container runtime containerd. The container virtual machine also includes a translation component responsible for translating instructions into commands that can be executed by the container production component in the container virtual machine. The translation component and the container production component work together to produce containers.
[0080] In the right Figure 5 After explaining the meaning of each term, the production process of the container instance will be described in detail.
[0081] First, after the user device submits a container instance creation request to the control server, the control server calls the network card storage preparation component, and then the network card storage preparation component calls the network card acquisition component and the cloud storage acquisition component to obtain the network card and disk from the VPC server and the cloud storage server respectively. The control server calls the creation request proxy component, so that the creation request proxy component calls the device simulation component to produce the iohub instance on the resource management layer, so that the iohub instance maps the obtained network card and disk to the software layer in the form of bdf files. After receiving the container instance creation request, the creation request proxy component sends a container instance creation instruction to the management virtual machine through the IP protocol. After receiving the container instance creation instruction, the kublet in the management virtual machine will send the sandbox configuration to the container runtime. The container runtime will send the production instruction through the predetermined port of the management virtual machine. After receiving the production instruction, the container production proxy component that monitors the predetermined port of the management virtual machine controls the container virtual machine to start, and then calls the container production component to produce the container in the container virtual machine. In addition, kublet will call the resource allocation component to assign a vsock identifier to each container virtual machine, so that the started container virtual machine can communicate with the management virtual machine through the vsock identifier.
[0082] In addition, the network card of the management virtual machine is simulated through the device simulation of the resource management layer, and the network card of the resource management layer is directly connected to the software layer. For the disk of the management virtual machine, its system disk uses the directly prepared qcow2 file to simulate the cloud disk through the iohub instance and directly connects to the software layer. The purpose of this is that since the system disk is managed by the resource management layer, the software layer cannot use it directly and needs to map it to the software layer so that the software layer can use it. Therefore, the management virtual machine on the software layer side can use the corresponding system disk through mapping.
[0083] This completes the creation of the public cloud container instance.
[0084] Corresponding to the embodiment of the aforementioned method, the present specification also provides a computing node, which is used to carry a container instance; the computing node is configured with a management virtual machine and a container virtual machine; the computing node is also configured with the following components: a container instance management component, a container production agent component and a creation request agent component; wherein the container instance management component is configured in the management virtual machine.
[0085] Each component in the computing node executes the following method to create a public cloud container instance:
[0086] The creation request proxy component sends a container instance creation instruction to the container instance management component that manages the virtual machine according to the received container instance creation request.
[0087] The container instance management component receives the container instance creation instruction and sends the production instruction to the container production agent component through the management virtual machine.
[0088] The container production agent component triggers the startup of the container virtual machine according to the production instruction, and calls the container production agent component in the container virtual machine to produce a container in the container virtual machine to create a container instance.
[0089] In addition, in addition to being configured in a computing node, the above-mentioned virtual machines and components can also be completed by components of multiple machines (for example, the above-mentioned process is completed by components on a computing node and an expansion card inserted in the computing node). Specifically, this specification also provides a container service system, which includes at least a management virtual machine and a container virtual machine; the container service system is also configured with the following components: a container instance management component, a container production agent component, and a creation request agent component; wherein the container instance management component is configured in the management virtual machine.
[0090] Each part of the container service system executes the following method to create a public cloud container instance:
[0091] The creation request proxy component sends a container instance creation instruction to the container instance management component that manages the virtual machine according to the received container instance creation request.
[0092] The container instance management component receives the container instance creation instruction and sends the production instruction to the container production agent component through the management virtual machine.
[0093] The container production agent component triggers the startup of the container virtual machine according to the production instruction, and calls the container production agent component in the container virtual machine to produce a container in the container virtual machine to create a container instance.
[0094] The implementation process of the functions and roles of each component in the above computing node or container service system is specifically described in the implementation process of the corresponding steps in the above method, which will not be repeated here.
[0095] like Figure 6 As shown, Figure 6 A hardware structure diagram of the computing node is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.
[0096] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0097] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0098] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0099] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0100] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0101] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0102] The embodiments of this specification also provide a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned method for creating a public cloud container instance is implemented.
[0103] 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.
[0104] In addition, this specification also provides a computer program, which implements the above-mentioned public cloud container instance creation method when executed.
[0105] 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.
[0106] The above is a description of a specific embodiment of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Claims
1. A method for creating a public cloud container instance, applied to a computing node, the computing node is used to carry a container instance, the computing node is configured with a management virtual machine and a container virtual machine; the computing node is also configured with the following components: a container instance management component, a container production agent component and a creation request agent component; wherein, The container instance management component is configured in the management virtual machine; The method comprises: The creation request proxy component sends a container instance creation instruction to the container instance management component that manages the virtual machine according to the received container instance creation request; The container instance management component receives the container instance creation instruction and sends the production instruction to the container production agent component through the management virtual machine; The container production agent component triggers the startup of the container virtual machine according to the production instruction, and calls the container production agent component in the container virtual machine to produce a container in the container virtual machine to create a container instance.
2. According to the method of claim 1, the management virtual machine and the computing node are pre-configured with IP addresses; The creation request proxy component sends a container instance creation instruction to a container instance management component that manages a virtual machine according to the received container instance creation request, including: The creation request proxy component sends a container instance creation instruction to the container instance management component that manages the virtual machine through an IP protocol transmission mode according to the received container instance creation request.
3. The method according to claim 1, wherein the container instance management component receives a container instance creation instruction and sends a production instruction to the container production agent component through a management virtual machine, comprising: The container instance management component receives the container instance creation instruction and sends the production instruction through the predetermined port of the management virtual machine; The container production agent component receives the production instruction issued by the predetermined port of the management virtual machine according to the monitoring predetermined port of the management virtual machine.
4. According to the method of claim 1, the step of calling a container production agent component in a container virtual machine to produce a container in the container virtual machine comprises: The container production agent component forwards the production instruction to the container virtual machine through domain socket communication, so as to call the container production agent component in the container virtual machine to produce the container in the container virtual machine.
5. According to the method of claim 1, the management virtual machine is pre-set with a vsock identifier; The method further comprises: The container instance management component calls the resource allocation component to allocate a vsock identifier for the started container virtual machine; The calling of the container production agent component in the container virtual machine to produce a container in the container virtual machine includes: The container instance management component calls the container production agent component in the container virtual machine through vsock to produce containers in the container virtual machine.
6. The method according to claim 1, wherein the computing node comprises a resource management layer and a software layer, wherein: The resource management layer is used to manage the hardware resources of the computing nodes, and the software layer is used to process the container instance creation logic; the creation request agent component is located in the resource management layer, and the container instance management component, the container virtual machine, the management virtual machine and the container production agent component are located in the software layer.
7. The method according to claim 1, further comprising: Create a request proxy component to accept calls from the management and control server, and control the network card acquisition component and cloud storage acquisition component to obtain network cards and cloud storage space from the private network VPC server and cloud storage server respectively; During the startup process of the container virtual machine, the network card and cloud storage space obtained by the creation request proxy component will be used as the network card and storage of the container virtual machine.
8. A computing node, the computing node is used to carry a container instance; the computing node is used to carry a container instance, the computing node is configured with a management virtual machine and a container virtual machine; the computing node is also configured with the following components: a container instance management component, a container production agent component and a creation request agent component; wherein, The container instance management component is configured in the management virtual machine; Each component in the computing node executes the following method to create a public cloud container instance: The creation request proxy component sends a container instance creation instruction to the container instance management component that manages the virtual machine according to the received container instance creation request; The container instance management component receives the container instance creation instruction and sends the production instruction to the container production agent component through the management virtual machine; The container production agent component triggers the startup of the container virtual machine according to the production instruction, and calls the container production agent component in the container virtual machine to produce a container in the container virtual machine to create a container instance.
9. A container service system, the container service system at least comprising a management virtual machine and a container virtual machine; the container service system is also configured with the following components: a container instance management component, a container production proxy component and a creation request proxy component; wherein, The container instance management component is configured in the management virtual machine; Each part of the container service system executes the following method to create a public cloud container instance: The creation request proxy component sends a container instance creation instruction to the container instance management component that manages the virtual machine according to the received container instance creation request; The container instance management component receives the container instance creation instruction and sends the production instruction to the container production agent component through the management virtual machine; The container production agent component triggers the startup of the container virtual machine according to the production instruction, and calls the container production agent component in the container virtual machine to produce a container in the container virtual machine to create a container instance.
10. A computer-readable storage medium, wherein computer instructions are stored on the computer-readable storage medium, and when the computer instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.
11. A computer program product, wherein when the computer program product is executed, the method according to any one of claims 1 to 7 is implemented.
