Container group creation method and device, electronic equipment and storage medium

CN115469961BActive Publication Date: 2026-10-13BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110567560.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-24
Publication Date
2026-10-13
Estimated Expiration
2041-05-24

AI Technical Summary

Technical Problem

[0005]本申请提供了一种容器组的创建方法和装置、电子设备和存储介质,以至少解决相关技术中的使用弹性网卡的容器网络实现方式存在由于能够提供的IP个数有限导致的允许部署的业务数量少的问题

Benefits of technology

[0022]在本申请实施例中,采用仅为有需求的容器组分配弹性网卡的方式,通过在目标云主机上创建目标容器组,其中,目标云主机上部署有属于目标容器集群中的节点,目标容器集群使用的网络插件包括与基于弹性网卡的第一容器网络对应的第一网络插件;在确定出目标容器组为使用弹性网卡所提供的网络接口的容器组的情况下,为目标容器组申请第一网络插件的弹性网卡;在为目标容器组申请到目标弹性网卡的情况下,将目标弹性网卡绑定给目标容器组,由于在创建容器组(例如,Pod)时仅为有需求的容器组分配弹性网卡,从而可以实现使用有限的IP个数创建更多的容器组的目的,达到了提高容器网络中允许创建的容器组的技术效果,进而解决了相关技术中的使用弹性网卡的容器网络实现方式存在由于能够提供的IP个数有限导致的允许部署的业务数量少的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115469961B_ABST
    Figure CN115469961B_ABST
Patent Text Reader

Abstract

The application provides a container group creation method and device, an electronic device and a storage medium, wherein the method comprises: creating a target container group on a target cloud host, wherein the target cloud host is deployed with nodes belonging to a target container cluster, and a network plugin used by the target container cluster comprises a first network plugin corresponding to a first container network based on a flexible network card; in a case where it is determined that the target container group is a container group using a network interface provided by a flexible network card, applying a flexible network card of the first network plugin to the target container group; and in a case where the target flexible network card is applied to the target container group, binding the target flexible network card to the target container group. Through the application, the problem that the number of services allowed to be deployed is small due to the limited number of IPs that can be provided in the related art container network implementation using a flexible network card is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet technology, and in particular to a method and apparatus for creating container groups, electronic devices, and storage media. Background Technology

[0002] Kubernetes (K8s), an open-source system for automatically deploying, scaling, and managing containerized applications, supports various network implementations, such as Flannel, Calico, and Canal. Within K8s, each network container implementation works as a plugin, with CNI (Container Network Interface) providing a unified standard interface for these plugins. The network IPs (Internet Protocol) provided by these network container implementations for Pods (the smallest / simplest basic unit created or deployed in K8s; a Pod represents a process running on the cluster) are cluster-wide, and the number of IPs is unlimited.

[0003] The above network implementation scheme has the following problems: Pod communication performance is somewhat degraded due to the use of bridge technology; the load balancer cannot directly access Pods and needs to forward traffic through nodes in the Kubernetes cluster, thus reducing access performance; furthermore, the cloud host network and the Pod network are not on the same network layer, and their communication relies on VPC routing, increasing communication complexity. To solve these problems, some cloud vendors have proposed container networks based on VPC elastic network interfaces (ENIs) or ENI auxiliary IP technology, that is, assigning the IP address or auxiliary IP address of the ENI to the container. This container network implementation scheme is also based on the CNI interface, and this type of network plugin can be simply referred to as VPC-CNI. Currently, cloud vendors provide independent VPC-CNI network plugins for users. However, this container network implementation scheme has the following problems: the number of IP addresses that can be provided is limited, which cannot meet the IP requirements of Pods in the Kubernetes cluster, thus limiting the number of services that users can deploy.

[0004] Therefore, it can be seen that the container networking implementation in related technologies has a limitation on the number of Pods that can be deployed on each cloud host, which is limited by the maximum number of IPs that the node can bind to the elastic network interface card that it can insert. Summary of the Invention

[0005] This application provides a method and apparatus for creating container groups, an electronic device, and a storage medium to at least solve the problem in related technologies where container network implementations using elastic network interface cards (NICs) have a limited number of IP addresses, resulting in a small number of services that can be deployed.

[0006] According to one aspect of the embodiments of this application, a method for creating a container group is provided, comprising: creating a target container group on a target cloud host, wherein the target cloud host deploys nodes belonging to a target container cluster, and the network plugin used by the target container cluster includes a first network plugin corresponding to a first container network based on an elastic network interface card (ENCIC); if it is determined that the target container group is a container group using a network interface provided by an ENCIC, applying for an ENCIC for the target container group using the first ENCIC; and if a target ENCIC is obtained for the target container group, binding the target ENCIC to the target container group.

[0007] Optionally, after creating the target container group on the target cloud host, the method further includes: obtaining a first target identifier corresponding to the target container group, wherein the first target identifier is used to indicate the network type used by the target container group; and determining that the target container group and the target cloud host are located in the same network namespace based on the first target identifier, determining that the target container group is a container group using the network interface of the target cloud host.

[0008] Optionally, the network plugin used by the target container cluster only uses the first network plugin; after obtaining the first target identifier corresponding to the target container group, the method further includes: if it is determined from the first target identifier that the target container group and the target cloud host are located in different network namespaces, determining that the target container group is a container group using the network interface provided by the elastic network interface card.

[0009] Optionally, the network plugin used by the target container cluster includes the first network plugin and the second network plugin, wherein the second network plugin is a network plugin corresponding to a second container network that is not based on an elastic network interface card (NIC); after obtaining the first target identifier corresponding to the target container group, the method further includes: if it is determined from the first target identifier that the target container group and the target cloud host are located in different network namespaces, configuring the target container group to which it belongs; if the target container network is the first container network, determining that the target container group is a container group using the network interface provided by the elastic network interface card (NIC).

[0010] Optionally, after configuring the target container network to which the target container group belongs, the method further includes: if the target container network is the second container network, obtaining a second target identifier corresponding to the target container group, wherein the second target identifier is used to indicate whether the target container group uses an elastic network interface card; if it is determined from the second target identifier that the target container group uses an elastic network interface card, determining that the target container group is a container group using the network interface provided by the elastic network interface card.

[0011] Optionally, before creating the target container group on the target cloud host, the method further includes: determining a target network mode corresponding to the target container cluster to be created, wherein the target network mode is a network mode in which the first network plugin and the second network plugin coexist; and creating the target container cluster according to the target network mode, wherein the target container cluster allows the use of the first network plugin and the second network plugin.

[0012] Optionally, applying for the elastic network interface card (NIC) of the first network plugin for the target container group includes: sending a target request message to a target server program, wherein the target server program is the server program of the first network plugin, and the target request message is used to request the application for the elastic NIC or the secondary IP address of the elastic NIC; and receiving a target response message returned by the target server program, wherein the target response message is used to indicate the application result of the elastic NIC or the secondary IP address of the elastic NIC.

[0013] According to another aspect of the embodiments of this application, a container group creation apparatus is also provided, comprising: a first creation unit, configured to create a target container group on a target cloud host, wherein the target cloud host deploys nodes belonging to a target container cluster, and the network plugin used by the target container cluster includes a first network plugin corresponding to a first container network based on an elastic network interface card (NIC); an application unit, configured to apply for an elastic network interface card (NIC) for the target container group when it is determined that the target container group is a container group using a network interface provided by an elastic NIC; and a binding unit, configured to bind the target elastic NIC to the target container group when a target elastic NIC is applied for for the target container group.

[0014] Optionally, the apparatus further includes: a first acquisition unit, configured to acquire a first target identifier corresponding to the target container group after the target container group is created on the target cloud host, wherein the first target identifier is used to indicate the network type used by the target container group; and a first determination unit, configured to determine that the target container group is a container group using the network interface of the target cloud host when it is determined from the first target identifier that the target container group and the target cloud host are located in the same network namespace.

[0015] Optionally, the network plugin used by the target container cluster uses only the first network plugin; the device further includes: a second determining unit, configured to, after obtaining the first target identifier corresponding to the target container group, determine that the target container group and the target cloud host are located in different network namespaces based on the first target identifier, that the target container group is a container group using the network interface provided by the elastic network interface card.

[0016] Optionally, the network plugin used by the target container cluster includes the first network plugin and the second network plugin, wherein the second network plugin is a network plugin corresponding to a second container network that is not based on an elastic network interface card (NIC); the device further includes: a configuration unit, configured to configure the target container network to which the target container group belongs after obtaining the first target identifier corresponding to the target container group and determining, based on the first target identifier, that the target container group and the target cloud host are located in different network namespaces; and a third determination unit, configured to determine, when the target container network is the first container network, that the target container group is a container group using the network interface provided by the elastic network interface card (NIC).

[0017] Optionally, the apparatus further includes: a second acquisition unit, configured to acquire a second target identifier corresponding to the target container group when the target container network is the second container network after configuring the target container group to belong to the target container network, wherein the second target identifier is used to indicate whether the target container group uses an elastic network interface card; and a fourth determination unit, configured to determine that the target container group is a container group using a network interface provided by an elastic network interface card when it is determined from the second target identifier that the target container group uses an elastic network interface card.

[0018] Optionally, the apparatus further includes: a fifth determining unit, configured to select a target network mode corresponding to the target container cluster to be created before creating the target container group on the target cloud host, wherein the target network mode is a network mode in which the first network plugin and the second network plugin coexist; and a second creating unit, configured to create the target container cluster according to the target network mode, wherein the target container cluster allows the use of the first network plugin and the second network plugin.

[0019] Optionally, the application unit includes: a sending module, configured to send a target request message to a target server program, wherein the target server program is the server program of the first network plugin, and the target request message is used to request an elastic network interface card (ENCIC) or an auxiliary IP address for the ENCIC; and a receiving module, configured to receive a target response message returned by the target server program, wherein the target response message is used to indicate the application result of the ENCIC or the auxiliary IP address for the ENCIC.

[0020] According to another aspect of the embodiments of this application, an electronic device is also provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; wherein the memory is used to store a computer program; and the processor is used to execute the method steps of any of the above embodiments by running the computer program stored in the memory.

[0021] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to execute the method steps of any of the above embodiments when running.

[0022] In this embodiment, an elastic network interface card (NIC) is allocated only to container groups that require it. This is achieved by creating a target container group on a target cloud host, where nodes belonging to the target container cluster are deployed. The network plugin used by the target container cluster includes a first network plugin corresponding to a first container network based on the elastic NIC. When it is determined that the target container group uses the network interface provided by the elastic NIC, an elastic NIC for the first network plugin is requested for the target container group. Once the target elastic NIC is obtained for the target container group, it is bound to the target container group. Because elastic NICs are allocated only to container groups that require them when creating a container group (e.g., a Pod), the goal of creating more container groups using a limited number of IPs can be achieved. This increases the number of container groups that can be created in the container network, thus solving the problem in related technologies where the limited number of available IPs results in a small number of services that can be deployed. Attached Figure Description

[0023] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0024] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 This is a schematic diagram of the hardware environment for an optional method of creating a container group according to an embodiment of this application;

[0026] Figure 2 This is a flowchart illustrating an optional method for creating a container group according to an embodiment of this application;

[0027] Figure 3 This is a flowchart illustrating another optional method for creating a container group according to an embodiment of this application;

[0028] Figure 4 This is a schematic diagram of an optional method for creating a container group according to an embodiment of this application;

[0029] Figure 5 This is a flowchart illustrating another optional method for creating a container group according to an embodiment of this application;

[0030] Figure 6 This is a schematic diagram of another optional method for creating a container group according to an embodiment of this application;

[0031] Figure 7 This is a structural block diagram of an optional container group creation apparatus according to an embodiment of this application;

[0032] Figure 8 This is a structural block diagram of an optional electronic device according to an embodiment of this application. Detailed Implementation

[0033] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0034] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0035] According to one aspect of the embodiments of this application, a method for creating a container group is provided. Optionally, in this embodiment, the above-described method for creating a container group can be applied to, for example... Figure 1 The hardware environment shown consists of terminal 102 and server 104. For example... Figure 1 As shown, server 104 is connected to terminal 102 via a network and can be used to provide services (e.g., cloud services, etc.) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 104.

[0036] The aforementioned network may include, but is not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. Terminal 102 may not be limited to PC, mobile phone, tablet computer, etc.

[0037] The container group creation method of this application embodiment can be executed by server 104, terminal 102, or jointly by server 104 and terminal 102. Alternatively, the container group creation method of this application embodiment can be executed by a client installed on terminal 102.

[0038] Taking the container group creation method in this embodiment as an example, which is executed by server 104, Figure 2 This is a flowchart illustrating an optional method for creating a container group according to an embodiment of this application, as shown below. Figure 2 As shown, the process of this method may include the following steps:

[0039] Step S202: Create a target container group on the target cloud host, wherein the target cloud host deploys nodes belonging to the target container cluster, and the network plugin used by the target container cluster includes a first network plugin corresponding to the first container network based on the elastic network interface card.

[0040] The container group creation method in this embodiment can be applied to scenarios where container groups are created within a container cluster. The container cluster can be a Kubernetes (K8s) cluster or other similar clusters. The container group can be an atomic scheduling unit within the container cluster, that is, the smallest unit of scheduling in the container cluster (the smallest basic unit of creation or deployment). Each container group is equivalent to a logical host and has its own IP address. Each container group can contain one or more containers, and containers within the same container group share the same IP address and port space. The container group can be a Pod in K8s or a scheduling unit in other container clusters. This embodiment uses the creation of a Pod in a K8s cluster as an example for illustration.

[0041] Optionally, the target container cluster may contain at least one master node and at least one worker node, and each node (master node or worker node) may be deployed on a cloud host (an example of server 104 mentioned above). The container group creation method in this embodiment may be executed by the target master node of the target container cluster (or the cloud host where the target master node is located), or by the target master node and the target worker node (or the target cloud host where the target worker node is located) together. This embodiment will be described using the target master node as an example.

[0042] The network plugin used by the target container cluster may include a first network plugin (e.g., a standalone VPC-CNI network plugin used by a Kubernetes cluster), which corresponds to a first container network based on an elastic network interface card (ENV). This first container network can be a container network implemented based on VPC ENV or ENV-assisted IP technology; correspondingly, the first network plugin can be the VPC-CNI network plugin. Optionally, the network plugin used by the target container cluster may also include other network plugins, such as network plugins corresponding to other container networks besides the first container network (e.g., Flannel, Calico, Canal, etc.), which are not limited in this embodiment.

[0043] Based on the creation request of the target object (an object that uses the target container cluster or has control over the target container cluster) or based on other control information, the target master node can perform the creation of the target container group (e.g., the target Pod) on the target cloud host, which can be used to deploy nodes belonging to the target container cluster (e.g., master node, worker node).

[0044] Step S204: If it is determined that the target container group is a container group that uses the network interface provided by the elastic network card, apply for the elastic network card of the first network plug-in for the target container group.

[0045] In related technologies, if a container cluster uses a container plugin based on an elastic network interface card (NIC), then when a Pod is created, it will be directly bound to the elastic NIC. As a result, the number of Pods that can be created on each cloud host is limited by the maximum number of IPs that the node can bind to the elastic NIC.

[0046] Based on the attributes of Pods, a large number of Pods do not actually need to use elastic network interfaces because they do not have the need to communicate with other cloud hosts or Kubernetes clusters within the VPC (e.g., system management components provided by the cluster). Therefore, it is unnecessary to assign this type of IP address to these Pods.

[0047] Optionally, in this embodiment, when configuring the network for a target container group, it can first be determined whether the target container group is a container group using the network interface provided by the elastic network interface card (NIC), that is, whether it is a container group that needs to be bound to the elastic NIC (or, whether it is a container group using the IP address corresponding to the elastic NIC). If the target container group is a container group using the network interface provided by the elastic NIC, then an elastic NIC for the first network plugin can be requested for the target container group (or, an IP address corresponding to the elastic NIC of the first network plugin can be requested).

[0048] Step S206: If a target elastic network interface card (NIC) is obtained for the target container group, bind the target elastic NIC to the target container group.

[0049] The quota for each elastic network interface card (ENI) on a target cloud host is limited. If the quota for an ENI is sufficient, a target ENI can be requested for the target container group, and the target master node can bind the target ENI to the target container group. Furthermore, the target cloud host can configure necessary routing information (e.g., target routing information) for the target container group, thereby completing the network configuration for the target container group.

[0050] If the elastic network interface card (ELIC) quota is insufficient, the creation of the target container group will fail. If an ELIC has not been allocated for the target container group, a target indication message can be generated to indicate that the creation of the target container group failed due to insufficient ELIC quota. The target master node can send the target indication message to the target terminal device to indicate that the target container group creation failed.

[0051] Through steps S202 to S206 above, a target container group is created on the target cloud host. The target cloud host deploys nodes belonging to the target container cluster. The network plugin used by the target container cluster includes a first network plugin corresponding to the first container network based on an elastic network interface card (NIC). If it is determined that the target container group is a container group using a network interface provided by an elastic NIC, an elastic NIC for the first network plugin is applied for for the target container group. If a target elastic NIC is obtained for the target container group, it is bound to the target container group. This solves the problem in related technologies where the container network implementation using elastic NICs has a limited number of IP addresses, resulting in a small number of services that can be deployed. It also increases the number of container groups that can be created in a container network.

[0052] As an optional embodiment, the elastic network interface card (NIC) for requesting the first network plug-in for the target container group includes:

[0053] S11, Send a target request message to the target server program, wherein the target server program is the server program of the first network plugin, and the target request message is used to request the application for an elastic network interface card or an auxiliary IP address of the elastic network interface card;

[0054] S12, receive the target response message returned by the target server program, wherein the target response message is used to indicate the application result of the elastic network interface card or the secondary IP address of the elastic network interface card.

[0055] The server program for the first network plugin is the target server program. When applying for an elastic network interface card (NIC) for the first network plugin for the target container group, the target master node can request the NIC or an auxiliary IP address from the target server program. For example, it can send a target request message to the target server program, which is used to request the NIC or an auxiliary IP address.

[0056] In response to the target request message, if the elastic network interface card (NIC) has sufficient quota, the target server program can allocate the NIC or its secondary IP address. If the NIC's quota is insufficient, the target server program may not allocate the NIC or its secondary IP address. The target server program can return a target response message to the target master node, which can receive this response message. This target response message indicates the result of the NIC or its secondary IP address request.

[0057] Correspondingly, binding the target elastic network interface to the target container group can be done by binding the obtained elastic network interface or the secondary IP of the elastic network interface to the target container group.

[0058] It should be noted that the target server program can run on the target cloud host (or the target server program can also run on the target master node), while the application for the elastic network interface card or the secondary IP address of the elastic network interface card can be made by the target thread on the target cloud host. The application for the elastic network interface card or the secondary IP address of the elastic network interface card can be completed through the interaction between the target thread and the target server program.

[0059] This embodiment improves the flexibility of elastic network interface card (NIC) binding by allocating IP addresses to container groups through applying for elastic NICs or auxiliary IP addresses for elastic NICs.

[0060] As an optional embodiment, after creating the target container group on the target cloud host, the above method further includes:

[0061] S21, obtain the first target identifier corresponding to the target container group, wherein the first target identifier is used to indicate the network type used by the target container group;

[0062] S22, if it is determined from the first target identifier that the target container group and the target cloud host are located in the same network namespace, the target container group is determined to be a container group that uses the network interface of the target cloud host.

[0063] After the target container group is created, the target cloud host can obtain a first target identifier corresponding to the target container group, which is used to indicate the network type used by the target container group.

[0064] If the target container group indicated by the first target identifier uses a HostNetwork network (i.e., a host machine network), and the target container group and the target cloud host are located in the same network namespace, it can be determined that the target container group uses the network interface of the target cloud host, and there is no need to bind it to an elastic network interface card. In this case, the network configuration for the target container group can be performed using the IP address of the target cloud host, etc.

[0065] For example, when creating a Pod, if the Pod's network type is HostNetwork, and the Pod and the host machine are in the same network namespace, there is no need to bind an elastic network interface card to it, and the network configuration process can be completed.

[0066] This embodiment determines whether an elastic network interface card (NIC) needs to be bound to the target container group based on the fact that the target container group and the target cloud host are located in the same network namespace. This can eliminate some container groups that do not need to use elastic NICs, thus achieving effective utilization of elastic NICs.

[0067] As an optional implementation, the target container cluster uses only the first network plugin. The network mode configured for the target container cluster can be a network mode using only the first network plugin. For example, when creating the container cluster, the VPC-CNI network mode can be selected, and the cluster creation can be completed successfully.

[0068] Optionally, in this embodiment, after obtaining the first target identifier corresponding to the target container group, the above method further includes:

[0069] S31, if it is determined from the first target identifier that the target container group and the target cloud host are located in different network namespaces, the target container group is determined to be a container group using the network interface provided by the elastic network card.

[0070] If the target container group indicated by the first target identifier uses a network type other than HostNetwork, and the target container group and the target cloud host are located in different network namespaces, then the target container group can be determined to be a container group using the network interface provided by an elastic network interface card (NIC). In this case, an elastic NIC can be requested for the target container group.

[0071] For example, for all Pods that are not of the HostNetwork type, you can request an Elastic Network Interface (ENI) or an auxiliary IP address for the ENI.

[0072] This embodiment improves the ease of configuring container group networks by applying for elastic network interface cards (NICs) for all non-HostNetwork type container groups.

[0073] The method for creating container groups in this application embodiment is explained below with reference to optional examples. In this example, the target container cluster is a K8s cluster, the target container group is a Pod in the K8s cluster, the first network plugin is a VPC-CNI network plugin, and the first target identifier is an identifier of type HostNetwork.

[0074] To effectively utilize the VPC-CNI network plugin when the number of IPs that an elastic network interface can bind to is limited, this example provides a container group creation method that allows the VPC-CNI network plugin to not coexist with other network plugins in VPC-CNI network mode. For example... Figure 3 As shown, the process of creating a container group in this optional example may include the following steps:

[0075] Step S302: Create a K8s cluster and select the VPC-CNI network plugin.

[0076] When creating a K8s cluster, select the VPC-CNI network mode. In VPC-CNI network mode, the VPC-CNI network plugin does not coexist with other network plugins. Wait for the K8s cluster to be created successfully.

[0077] Step S304: Create a Pod.

[0078] After a K8s cluster is successfully created, Pods can be created for that K8s cluster.

[0079] Step S306: Determine whether the Pod is using the host network. If not, proceed to step S308; if yes, proceed to step S316.

[0080] Based on the Pod's network type, determine whether the Pod uses the host network. If the Pod's network type is HostNetwork, there is no need to bind an elastic network interface to the Pod; the network configuration process ends, and step S316 is executed. If the Pod's network type is not HostNetwork, step S308 is executed.

[0081] Step S308: Apply for a flexible network interface card (NIC).

[0082] If it is determined that the Pod needs to use an Elastic Network Interface (ENI), you can request an ENI or an auxiliary IP address from the VPC-CNI server program.

[0083] Step S310: Determine whether the elastic network card application was successful. If not, proceed to step S312; if yes, proceed to step S314.

[0084] In step S312, if the quota of the elastic network interface is insufficient, causing the application for the elastic network interface or the secondary IP address of the elastic network interface to fail, then the Pod creation will fail.

[0085] In step S314, if the application for the elastic network interface or its secondary IP address is successful, the obtained elastic network interface or its secondary IP address is bound to the Pod, and the necessary routing information is configured.

[0086] Step S316: Complete the network configuration for the Pod.

[0087] By following the steps above, communication between the Pod and the VPC network can be achieved, and the resulting topology can be shown as follows: Figure 4 As shown, eth refers to the elastic network interface card.

[0088] This example demonstrates how to effectively utilize elastic network interfaces (ENIs) by distinguishing whether a Pod needs to be bound to an ENI based on its identifier (e.g., the Pod's network type).

[0089] As an optional embodiment, the network plugins used by the target container cluster include a first network plugin and a second network plugin, wherein the second network plugin is a network plugin corresponding to a second container network that is not based on an elastic network interface card. For the target container cluster, the network mode configured for it can be a network mode that uses both the first and second network plugins simultaneously.

[0090] Taking Kubernetes (K8s) as an example, a K8s cluster supports various container networks, each invoked as a plugin. The VPC-CNI network plugin uses Elastic Network Interfaces (ENIs). If all non-HostNetwork Pods were to request ENIs or secondary IPs for them, pod creation could easily fail due to insufficient quotas. Most Pods in a K8s cluster do not need to be bound to ENIs. To effectively utilize ENIs when their number is limited, a solution of having the VPC-CNI network plugin coexist with other network plugins can be used. For example, when creating a K8s cluster, other network modes can be selected; the VPC-CNI network mode (one of two network modes) is integrated by default. This means the VPC-CNI network plugin coexists with other network plugins, waiting for the cluster creation to succeed.

[0091] Optionally, in this embodiment, after obtaining the first target identifier corresponding to the target container group, the above method further includes:

[0092] S41, if it is determined from the first target identifier that the target container group and the target cloud host are located in different network namespaces, configure the target container network to which the target container group belongs;

[0093] S42, if the target container network is the first container network, determine that the target container group is a container group that uses the network interface provided by the elastic network card.

[0094] If the target container group and the target cloud host are located in different network namespaces based on the first target identifier (for example, the network type of the target container group is not HostNetwork), the target master node can further configure the container network within the target container cluster for the target container group, that is, the target container network, which is one of the first container network and the second container network.

[0095] If the target container network is the first container network, that is, the container network configured for the target container group is the first container network, the target master node can directly determine that the target container group is a container group using the network interface provided by the elastic network interface card.

[0096] In this embodiment, when the container network configured for the user is a container network based on elastic network interface cards (NICs), directly determining that the created container group uses elastic NICs can improve the convenience of container group network configuration.

[0097] As an optional embodiment, after configuring the target container network to which the target container group belongs, the above method further includes:

[0098] S51, if the target container network is the second container network, obtain the second target identifier corresponding to the target container group, wherein the second target identifier is used to indicate whether the target container group uses an elastic network interface card;

[0099] S52, if it is determined from the second target identifier that the target container group uses an elastic network interface card, the target container group is determined to be a container group that uses the network interface provided by the elastic network interface card.

[0100] If the target container network is the first container network, that is, the container network configured for the target container group is not a container network based on an elastic network interface (NIC), the target master node can further obtain a second target identifier corresponding to the target container group. This second target identifier is used to indicate whether the target container group uses an elastic NIC. This second target identifier can be selected or entered by the target object when creating the target container group; that is, it is set by the user whether the created target container group uses an elastic NIC.

[0101] If the target container group is determined to use an elastic network interface card (NIC) based on the second target identifier, the target master node can determine that the target container group is a container group using the network interface provided by the elastic NIC. Otherwise, the target master node can determine that the target container group is not a container group using the network interface provided by the elastic NIC.

[0102] Optionally, in this embodiment, regardless of the network configured for the target container group, the target master node can obtain the second target identifier corresponding to the target container group, and determine whether the target container group uses an elastic network interface card based on the second target identifier, thereby determining whether the target container group is a container group using the network interface provided by the elastic network interface card.

[0103] In this embodiment, when the container network configured for the user is not a container network based on an elastic network interface card (NIC), determining whether the created container group uses an elastic NIC based on the container group's identifier can improve the compatibility of network plugins using elastic NICs with other network plugins used by the container cluster, while avoiding service interruptions caused by replacing network plugins.

[0104] As an optional embodiment, before creating the target container group on the target cloud host, the above method further includes:

[0105] S61, determine the target network mode corresponding to the target container cluster to be created, wherein the target network mode is a network mode in which the first network plugin and the second network plugin coexist.

[0106] S62, create the target container cluster according to the target network pattern, wherein the target container cluster allows the use of the first network plugin and the second network plugin.

[0107] Before creating the target container group on the target cloud host, a target container cluster can first be created on one or more cloud hosts. When creating the target container cluster, the target object can select a network mode corresponding to the target container cluster; that is, a target network mode, which is a network mode where the first network plugin and the second network plugin coexist. The target server (which can be the target master node or other nodes) can determine the network mode corresponding to the target container cluster to be created as the aforementioned target network mode.

[0108] The target server can create the target container cluster based on the target network mode described above. The created target container cluster supports both the first network plugin and the second network plugin, that is, it allows the use of both the first network plugin and the second network plugin.

[0109] Optionally, for container clusters that have been running for a long time using other network plugins (e.g., Kubernetes clusters), if some container groups within the cluster need to be bound to an elastic network interface card (ENI) or an auxiliary IP address of the ENI (e.g., to enable pass-through of the load balancer to the container group), it is not possible to directly switch network plugins. If the network plugin is manually replaced, it will inevitably cause a long-term interruption of the application, which in turn will cause business interruption.

[0110] To prevent service interruption due to replacing the network plugin, in this embodiment, the configuration file of the original network plugin can be modified so that the original network plugin can enjoy the convenience brought by the first network plugin (i.e., VPC-CNI mode) without service interruption, and without affecting the normal operation of existing applications.

[0111] This embodiment demonstrates how configuring a container cluster can be made easier by configuring a network mode that supports two network plugins.

[0112] The following explanation, with reference to optional examples, illustrates the method for creating container groups in this application. In this example, the target container cluster is a K8s cluster, the target container group is a Pod in the K8s cluster, the first network plugin is a VPC-CNI network plugin, the first target identifier is an identifier of type HostNetwork, and the second target identifier is an identifier in the Pod's annotation.

[0113] If all non-HostNetwork type Pods need to request an Elastic Network Interface (ENI) or an auxiliary IP address for an ENI, Pod creation can easily fail due to insufficient ENI quota. However, in a real-world environment, most Pods in a Kubernetes cluster do not need to be bound to an ENI. To effectively utilize ENIs when their number is limited, this example provides a container group creation method based on ENIs for container networking. In this solution, the VPC-CNI network plugin coexists with other network plugins. Figure 5 As shown, the process of creating a container group in this optional example may include the following steps:

[0114] Step S502: Create a K8s cluster. Select other plugins; the VPC-CNI network plugin is integrated by default.

[0115] When creating a Kubernetes cluster, if you select another network mode, the VPC-CNI network mode will be integrated by default. That is, the two network modes coexist. Wait for the cluster to be created successfully.

[0116] Step S504: Create a Pod.

[0117] After a K8s cluster is successfully created, Pods can be created for that K8s cluster.

[0118] Step S506: Determine whether the Pod is using the host network. If not, proceed to step S508; if yes, proceed to step S520.

[0119] Based on the Pod's network type, determine whether the Pod uses the host network. If the Pod's network type is HostNetwork, the Pod and the host machine reside in the same network namespace. There's no need to bind an elastic network interface card (NIC) or configure container networking within the cluster. The network configuration process ends, and step S520 is executed. If the Pod's network type is not HostNetwork, step S508 is executed.

[0120] Step S508: Configure the cluster container network for the Pod (based on the second network plugin).

[0121] Step S510: Determine whether to apply for an elastic network interface card. If yes, proceed to step S512; otherwise, proceed to step S520.

[0122] After the container network is successfully configured, it can be determined whether the Pod needs to be bound to an elastic network interface based on the identifier in the Pod's annotation. If so, proceed to step S512; otherwise, end the network configuration process and proceed to step S520.

[0123] Step S512: Apply for a flexible network interface card (NIC).

[0124] If it is determined that the Pod needs to use an Elastic Network Interface (ENI), you can request an ENI or an auxiliary IP address from the VPC-CNI server program.

[0125] Step S514: Determine whether the elastic network card application was successful. If not, proceed to step S516; if yes, proceed to step S518.

[0126] In step S516, if the quota of the elastic network interface is insufficient, causing the application for the elastic network interface or the secondary IP address of the elastic network interface to fail, then the Pod creation will fail.

[0127] In step S518, if the application for the elastic network interface or its secondary IP address is successful, the obtained elastic network interface or its secondary IP address is bound to the Pod, and the necessary routing information is configured.

[0128] Step S520: Complete the network configuration for the Pod.

[0129] By coexisting two network modes and adding a check for "whether an elastic network interface is needed" during Pod creation, a large portion of Pods can be excluded, thus maximizing the effective utilization of elastic network interfaces. Through these steps, not only can container communication within the cluster be achieved, but also communication between necessary Pods and the VPC network can be realized. The resulting topology can be shown as follows: Figure 6 As shown.

[0130] This example demonstrates how the VPC-CNI network plugin can be shared with other network plugins (e.g., the original network plugin in a Kubernetes cluster). By identifying the Pod, it determines whether to use the network interface provided by the elastic network interface card (NIC) or the original network plugin, and only assigns the NIC to Pods that require it. This increases the number of Pods supported by a node and allows binding the NIC to a Pod without affecting existing services, thus largely solving the problem of limited Pod count on a node.

[0131] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0132] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM (Read-Only Memory) / RAM (Random Access Memory), magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0133] According to another aspect of the embodiments of this application, a container group creation apparatus for implementing the above-described container group creation method is also provided. Figure 7 This is a structural block diagram of an optional container group creation apparatus according to an embodiment of this application, such as... Figure 7 As shown, the device may include:

[0134] The first creation unit 702 is used to create a target container group on the target cloud host, wherein the target cloud host has nodes belonging to the target container cluster deployed on it, and the network plugin used by the target container cluster includes a first network plugin corresponding to the first container network based on the elastic network interface card.

[0135] The application unit 704 is connected to the first creation unit 702 and is used to apply for the first network plug-in elastic network interface for the target container group when it is determined that the target container group is a container group that uses the network interface provided by the elastic network interface.

[0136] Binding unit 706, connected to application unit 704, is used to bind the target elastic network interface to the target container group when the target elastic network interface is applied for for the target container group.

[0137] It should be noted that the first creation unit 702 in this embodiment can be used to perform the above step S202, the application unit 704 in this embodiment can be used to perform the above step S204, and the binding unit 706 in this embodiment can be used to perform the above step S206.

[0138] Through the above modules, a target container group is created on the target cloud host. The target cloud host deploys nodes belonging to the target container cluster. The network plugin used by the target container cluster includes a first network plugin corresponding to the first container network based on an elastic network interface card (NIC). If it is determined that the target container group is a container group using a network interface provided by an elastic NIC, an elastic NIC for the first network plugin is requested for the target container group. If a target elastic NIC is obtained for the target container group, it is bound to the target container group. This solves the problem in related technologies where the limited number of available IPs in container network implementations using elastic NICs results in a small number of services that can be deployed, thus increasing the number of container groups that can be created in a container network.

[0139] As an optional embodiment, the above-described apparatus further includes:

[0140] The first acquisition unit is used to acquire a first target identifier corresponding to the target container group after creating the target container group on the target cloud host. The first target identifier is used to indicate the network type used by the target container group.

[0141] The first determining unit is configured to determine, based on the first target identifier, that the target container group and the target cloud host are located in the same network namespace, that the target container group is a container group using the network interface of the target cloud host.

[0142] As an optional embodiment, the target container cluster uses only the first network plugin; the above apparatus further includes:

[0143] The second determining unit is used to determine, after obtaining the first target identifier corresponding to the target container group, that the target container group and the target cloud host are located in different network namespaces based on the first target identifier, that the target container group is a container group using the network interface provided by the elastic network interface card.

[0144] As an optional embodiment, the network plugin used by the target container cluster includes a first network plugin and a second network plugin, wherein the second network plugin is a network plugin corresponding to a second container network that is not based on an elastic network interface card; the above apparatus further includes:

[0145] The configuration unit is used to configure the target container network to which the target container group belongs after obtaining the first target identifier corresponding to the target container group and determining, based on the first target identifier, that the target container group and the target cloud host are located in different network namespaces.

[0146] The third determining unit is used to determine, when the target container network is the first container network, that the target container group is a container group using the network interface provided by the elastic network card.

[0147] As an optional embodiment, the above-described apparatus further includes:

[0148] The second acquisition unit is used to acquire a second target identifier corresponding to the target container group after configuring the target container network to which the target container group belongs, when the target container network is the second container network. The second target identifier is used to indicate whether the target container group uses an elastic network interface card.

[0149] The fourth determining unit is used to determine that the target container group is a container group using a network interface provided by an elastic network interface card when it is determined from the second target identifier that the target container group uses an elastic network interface card.

[0150] As an optional embodiment, the above-described apparatus further includes:

[0151] The fifth determining unit is used to determine the target network mode corresponding to the target container cluster to be created before creating the target container group on the target cloud host. The target network mode is a network mode in which the first network plugin and the second network plugin coexist.

[0152] The second creation unit is used to create the target container cluster according to the target network pattern, wherein the target container cluster allows the use of the first network plugin and the second network plugin.

[0153] As an optional embodiment, application unit 704 includes:

[0154] The sending module is used to send a target request message to the target server program, wherein the target server program is the server program of the first network plugin, and the target request message is used to request the application for an elastic network interface card or an auxiliary IP address of the elastic network interface card;

[0155] The receiving module is used to receive the target response message returned by the target server program, wherein the target response message is used to indicate the application result of the elastic network interface card or the secondary IP address of the elastic network interface card.

[0156] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the content disclosed in the above embodiments. It should also be noted that the above modules, as part of a device, can operate in environments such as... Figure 1 The hardware environment shown can be implemented through software or hardware, and the hardware environment includes the network environment.

[0157] According to another aspect of the embodiments of this application, an electronic device for implementing the above-described method for creating a container group is also provided. The electronic device may be a server, a terminal, or a combination thereof.

[0158] Figure 8This is a structural block diagram of an optional electronic device according to an embodiment of this application, such as... Figure 8 As shown, it includes a processor 802, a communication interface 804, a memory 806, and a communication bus 808. The processor 802, communication interface 804, and memory 806 communicate with each other via the communication bus 808.

[0159] Memory 806 is used to store computer programs;

[0160] When processor 802 executes a computer program stored in memory 806, it performs the following steps:

[0161] Create a target container group on the target cloud host, wherein the target cloud host deploys nodes belonging to the target container cluster, and the network plugin used by the target container cluster includes a first network plugin corresponding to the first container network based on the elastic network interface card;

[0162] If the target container group is determined to be a container group that uses the network interface provided by the elastic network interface card, apply for the elastic network interface card of the first network plug-in for the target container group;

[0163] If a target elastic network interface card (NIC) is obtained for the target container group, the target elastic NIC will be bound to the target container group.

[0164] Optionally, in this embodiment, the communication bus can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 The symbol is represented by a single thick line, but this does not indicate that there is only one bus or one type of bus. The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0165] The memory may include RAM, or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0166] As an example, the memory 806 described above may include, but is not limited to, the first creation unit 702, the application unit 704, and the binding unit 706 in the container group creation device described above. Furthermore, it may include, but is not limited to, other module units in the container group creation device described above, which will not be elaborated upon in this example.

[0167] The processors mentioned above can be general-purpose processors, including but not limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; they can also be DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0168] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments, and will not be repeated here.

[0169] Those skilled in the art will understand that Figure 8 The structure shown is for illustrative purposes only. The device implementing the above container group creation method can be a terminal device, such as a smartphone (e.g., Android phone, iOS phone), tablet computer, PDA, mobile Internet Device (MID), PAD, etc. Figure 8 This does not limit the structure of the aforementioned electronic devices. For example, the electronic device may also include components that are more... Figure 8 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 8 The different configurations shown.

[0170] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, ROM, RAM, disk or optical disk, etc.

[0171] According to another aspect of the embodiments of this application, a storage medium is also provided. Optionally, in this embodiment, the storage medium can be used to execute program code for the method of creating a container group according to any of the embodiments of this application.

[0172] Optionally, in this embodiment, the storage medium may be located on at least one of the network devices in the network shown in the above embodiment.

[0173] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:

[0174] Create a target container group on the target cloud host, wherein the target cloud host deploys nodes belonging to the target container cluster, and the network plugin used by the target container cluster includes a first network plugin corresponding to the first container network based on the elastic network interface card;

[0175] If the target container group is determined to be a container group that uses the network interface provided by the elastic network interface card, apply for the elastic network interface card of the first network plug-in for the target container group;

[0176] If a target elastic network interface card (NIC) is obtained for the target container group, the target elastic NIC will be bound to the target container group.

[0177] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments, and will not be repeated in this embodiment.

[0178] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, ROMs, RAMs, portable hard drives, magnetic disks, or optical disks.

[0179] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0180] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.

[0181] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0182] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between units or modules, and may be electrical or other forms.

[0183] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the solution provided in this embodiment, depending on actual needs.

[0184] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0185] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for creating a container group, characterized in that, include: Create a target container group on the target cloud host, wherein the target cloud host deploys nodes belonging to the target container cluster, and the network plugins used by the target container cluster include a first network plugin corresponding to a first container network based on an elastic network interface card and a second network plugin corresponding to a second container network not based on an elastic network interface card. If it is determined that the target container group is a container group that uses the network interface provided by the elastic network interface card, apply for the elastic network interface card of the first network plug-in for the target container group; If a target elastic network interface card (NIC) is obtained for the target container group, the target elastic NIC is bound to the target container group. The method further includes, after creating the target container group on the target cloud host, obtaining a first target identifier corresponding to the target container group, wherein the first target identifier is used to indicate the network type used by the target container group; and determining that the target container group and the target cloud host are located in the same network namespace based on the first target identifier, determining that the target container group is a container group using the network interface of the target cloud host. The method further includes, after obtaining the first target identifier corresponding to the target container group, configuring a target container network for the target container group if the target container group and the target cloud host are located in different network namespaces based on the first target identifier; and determining that the target container group is a container group using the network interface provided by the elastic network interface card if the target container network is the first container network.

2. The method according to claim 1, characterized in that, After configuring the target container network to which the target container group belongs, the method further includes: If the target container network is the second container network, obtain a second target identifier corresponding to the target container group, wherein the second target identifier is used to indicate whether the target container group uses an elastic network interface card; If the target container group is determined to use an elastic network interface card (NIC) based on the second target identifier, the target container group is determined to be a container group that uses the network interface provided by the elastic NIC.

3. The method according to claim 1, characterized in that, Before creating the target container group on the target cloud host, the method further includes: Determine the target network mode corresponding to the target container cluster to be created, wherein the target network mode is a network mode in which the first network plugin and the second network plugin coexist; The target container cluster is created according to the target network pattern, wherein the target container cluster allows the use of the first network plugin and the second network plugin.

4. The method according to any one of claims 1 to 3, characterized in that, The step of applying for the elastic network interface card for the first network plugin for the target container group includes: Send a target request message to the target server program, wherein the target server program is the server program of the first network plugin, and the target request message is used to request an elastic network interface card or an auxiliary IP address for the elastic network interface card; Receive the target response message returned by the target server program, wherein the target response message is used to indicate the application result of the elastic network interface card or the secondary IP address of the elastic network interface card.

5. A container group creation apparatus, characterized in that, include: The first creation unit is used to create a target container group on a target cloud host, wherein the target cloud host has nodes belonging to the target container cluster deployed on it, and the network plugins used by the target container cluster include a first network plugin corresponding to a first container network based on an elastic network interface card and a second network plugin corresponding to a second container network not based on an elastic network interface card. The application unit is used to apply for the elastic network interface card of the first network plug-in for the target container group when it is determined that the target container group is a container group that uses the network interface provided by the elastic network interface card. A binding unit is used to bind the target elastic network interface to the target container group when a target elastic network interface is obtained for the target container group. The creation device further includes: The first acquisition unit is configured to acquire a first target identifier corresponding to the target container group after the target container group is created on the target cloud host, wherein the first target identifier is used to indicate the network type used by the target container group; The first determining unit is configured to determine that the target container group is a container group using the network interface of the target cloud host when it is determined from the first target identifier that the target container group and the target cloud host are located in the same network namespace; The configuration unit is configured to configure the target container network to which the target container group belongs after obtaining the first target identifier corresponding to the target container group and determining, based on the first target identifier, that the target container group and the target cloud host are located in different network namespaces. The third determining unit is configured to determine, when the target container network is the first container network, that the target container group is a container group using a network interface provided by an elastic network interface card.

6. An electronic device comprising a processor, a communication interface, a memory, and a communication bus, wherein, The processor, the communication interface, and the memory communicate with each other via the communication bus, characterized in that... The memory is used to store computer programs; The processor is configured to perform the method steps of any one of claims 1 to 4 by running the computer program stored in the memory.

7. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to execute the steps of the method described in any one of claims 1 to 4 when it is run.

Citation Information

Patent Citations

  • Container cloud service system and pod creation method and device

    CN108924268A

  • Container network configuration method and system

    CN110138606A