CN115469961A - Method and device for creating container group, electronic equipment and storage medium - Google Patents

Method and device for creating container group, electronic equipment and storage medium Download PDF

Info

Publication number
CN115469961A
CN115469961A CN202110567560.5A CN202110567560A CN115469961A CN 115469961 A CN115469961 A CN 115469961A CN 202110567560 A CN202110567560 A CN 202110567560A CN 115469961 A CN115469961 A CN 115469961A
Authority
CN
China
Prior art keywords
target
network
container group
target container
network card
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110567560.5A
Other languages
Chinese (zh)
Inventor
李俊丽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202110567560.5A priority Critical patent/CN115469961A/en
Publication of CN115469961A publication Critical patent/CN115469961A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/255Maintenance or indexing of mapping tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Abstract

The application provides a method and a device for creating a container group, electronic equipment and a storage medium, wherein the method comprises the following steps: creating a target container group on a target cloud host, wherein nodes belonging to a target container cluster are deployed on the target cloud host, and network plug-ins used by the target container cluster comprise first network plug-ins corresponding to a first container network based on an elastic network card; applying for the target container group for the elastic network card of the first network plug-in unit under the condition that the target container group is determined to be the container group using the network interface provided by the elastic network card; and binding the target flexible network card to the target container group under the condition of applying for the target container group to the target flexible network card. By the method and the device, the problem that the number of allowed deployed services is small due to the limited number of IP (Internet protocol) which can be provided in a container network implementation mode using the elastic network card in the related art is solved.

Description

Method and device for creating container group, electronic equipment and storage medium
Technical Field
The present application relates to the field of internet technologies, and in particular, to a method and an apparatus for creating a container group, an electronic device, and a storage medium.
Background
The Kubernetes (open source system for automatically deploying, expanding and managing containerized applications, abbreviated as K8 s) container management system supports a variety of network implementations, such as open source software like Flannel, calico, canal, etc. Each Network Container implementation scheme works in the form of plug-in calls in K8s, and the CNI (Container Network Interface) is responsible for providing a uniform standard Interface for these plug-ins. The network container implementation scheme is that the network IP (Internet Protocol) provided by Pod (the minimum/simplest basic unit created or deployed by K8s, where one Pod represents one process running on a cluster) is in the cluster range, and the number of IPs is not limited.
The following problems exist in the above network implementation: pod communication performance is lost due to the use of bridge technology; the load balancer cannot directly access the Pod and needs to forward through the nodes of the K8s cluster, so that the access performance is reduced; in addition, the network of the cloud host and the Pod network are not on the same network level, and communication between the cloud host and the Pod network needs to depend on VPC routing, so that the communication complexity is increased. In order to solve the above problems, some cloud manufacturers have proposed a container network implemented based on a VPC flexible network card or a flexible network card auxiliary IP technology, that is, an IP or an auxiliary IP of the flexible network card is allocated to a container. The network container implementation scheme is also implemented based on a CNI interface, and a network plug-in of this type may be abbreviated as VPC-CNI. Currently, the practice of each cloud manufacturer is to provide an independent VPC-CNI network plug-in for users to use. However, such network container implementation has the following problems: the number of the IP which can be provided is limited, and the requirement of the Pod in the K8s cluster on the IP cannot be met, so that the number of services which can be deployed by a user is limited.
Therefore, in the container network implementation manner in the related art, the number of Pod allowed to be deployed on each cloud host is limited by the maximum number of bound IPs that can be bound by inserting the flexible network card and supported by the node.
Disclosure of Invention
The application provides a method and a device for creating a container group, an electronic device and a storage medium, which are used for at least solving the problem that the number of services allowed to be deployed is small due to the limited number of IP (Internet protocol) which can be provided in a container network implementation mode using an elastic network card in the related art.
According to an aspect of an embodiment of the present application, there is provided a method for creating a container group, including: creating a target container group on a target cloud host, wherein nodes belonging to a target container cluster are deployed on the target cloud host, and network plug-ins used by the target container cluster comprise first network plug-ins corresponding to a first container network based on an elastic network card; applying for the target container group for the elastic network card of the first network plug-in unit under the condition that the target container group is determined to be the container group using the network interface provided by the elastic network card; and under the condition that the target elastic network card is applied to the target container group, binding the target elastic network card to the target container group.
Optionally, after the creating the target container group on the target cloud host, the method further comprises: acquiring a first target identifier corresponding to the target container group, wherein the first target identifier is used for indicating a network type used by the target container group; and under the condition that the target container group and the target cloud host are located in the same network name space according to the first target identification, determining that the target container group is a container group using a network interface of the target cloud host.
Optionally, the network plug-in used by the target container cluster uses only a first network plug-in; after the obtaining of the first target identifier corresponding to the target container group, the method further includes: and under the condition that the target container group and the target cloud host are located in different network namespaces according to the first target identification, determining that the target container group is a container group using a network interface provided by an elastic network card.
Optionally, the network plug-ins used by the target container cluster include the first network plug-in and a second network plug-in, where the second network plug-in is a network plug-in corresponding to a second container network that is not based on an elastic network card; after the obtaining of the first target identifier corresponding to the target container group, the method further includes: under the condition that the target container group and the target cloud host are located in different network namespaces according to the first target identification, configuring a target container network to which the target container group belongs for the target container group; and under the condition that the target container network is the first container network, determining that the target container group is a container group using a network interface provided by an elastic network card.
Optionally, after configuring the target container network to which the target container group belongs, the method further includes: under the condition that the target container network is the second container network, acquiring a second target identifier corresponding to the target container group, wherein the second target identifier is used for indicating whether the target container group uses an elastic network card or not; and under the condition that the target container group is determined to use the elastic network card according to the second target identifier, determining the target container group as a container group using a network interface provided by the elastic network card.
Optionally, before the 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 plug-in and the second network plug-in coexist; and according to the target network mode, creating the target container cluster, wherein the target container cluster allows the first network plug-in and the second network plug-in to be used.
Optionally, the applying for the target container group for the elastic network card of the first network plug-in includes: sending a target request message to a target server program, wherein the target server program is the server program of the first network plug-in, and the target request message is used for requesting for applying an elastic network card or an auxiliary IP address of the elastic network card; and receiving a target response message returned by the target server program, wherein the target response message is used for indicating the application result of the elastic network card or the auxiliary IP address of the elastic network card.
According to another aspect of the embodiments of the present application, there is also provided a creating apparatus of a container group, including: the system comprises a first creating unit, a second creating unit and a third creating unit, wherein the first creating unit is used for creating a target container group on a target cloud host, nodes belonging to a target container cluster are deployed on the target cloud host, and network plug-ins used by the target container cluster comprise first network plug-ins corresponding to a first container network based on an elastic network card; an application unit, configured to apply for the elastic network 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 using a network interface provided by the elastic network card; and the binding unit is used for binding the target flexible network card to the target container group under the condition that the target flexible network card is applied to the target container group.
Optionally, the apparatus further comprises: a first obtaining unit, configured to obtain, after a target container group is created on a target cloud host, a first target identifier corresponding to the target container group, where the first target identifier is used to indicate a network type used by the target container group; and the first determining unit is used for determining that the target container group is a container group using a network interface of the target cloud host under the condition that the target container group and the target cloud host are located in the same network name space according to the first target identifier.
Optionally, the network plug-in used by the target container cluster uses only a first network plug-in; the device further comprises: a second determining unit, configured to determine, after the first target identifier corresponding to the target container group is obtained, that the target container group is a container group using a network interface provided by an elastic network card when the target container group and the target cloud host are located in different network namespaces according to the first target identifier.
Optionally, the network plug-ins used by the target container cluster include the first network plug-in and a second network plug-in, where the second network plug-in is a network plug-in corresponding to a second container network that is not based on an elastic network card; the device further comprises: a configuration unit, configured to configure a target container network to which the target container group belongs for the target container group when it is determined that the target container group and the target cloud host are located in different network namespaces according to the first target identifier after the first target identifier corresponding to the target container group is obtained; a third determining unit, 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 card.
Optionally, the apparatus further comprises: a second obtaining unit, configured to obtain, after the target container group is configured with the target container network to which the target container group belongs, a second target identifier corresponding to the target container group when the target container network is the second container network, where the second target identifier is used to indicate whether the target container group uses an elastic network card; and a fourth determining unit, configured to determine that the target container group is a container group using a network interface provided by the flexible network card when it is determined that the target container group uses the flexible network card according to the second target identifier.
Optionally, the apparatus further comprises: a fifth determining unit, configured to select a target network mode corresponding to the target container cluster to be created before creating a target container group on a target cloud host, where the target network mode is a network mode in which the first network plug-in and the second network plug-in coexist; a second creating unit, configured to create the target container cluster according to the target network mode, where the target container cluster allows the first network plug-in and the second network plug-in to be used.
Optionally, the application unit includes: a sending module, configured to send a target request message to a target server program, where the target server program is a server program of the first network plug-in, and the target request message is used to request for applying an elastic network card or an auxiliary IP address of the elastic network card; and the receiving module is used for receiving a target response message returned by the target server program, wherein the target response message is used for indicating the application result of the elastic network card or the auxiliary IP address of the elastic network card.
According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory communicate with each other through the communication bus; wherein the memory is used for storing the computer program; a processor for performing the method steps in any of the above embodiments by running the computer program stored on the memory.
According to a further aspect of the embodiments of the present application, there is also provided a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to perform the method steps of any of the above embodiments when the computer program is executed.
In the embodiment of the application, a target container group is created on a target cloud host in a manner of allocating an elastic network card only for the container group with requirements, wherein the target cloud host is provided with nodes belonging to a target container cluster, and network plug-ins used by the target container cluster comprise first network plug-ins corresponding to a first container network based on the elastic network card; under the condition that the target container group is determined to be the container group using the network interface provided by the elastic network card, applying for the elastic network card of the first network plug-in unit for the target container group; under the condition of applying for the target elastic network card for the target container group, the target elastic network card is bound to the target container group, and the elastic network card is only distributed to the container group with requirements when the container group (for example, pod) is created, so that the purpose of creating more container groups by using limited IP number can be realized, the technical effect of improving the container groups allowed to be created in the container network is achieved, and the problem that the number of services allowed to be deployed is small due to the fact that the number of IP which can be provided is limited in a container network implementation mode using the elastic network card in the related technology is solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
FIG. 1 is a schematic diagram of a hardware environment for an alternative method of creating a container group according to an embodiment of the present application;
FIG. 2 is a flow chart illustrating an alternative method for creating a container group according to an embodiment of the present application;
FIG. 3 is a flow chart illustrating an alternative method for creating a container group according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an alternative method of creating a container group according to an embodiment of the application;
FIG. 5 is a flow chart illustrating a method for creating an alternative container group according to an embodiment of the present application;
FIG. 6 is a schematic diagram of an alternative method of creating a container group according to an embodiment of the present application;
fig. 7 is a block diagram of an alternative apparatus for creating a container group according to an embodiment of the present application;
fig. 8 is a block diagram of an alternative electronic device according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of an embodiment of the present application, a method for creating a container group is provided. Alternatively, in the present embodiment, the above-described method for creating a container group may be applied to a hardware environment formed by the terminal 102 and the server 104 as shown in fig. 1. As shown in fig. 1, the server 104 is connected to the terminal 102 through a network, and may be configured to provide a service (e.g., a cloud service) for the terminal or a client installed on the terminal, and may be configured with a database on the server or separately from the server, and configured to provide a data storage service for the server 104.
The network may include, but is not limited to, at least one of: wired network, wireless network. The wired network may include, but is not limited to, at least one of: wide area networks, metropolitan area networks, local area networks, which may include, but are not limited to, at least one of the following: WIFI (Wireless Fidelity), bluetooth. The terminal 102 may not be limited to a PC, a mobile phone, a tablet computer, etc.
The method for creating a container group according to the embodiment of the present application may be executed by the server 104, may be executed by the terminal 102, or may be executed by both the server 104 and the terminal 102. The method for creating the container group performed by the terminal 102 according to the embodiment of the present application may be performed by a client installed thereon.
Taking the server 104 to execute the method for creating the container group in this embodiment as an example, fig. 2 is a schematic flow chart of an optional method for creating the container group according to the embodiment of the present application, and as shown in fig. 2, the flow chart of the method may include the following steps:
step S202, a target container group is created on a target cloud host, wherein nodes belonging to a target container cluster are deployed on the target cloud host, and network plug-ins used by the target container cluster comprise first network plug-ins corresponding to a first container network based on an elastic network card.
The method for creating a container group in this embodiment may be applied to a scenario of creating a container group in a container cluster. The container cluster may be a K8s cluster, or other similar clusters. The above-mentioned container group may be an atomic scheduling unit in the container cluster, i.e., the smallest unit of the container cluster schedule (the smallest basic unit created or deployed). Each container group corresponds to a logical host and has its own IP address. Each container group may contain one or more containers, and the containers within the same container group share the same IP and port space. The container group may be Pod in K8s, or a scheduling unit in another container cluster. In this embodiment, pod in a K8s cluster is created as an example for description.
Alternatively, the target container cluster may include at least one master node and at least one worker node, and each node (master node or worker node) may be deployed on one cloud host (an example of the server 104 described above). The method for creating the container group in this embodiment may be executed by a target master node of the target container cluster (or a cloud host where the target master node is located), or executed by the target master node and a target work node (or a target cloud host where the target work node is located) together.
The network plug-ins used by the target container cluster may include a first network plug-in (e.g., the K8s cluster uses a standalone VPC-CNI network plug-in) corresponding to the first container network based on the resilient network card. The first container network can be a container network realized based on a VPC (virtual private network) elastic network card or an elastic network card auxiliary IP (Internet protocol) technology; correspondingly, the first network plug-in may be a VPC-CNI network plug-in. Optionally, the network plug-ins used by the target container cluster may also include other network plug-ins, for example, network plug-ins corresponding to other container networks (e.g., flannel, calico, canal, etc.) besides the first container network, which is not limited in this embodiment.
The target master node may perform a create target container group (e.g., target Pod) operation on a target cloud host that may be used to deploy nodes (e.g., master nodes, worker nodes) belonging to a target container cluster, according to a create request for a target object (an object using the target container cluster or an object having control authority over the target container cluster) or based on other control information.
Step S204, under the condition that the target container group is determined to be the container group using the network interface provided by the elastic network card, the elastic network card of the first network plug-in is applied for the target container group.
In the related art, if a container cluster uses a container plug-in based on an elastic network card, when a Pod is created, the elastic network card is directly bound to the Pod, so that the number of the pods allowed to be created on each cloud host is limited to the maximum number of bound IPs supported by the nodes and capable of being bound by the inserted elastic network card.
In conjunction with the attributes of the Pod, there is a significant portion of the pods that do not actually need to use a flexible network card because they do not have the need to communicate with other cloud hosts or K8s clusters within the VPC (e.g., the system management components provided by the cluster), and therefore, these pods do not have to be assigned this type of IP address.
Optionally, in this embodiment, when performing network configuration on the target container group, it may be first determined whether the target container group is a container group using a network interface provided by the elastic network card, that is, whether the target container group is a container group to which the elastic network card needs to be bound (or whether the target container group uses an IP address corresponding to the elastic network card). If the target container group is a container group using a network interface provided by the flexible network card, the flexible network card of the first network plug-in unit (or an IP address corresponding to the flexible network card of the first network plug-in unit) may be applied for the target container group.
Step S206, binding the target resilient network card to the target container group when the target resilient network card is applied for the target container group.
The quota of the resilient network card on each target cloud host is limited. If the quota of the elastic network card is enough, the target elastic network card can be applied to the target container group, and the target main node can bind the target elastic network card to the target container group. In addition, the target cloud host may also configure necessary routing information (e.g., target routing information) and the like for the target container group, thereby completing the network configuration for the target container group.
If the quota of the flexible network card is not enough, the target container group is failed to be created. If the target container group does not apply for the elastic network card, target indication information can be generated, and the target indication information is used for indicating that the target container group is failed to be created due to insufficient quota of the elastic network card. The target master node may send the target indication information to the target terminal device of the target object to indicate that the target object target container group was created unsuccessfully.
Through the steps S202 to S206, a target container group is created on the target cloud host, where nodes belonging to a target container cluster are deployed on the target cloud host, and the network plug-ins used by the target container cluster include first network plug-ins corresponding to a first container network based on an elastic network card; under the condition that the target container group is determined to be the container group using the network interface provided by the elastic network card, applying for the elastic network card of the first network plug-in unit for the target container group; under the condition that the target elastic network card is applied to the target container group, the target elastic network card is bound to the target container group, the problem that the number of services allowed to be deployed is small due to the limited number of IP (Internet protocol) which can be provided in a container network implementation mode using the elastic network card in the related technology is solved, and the container group allowed to be created in the container network is improved.
As an alternative embodiment, the flexible network card for applying for the first network plug-in for the target container group includes:
s11, sending a target request message to a target server program, wherein the target server program is a server program of a first network plug-in, and the target request message is used for requesting for applying for the elastic network card or an auxiliary IP address of the elastic network card;
and S12, receiving a target response message returned by the target server program, wherein the target response message is used for indicating the application result of the elastic network card or the auxiliary IP address of the elastic network card.
And the server program of the first network plug-in is a target server program. When the target container group is applied for the resilient network card of the first network plug-in, the target host node may request the target server program for applying for the resilient network card or the auxiliary IP of the resilient network card, for example, may send a target request message to the target server program, where the target request message is used to request for applying for the auxiliary IP address of the resilient network card or the resilient network card.
And responding to the target request message, if the quota of the elastic network card is enough, the target server-side program can allocate the elastic network card or the auxiliary IP address of the elastic network card. If the quota of the elastic network card is not enough, the target server program may not allocate the elastic network card or the auxiliary IP address of the elastic network card. The target server program may return a target response message to the target host node, and the target host node may receive the target response message, where the target response message is used to indicate an application result of the resilient network card or the auxiliary IP address of the resilient network card.
Correspondingly, the binding of the target resilient network card to the target container group may be: and binding the applied elastic network card or the auxiliary IP of the elastic network card to the target container group.
It should be noted that the target server program may be run on the target cloud host (or the target server program may also be run on the target host node), and the application for the auxiliary IP address of the elastic network card or the elastic network card may be a target thread on the target cloud host, and the application for the auxiliary IP address of the elastic network card or the elastic network card may be completed through interaction between the target thread and the target server program.
By the embodiment, the IP address is allocated to the container group by applying for the elastic network card or the auxiliary IP address of the elastic network card for the container group, so that the binding flexibility of the elastic network card can be improved.
As an optional embodiment, after the target container group is created on the target cloud host, the method further includes:
s21, acquiring a first target identifier corresponding to a target container group, wherein the first target identifier is used for indicating a network type used by the target container group;
and S22, determining that the target container group is a container group using the network interface of the target cloud host under the condition that the target container group and the target cloud host are positioned in the same network name space according to the first target identifier.
After creating the target container group, the target cloud host may obtain a first target identifier corresponding to the target container group, where the first target identifier is used to indicate a network type used by the target container group.
If the network type used by the target container group indicated by the first target identifier is Hostnetwork (namely, a host machine network), and the target container group and the target cloud host are located in the same network name space, it can be determined that the target container group uses the network interface of the target cloud host, and an elastic network card does not need to be bound for the target container group. At this time, network configuration may be performed for the target container group using the IP address of the target cloud host, or the like.
For example, for creating a Pod, if the network type of the Pod is HostNetwork, the Pod and the host are located in the same network namespace, and an elastic network card does not need to be bound to the Pod, and the network configuration process can be ended.
According to the embodiment, whether the elastic network card needs to be bound for the target container group is determined based on the fact that the target container group and the target cloud host are located in the same network name space, part of the container group without the elastic network card can be discharged, and effective utilization of the elastic network card is achieved.
As an alternative embodiment, the network plug-in used by the target container cluster uses only the first network plug-in. For a target container cluster, the network mode configured for it may be a network mode that uses only the first network plug-in. For example, when creating a container cluster, the VPC-CNI network mode may be selected, waiting for cluster creation to succeed.
Optionally, in this embodiment, after obtaining the first target identifier corresponding to the target container group, the method further includes:
and S31, determining that the target container group is a container group using a network interface provided by the elastic network card under the condition that the target container group and the target cloud host are positioned in different network namespaces according to the first target identifier.
If the network type used by the target container group indicated by the first target identifier is a non-Hostnetwork type, and the target container group and the target cloud host are located in different network name spaces, it can be determined that the target container group is a container group using a network interface provided by the elastic network card. At this time, an elastic network card may be applied for the target container group.
For example, for all the posts of non-HostNetwork types, an elastic network card or an auxiliary IP of the elastic network card may be applied for them.
Through the embodiment, the elastic network card is applied to all the container groups of non-HostNet type, so that convenience of network configuration of the container groups can be improved.
The following explains a method for creating a container group in the embodiment of the present application with reference to an alternative example. In this example, the target container cluster is a K8s cluster, the target container cluster 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 a HostNetwork type.
For the purpose of effectively utilizing the flexible network card under the condition that the number of bound IPs of the flexible network card is limited after the VPC-CNI network plug-in is used, the method for creating the container group provided in this example is a scheme in which the VPC-CNI network plug-in does not coexist with other network plug-ins in the VPC-CNI network mode. As shown in fig. 3, the flow of the method for creating a container group in this alternative example may include the following steps:
and step S302, creating a K8S cluster and selecting a VPC-CNI network plug-in.
And when the K8s cluster is created, selecting a VPC-CNI network mode, wherein the VPC-CNI network plug-in does not coexist with other network plug-ins in the VPC-CNI network mode, and waiting for the successful creation of the K8s cluster.
Step S304, a Pod is created.
After the creation of the K8s cluster is successful, a Pod may be created for the K8s cluster.
Step S306, judging whether the Pod uses the host network, if not, executing step S308, and if so, executing step S316.
And determining whether the Pod uses the host network according to the network type of the Pod. If the network type of the Pod is the HostNetwork type, the elastic network card does not need to be bound for the Pod, the network configuration process is ended, and step S316 is executed. If the network type of the Pod is a non-HostNetwork type, step S308 is performed.
Step S308, apply for the flexible network card.
And if the Pod is determined to need to use the elastic network card, requesting the application of the elastic network card or the auxiliary IP address of the elastic network card from a service-side program of the VPC-CNI.
Step S310, determining whether the application of the resilient network card is successful, if not, executing step S312, and if so, executing step S314.
In step S312, if the quota of the elastic network card is insufficient, which results in failure of applying for the elastic network card or the auxiliary IP address of the elastic network card, the Pod creation fails.
Step S314, if the application of the auxiliary IP address of the flexible network card or the flexible network card is successful, binding the applied auxiliary IP of the flexible network card or the flexible network card to the Pod, and configuring necessary routing information and the like.
Step S316, the network configuration for Pod is completed.
Through the steps, communication between the Pod and the VPC network can be realized, and a formed topological graph can be shown in fig. 4, wherein eth refers to an elastic network card.
By the example, the Pod which does not need to bind the elastic network card is distinguished through the identification of the Pod (for example, the network type of the Pod), and the effective utilization of the elastic network card can be realized.
As an alternative embodiment, the network plug-ins used by the target container cluster include a first network plug-in and a second network plug-in, where the second network plug-in is a network plug-in corresponding to a second container network that is not based on an elastic network card. For a target container cluster, the network mode configured for it may be a network mode that uses both a first network plug-in and a second network plug-in.
Taking K8s as an example, a plurality of different container networks are supported in the K8s cluster, and each container network is called in the form of a plug-in, wherein an elastic network card is used by the VPC-CNI network plug-in. If all the Pods of the non-HostNet type are controlled to apply for the elastic network card or the auxiliary IP of the elastic network card, the creation of the Pod is easy to fail due to the shortage of quota. And most of the Pod in the K8s cluster does not need to be bound with an elastic network card. In order to effectively utilize the flexible network cards under the condition of limited number of the flexible network cards, a scheme that the VPC-CNI network cards and other network cards coexist can be used. For example, when creating a K8s cluster, another network mode may be selected, which by default would integrate the VPC-CNI network mode (two network modes), i.e. the VPC-CNI network plug and the other network plug coexist, waiting for the cluster creation to succeed.
Optionally, in this embodiment, after obtaining the first target identifier corresponding to the target container group, the method further includes:
s41, under the condition that the target container group and the target cloud host are located in different network namespaces according to the first target identification, configuring a target container network to which the target container group belongs;
and S42, determining that the target container group is a container group using a network interface provided by the elastic network card under the condition that the target container network is the first container network.
If it is determined that the target container group and the target cloud host are located in different network namespaces (for example, the network type of the target container group is a non-HostNetwork type) according to the first target identifier, the target host node may further configure a container network in the target container cluster for the target container group, that is, the target container network, where the target container network is one of the first container network and the second container network.
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 host node may directly determine that the target container group is a container group using a network interface provided by the resilient network card.
Through the embodiment, when the container network configured for the user is the container network based on the elastic network card, the created container group is directly determined to use the elastic network card, so that the convenience of the network configuration of the container group can be improved.
As an optional embodiment, after configuring the target container network to which the target container group belongs, the method further includes:
s51, under the condition that the target container network is a second container network, acquiring a second target identifier corresponding to the target container group, wherein the second target identifier is used for indicating whether the target container group uses the elastic network card or not;
and S52, under the condition that the target container group uses the elastic network card according to the second target identification, determining that the target container group is a container group using a network interface provided by the elastic network card.
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 the flexible network card, the target host node may further obtain a second target identifier corresponding to the target container group, where the second target identifier is used to indicate whether the target container group uses the flexible network card. The second target identifier may be selected or input by the target object when creating the target container group, that is, whether the created target container group uses the flexible network card is set by the user.
If the target container group is determined to use the elastic network card according to the second target identifier, the target master node may determine that the target container group is a container group using a network interface provided by the elastic network card. Otherwise, the target master node may determine that the target container group is not a container group using a network interface provided by the resilient network card.
Optionally, in this embodiment, no matter what network is configured for the target container group, the target master node may obtain a second target identifier corresponding to the target container group, and determine whether the target container group uses the elastic network card based on the second target identifier, so as to determine whether the target container group is a container group that uses a network interface provided by the elastic network card.
By the embodiment, when the container network configured for the user is not the container network based on the elastic network card, whether the created container group uses the elastic network card is determined based on the identifier of the container group, so that the compatibility of the network plug-in using the elastic network card and other network plug-ins used by the container cluster can be improved, and meanwhile, service interruption caused by replacing the network plug-in can be avoided.
As an optional embodiment, before creating the target container group on the target cloud host, the method further includes:
s61, determining a target network mode corresponding to a target container cluster to be created, wherein the target network mode is a network mode in which a first network plug-in and a second network plug-in coexist;
s62, according to the target network mode, a target container cluster is created, wherein the target container cluster allows the first network plug-in and the second network plug-in to be used.
A target container cluster may be created on one or more cloud hosts first before creating a target container group on the target cloud host. When creating the target container cluster, the target object may select, for the target container cluster, a network mode corresponding to the target container cluster, that is, a target network mode, which is a network mode in which the first network plug-in and the second network plug-in coexist. The target server (which may be a target master node or other nodes) may determine that the network mode corresponding to the target container cluster to be created is the target network mode.
The target server may create the target container cluster based on the target network schema, the created target container cluster supporting both the first network plugin and the second network plugin, i.e., allowing use of the first network plugin and the second network plugin.
Optionally, for a container cluster (for example, a K8s cluster) that has been running for a long time and uses other network plug-ins, if some container groups in the container cluster need to bind an elastic network card or an auxiliary IP address of the elastic network card (for example, it is desirable to implement direct connection of a load balancer to the container groups), the network plug-ins cannot be directly switched, and if the network plug-ins are manually replaced, long-time interruption of the application is inevitably caused, and further, service interruption is caused.
In order to avoid service interruption caused by replacing a network plug-in, in this embodiment, the configuration file of the original network plug-in may be changed, so that the original network plug-in may enjoy the convenience of the first network plug-in (i.e., VPC-CNI mode) without service interruption, and the normal operation of the existing application may not be affected.
By the embodiment, the convenience of container cluster configuration can be improved by configuring the container cluster with the network mode supporting two network plug-ins.
The following explains a method for creating a container group in the embodiment of the present application with reference to an alternative example. 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 plug-in is a VPC-CNI network plug-in, the first target identifier is an identifier of a HostNetwork type, and the second target identifier is an identifier in an annotation of the Pod.
If all the Pods of non-HostNet types need to apply for an elastic network card or an auxiliary IP address of the elastic network card, pod creation failure is easily caused by insufficient quota of the elastic network card, and in an actual environment, most of the Pods in the K8s cluster do not need to be bound with the elastic network card. In order to effectively utilize the flexible network card under the condition that the number of the flexible network cards is limited, the creation method of the container group provided in the example is a container network implementation scheme based on the flexible network card, and in the scheme, a VPC-CNI network plug-in and other network plug-ins coexist. As shown in fig. 5, the flow of the method for creating a container group in this alternative example may include the following steps:
and step S502, creating a K8S cluster, selecting other plug-ins, and integrating VPC-CNI network plug-ins by default.
When the K8s cluster is created, other network modes are selected, the VPC-CNI network mode is integrated by default, namely, the two network modes coexist, and the cluster creation is waited to be successful.
Step S504, a Pod is created.
After the K8s cluster creation is successful, a Pod may be created for the K8s cluster.
Step S506, judging whether the Pod uses the host network, if not, executing step S508, and if so, executing step S520.
And determining whether the Pod uses the host network according to the network type of the Pod. If the network type of the Pod is the Hostnetwork type, the Pod and the host are located in the same network name space, an elastic network card does not need to be bound for the Pod and a container network in the cluster does not need to be configured, the network configuration process is ended, and step S520 is executed. If the network type of the Pod is a non-HostNet type, step S508 is performed.
Step S508, configuring the container network in the cluster for Pod (based on the second network plug-in).
Step S510, determining whether to apply for the flexible network card, if yes, executing step S512, otherwise, executing step S520.
After the container network configuration is successful, whether the Pod needs to bind the elastic network card can be judged according to the identifier in the annotation of the Pod, if so, step S512 is executed, otherwise, the network configuration flow is ended, and step S520 is executed.
Step S512, apply for the flexible network card.
And if the Pod is determined to need to use the elastic network card, requesting the application of the elastic network card or the auxiliary IP address of the elastic network card from a service-side program of the VPC-CNI.
Step S514, determining whether the application of the flexible network card is successful, if not, executing step S516, and if so, executing step S518.
Step S516, if the quota of the elastic network card is insufficient, which results in a failure of the application of the auxiliary IP address of the elastic network card or the elastic network card, the Pod creation fails.
Step S518, if the application of the auxiliary IP address of the resilient network card or the resilient network card is successful, binding the applied auxiliary IP of the resilient network card or the resilient network card to the Pod, and configuring necessary routing information and the like.
Step S520, the network configuration for Pod is completed.
Through coexistence of two network modes and the judgment of 'whether the elastic network card is needed' added in the process of creating the Pod, most of the pods can be removed, and therefore the effective utilization of the elastic network card can be achieved to a great extent. Through the steps, not only container communication in the cluster can be realized, but also communication of the required Pod and VPC networks can be realized, and the formed topological graph can be as shown in fig. 6.
By using the example, after the VPC-CNI network plug-in is used, the VPC-CNI network plug-in is shared with other network plug-ins (for example, the original network plug-in a K8s cluster), and the identification of the Pod is used to determine whether the network interface provided by the elastic network card is used or the network interface provided by the original network plug-in, and the elastic network card is allocated only to the Pod with the requirement, so that the number of pods supported by the node can be increased, and the elastic network card can be bound to the Pod without affecting the existing service, thereby solving the problem of limited number of pods on the node to a great extent.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art will recognize that the embodiments described in this specification are preferred embodiments and that acts or modules referred to are not necessarily required for this application.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method according to the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., a ROM (Read-Only Memory)/RAM (Random Access Memory), a magnetic disk, an optical disk) and includes several instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the methods according to the embodiments of the present application.
According to another aspect of the embodiments of the present application, there is also provided a container group creation apparatus for implementing the above container group creation method. Fig. 7 is a block diagram of a structure of an optional device for creating a container group according to an embodiment of the present application, and as shown in fig. 7, the device may include:
a first creating unit 702, configured to create a target container group on a target cloud host, where nodes belonging to a target container cluster are deployed on the target cloud host, and network plug-ins used by the target container cluster include a first network plug-in corresponding to a first container network based on an elastic network card;
an applying unit 704, connected to the first creating unit 702, configured to apply for the target container group for the flexible network card of the first network plug-in unit if it is determined that the target container group is a container group using a network interface provided by the flexible network card;
and a binding unit 706, connected to the applying unit 704, configured to bind the target resilient network card to the target container group when the target resilient network card is applied to the target container group.
It should be noted that the first creating unit 702 in this embodiment may be configured to execute the step S202, the applying unit 704 in this embodiment may be configured to execute the step S204, and the binding unit 706 in this embodiment may be configured to execute the step S206.
Through the modules, a target container group is established on a target cloud host, wherein nodes belonging to a target container cluster are deployed on the target cloud host, and network plug-ins used by the target container cluster comprise first network plug-ins corresponding to a first container network based on an elastic network card; under the condition that the target container group is determined to be the container group using the network interface provided by the elastic network card, applying for the elastic network card of the first network plug-in unit for the target container group; under the condition of applying for the target elastic network card for the target container group, the target elastic network card is bound to the target container group, the problem that the number of services allowed to be deployed is small due to the fact that the number of the provided IPs is limited in a container network implementation mode using the elastic network card in the related technology is solved, and the container group allowed to be created in the container network is improved.
As an alternative embodiment, the apparatus further comprises:
the system comprises a first acquisition unit, a first storage unit and a second acquisition unit, wherein the first acquisition unit is used for acquiring a first target identifier corresponding to a target container group after the target container group is created on a target cloud host, and the first target identifier is used for indicating a network type used by the target container group;
and the first determining unit is used for determining that the target container group is a container group using a network interface of the target cloud host under the condition that the target container group and the target cloud host are located in the same network name space according to the first target identifier.
As an alternative embodiment, the network plug-in used by the target container cluster uses only the first network plug-in; the above-mentioned device still includes:
and the second determining unit is used for determining that the target container group is a container group using a network interface provided by the elastic network card under the condition that the target container group and the target cloud host are located in different network namespaces according to the first target identifier after the first target identifier corresponding to the target container group is obtained.
As an optional embodiment, the network plug-ins used by the target container cluster include a first network plug-in and a second network plug-in, where the second network plug-in is a network plug-in corresponding to a second container network that is not based on an elastic network card; the above-mentioned device still includes:
the configuration unit is used for configuring the target container network to the target container group under the condition that the target container group and the target cloud host are positioned in different network naming spaces according to the first target identification after the first target identification corresponding to the target container group is obtained;
and the third determining unit is used for determining that the target container group is a container group using a network interface provided by the elastic network card under the condition that the target container network is the first container network.
As an alternative embodiment, the apparatus further comprises:
the second acquisition unit is used for acquiring a second target identifier corresponding to the target container group under the condition that the target container network is a second container network after the target container group is configured with the affiliated target container network, wherein the second target identifier is used for indicating whether the target container group uses the elastic network card or not;
and a fourth determining unit, configured to determine that the target container group is a container group using a network interface provided by the flexible network card when it is determined that the target container group uses the flexible network card according to the second target identifier.
As an alternative embodiment, the apparatus further comprises:
a fifth determining unit, configured to determine, before a target container group is created on a target cloud host, a target network mode corresponding to a target container cluster to be created, where the target network mode is a network mode in which a first network plug-in and a second network plug-in coexist;
and the second creating unit is used for creating a target container cluster according to the target network mode, wherein the target container cluster allows the first network plug-in and the second network plug-in to be used.
As an alternative embodiment, the application unit 704 includes:
the system comprises a sending module, a target server program and a target server program, wherein the sending module is used for sending a target request message to the target server program, the target server program is a server program of a first network plug-in, and the target request message is used for requesting for applying an elastic network card or an auxiliary IP address of the elastic network card;
and the receiving module is used for receiving a target response message returned by the target server program, wherein the target response message is used for indicating the application result of the elastic network card or the auxiliary IP address of the elastic network card.
It should be noted that the modules described above are the same as examples and application scenarios realized by corresponding steps, but are not limited to what is disclosed in the foregoing embodiments. It should be noted that the modules described above as a part of the apparatus may be operated in a hardware environment as shown in fig. 1, and may be implemented by software, or may be implemented by hardware, where the hardware environment includes a network environment.
According to another aspect of the embodiments of the present application, there is also provided an electronic device for implementing the method for creating a container group, where the electronic device may be a server, a terminal, or a combination thereof.
Fig. 8 is a block diagram of an alternative electronic device according to an embodiment of the present application, as shown in fig. 8, including a processor 802, a communication interface 804, a memory 806, and a communication bus 808, where the processor 802, the communication interface 804, and the memory 806 are in communication with each other via the communication bus 808, where,
a memory 806 for storing a computer program;
the processor 802, when executing the computer program stored in the memory 806, performs the following steps:
creating a target container group on a target cloud host, wherein nodes belonging to a target container cluster are deployed on the target cloud host, and network plug-ins used by the target container cluster comprise first network plug-ins corresponding to a first container network based on an elastic network card;
under the condition that the target container group is determined to be the container group using the network interface provided by the elastic network card, applying for the elastic network card of the first network plug-in unit for the target container group;
and binding the target flexible network card to the target container group under the condition of applying for the target container group to the target flexible network card.
Alternatively, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 8, but this is not intended to represent only one bus or type of bus. The communication interface is used for communication between the electronic equipment and other equipment.
The memory may include RAM, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
As an example, the memory 806 may include, but is not limited to, the first creating unit 702, the applying unit 704, and the binding unit 706 in the creating apparatus including the above-described container group. In addition, the device may further include, but is not limited to, other module units in the creating apparatus of the container group, which is not described in this example again.
The processor may be a general-purpose processor, and may include but is not limited to: a CPU (Central Processing Unit), an NP (Network Processor), and the like; but also DSPs (Digital Signal Processing), ASICs (Application Specific Integrated circuits), FPGAs (Field-Programmable Gate arrays) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
Optionally, for a specific example in this embodiment, reference may be made to the example described in the foregoing embodiment, and this embodiment is not described herein again.
It can be understood by those skilled in the art that the structure shown in fig. 8 is only an illustration, and the device implementing the method for creating a container group may be a terminal device, and the terminal device may be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 8 is a diagram illustrating a structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 8, or have a different configuration than shown in FIG. 8.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disk, ROM, RAM, magnetic or optical disk, and the like.
According to still another aspect of an embodiment of the present application, there is also provided a storage medium. Optionally, in this embodiment, the storage medium may be configured to execute a program code of a method for creating a container group according to any one of the embodiments of the present application.
Optionally, in this embodiment, the storage medium may be located on at least one of a plurality of network devices in a network shown in the above embodiment.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
creating a target container group on a target cloud host, wherein nodes belonging to a target container cluster are deployed on the target cloud host, and network plug-ins used by the target container cluster comprise first network plug-ins corresponding to a first container network based on an elastic network card;
under the condition that the target container group is determined to be the container group using the network interface provided by the elastic network card, applying for the elastic network card of the first network plug-in unit for the target container group;
and binding the target flexible network card to the target container group under the condition of applying for the target container group to the target flexible network card.
Optionally, the specific example in this embodiment may refer to the example described in the above embodiment, which is not described again in this embodiment.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U disk, a ROM, a RAM, a removable hard disk, a magnetic disk, or an optical disk.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a storage medium, and including instructions for causing one or more computer devices (which may be personal computers, servers, network devices, or the like) to execute all or part of the steps of the method described in the embodiments of the present application.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, and may also be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution provided in the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. A method of creating a container group, comprising:
creating a target container group on a target cloud host, wherein nodes belonging to a target container cluster are deployed on the target cloud host, and network plug-ins used by the target container cluster comprise first network plug-ins corresponding to a first container network based on an elastic network card;
applying for the target container group for the elastic network card of the first network plug-in unit under the condition that the target container group is determined to be the container group using the network interface provided by the elastic network card;
and binding the target flexible network card to the target container group under the condition of applying for the target container group to the target flexible network card.
2. The method of claim 1, wherein after the creating the target group of containers on the target cloud host, the method further comprises:
acquiring a first target identifier corresponding to the target container group, wherein the first target identifier is used for indicating a network type used by the target container group;
and under the condition that the target container group and the target cloud host are located in the same network name space according to the first target identification, determining that the target container group is a container group using a network interface of the target cloud host.
3. The method of claim 2, wherein the network plug-in used by the target container cluster uses only a first network plug-in;
after the obtaining of the first target identifier corresponding to the target container group, the method further includes:
and under the condition that the target container group and the target cloud host are positioned in different network namespaces according to the first target identification, determining that the target container group is a container group using a network interface provided by an elastic network card.
4. The method of claim 2, wherein the network plug-ins used by the target container cluster include the first network plug-in and a second network plug-in, the second network plug-in being a network plug-in corresponding to a second container network that is not based on a resilient network card;
after the obtaining of the first target identifier corresponding to the target container group, the method further includes:
under the condition that the target container group and the target cloud host are determined to be located in different network namespaces according to the first target identification, configuring a target container network to which the target container group belongs for the target container group;
and under the condition that the target container network is the first container network, determining that the target container group is a container group using a network interface provided by an elastic network card.
5. The method of claim 4, wherein after configuring the target container network to which the target container group belongs for the target container group, the method further comprises:
under the condition that the target container network is the second container network, acquiring a second target identifier corresponding to the target container group, wherein the second target identifier is used for indicating whether the target container group uses an elastic network card or not;
and under the condition that the target container group is determined to use the elastic network card according to the second target identifier, determining the target container group as a container group using a network interface provided by the elastic network card.
6. The method of claim 4, wherein prior to said creating a target group of containers on a target cloud host, the method further comprises:
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 plug-in and the second network plug-in coexist;
and according to the target network mode, creating the target container cluster, wherein the target container cluster allows the first network plug-in and the second network plug-in to be used.
7. The method according to any one of claims 1 to 6, wherein the applying for the resilient network card of the first network plug-in for the target container group comprises:
sending a target request message to a target server program, wherein the target server program is a server program of the first network plug-in, and the target request message is used for requesting for applying for the elastic network card or an auxiliary IP address of the elastic network card;
and receiving a target response message returned by the target server program, wherein the target response message is used for indicating the application result of the elastic network card or the auxiliary IP address of the elastic network card.
8. An apparatus for creating a container group, comprising:
the system comprises a first creating unit, a second creating unit and a third creating unit, wherein the first creating unit is used for creating a target container group on a target cloud host, nodes belonging to a target container cluster are deployed on the target cloud host, and network plug-ins used by the target container cluster comprise first network plug-ins corresponding to a first container network based on an elastic network card;
an application unit, configured to apply for the flexible network 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 using a network interface provided by the flexible network card;
and the binding unit is used for binding the target flexible network card to the target container group under the condition that the target flexible network card is applied to the target container group.
9. An electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein said processor, said communication interface and said memory communicate with each other via said communication bus,
the memory for storing a computer program;
the processor for performing the method steps of any one of claims 1 to 7 by running the computer program stored on the memory.
10. A computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to carry out the method steps of any one of claims 1 to 7 when executed.
CN202110567560.5A 2021-05-24 2021-05-24 Method and device for creating container group, electronic equipment and storage medium Pending CN115469961A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110567560.5A CN115469961A (en) 2021-05-24 2021-05-24 Method and device for creating container group, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110567560.5A CN115469961A (en) 2021-05-24 2021-05-24 Method and device for creating container group, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115469961A true CN115469961A (en) 2022-12-13

Family

ID=84363544

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110567560.5A Pending CN115469961A (en) 2021-05-24 2021-05-24 Method and device for creating container group, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115469961A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115913937A (en) * 2023-01-09 2023-04-04 苏州浪潮智能科技有限公司 Container multi-network-card network configuration method, device, equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115913937A (en) * 2023-01-09 2023-04-04 苏州浪潮智能科技有限公司 Container multi-network-card network configuration method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN114244717B (en) Configuration method and device of virtual network card resources, computer equipment and medium
CN111163130B (en) Network service system and data transmission method thereof
CN106301829A (en) A kind of method and apparatus of Network dilatation
CN106453681B (en) IP address allocation method and device
CN107005435B (en) Network service descriptor shelving method and device
CN103281203A (en) Ecos (Embedded Configurable Operating System) system-based DHCP (Dynamic Host Configuration Protocol) address assignment management method
CN104461698A (en) Dynamic virtual disk mounting method, virtual disk management device and distributed storage system
CN110493028A (en) A kind of clustered deploy(ment) method, system, device and computer readable storage medium
CN112631780A (en) Resource scheduling method and device, storage medium and electronic equipment
CN112995247A (en) Method, device and system for transmitting or processing data
CN111064786B (en) Account identifier management method and device
CN115469961A (en) Method and device for creating container group, electronic equipment and storage medium
CN112748961A (en) Method and device for executing starting task
CN106685708B (en) Method, device and system for determining service relationship
CN116339927B (en) Equipment determining method, device, storage medium and electronic device
CN110417856B (en) Capacity expansion method, device, equipment and storage medium for multi-active load balancing application
CN111262771A (en) Virtual private cloud communication system, system configuration method and controller
CN114356456A (en) Service processing method, device, storage medium and electronic equipment
CN111126604B (en) Model training method, device, server and storage medium
CN114048028A (en) Service calling method and device, storage medium and electronic equipment
CN116264550A (en) Resource slice processing method and device, storage medium and electronic device
CN115826845A (en) Storage resource allocation method and device, storage medium and electronic device
CN114173396A (en) Method and device for determining terminal networking time, electronic equipment and storage medium
CN103490913A (en) Pre-boot execution environment testing device, method and system
CN109039711B (en) Hardware accelerator replacement method and device and server

Legal Events

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