A method and system for building a multi-plane cloud teaching environment based on fixed IP
By creating multiple subnets in the cloud teaching environment and scheduling POD based on fixed IP scheduling, the problem of inconsistent teaching environment in the cloud teaching platform is solved, an isolated and isomorphic teaching environment is achieved, and the unity and standardization of cloud teaching is improved.
Patent Information
- Application Number
- CN202211518771.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-30
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2042-11-30
AI Technical Summary
When the existing cloud teaching platform builds a multi-planar teaching environment, it is difficult to achieve an isolated and isomorphic teaching environment, resulting in inconsistent mirroring of textbooks, affecting teaching progress and management complexity.
Several subnets of the cloud teaching environment are created using the bridge method or MACVLAN method, PODs are created for each subnet, and through functional verification and configuration, they are scheduled to the same node based on fixed IP, and a two-layer network structure is designed to ensure the isolation and isomorphism of the teaching environment.
It realizes a mutually isolated and isomorphic teaching environment, maintains the consistency between the teaching environment and the teaching mirror, improves the unity and standardization of cloud teaching, and simplifies the management process.
Smart Images

Figure CN116016099B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud teaching technology, and in particular to a method and system for building a multi-plane cloud teaching environment based on a fixed IP address. Background Art
[0002] With the advancement of the times, a large number of cloud teaching platforms have emerged, allowing students to study online without leaving home.
[0003] Currently, when cloud teaching platforms build teaching environments for textbooks, the host name and IP address are fixed. However, cloud teaching platforms usually require that the teaching environments of different students be isolated from each other. If a different namespace is assigned to each student, it will bring management complexity. For example, resource allocation, recycling, and monitoring will be difficult to unify. If the teaching environments of all students are in the same namespace, it is not allowed to build teaching environments with the same IP address, making it impossible for the teaching environment to be consistent with the textbook image. On the one hand, this affects the production of textbook images. For example, when IP addresses need to be configured, they cannot be pre-set, and students need to manually configure them in the teaching environment. On the other hand, since the teaching environment has many configurations, it is easy to cause problems. When problems occur, different treatments are often required due to different IP addresses, which will also affect the teaching progress.
[0004] Therefore, how to provide a method and system for building a multi-plane cloud teaching environment based on a fixed IP to achieve the construction of a mutually isolated and homogeneous teaching environment and maintain the consistency of the teaching environment and the teaching image has become a technical problem that needs to be solved urgently. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a method and system for building a multi-plane cloud teaching environment based on a fixed IP, so as to realize the construction of a mutually isolated and homogeneous teaching environment and maintain the consistency of the teaching environment and the teaching image.
[0006] In a first aspect, the present invention provides a method for building a multi-plane cloud teaching environment based on a fixed IP, comprising the following steps:
[0007] Step S10: creating several subnets of the cloud teaching environment based on a bridging method or a MACVLAN method;
[0008] Step S20: creating several PODs for each subnet;
[0009] Step S30: Perform functionality verification on the PODs in each subnet;
[0010] Step S40: Configure the PODs in each subnet so that they are dispatched to the same node based on a fixed IP address, thereby completing the construction of the cloud teaching environment.
[0011] Furthermore, in step S10, the several subnets of the cloud teaching environment created based on the MACVLAN method are specifically:
[0012] Select a network card from a host computer in a cloud teaching environment, virtualize the selected network card into several sub-network cards, and create a subnet based on each of the sub-network cards;
[0013] The name of each subnet is globally unique.
[0014] Furthermore, the step S20 is specifically as follows:
[0015] Based on the set host name and IP address, several PODs are created for each subnet.
[0016] Furthermore, the step S30 is specifically as follows:
[0017] The PODs in each subnet are subjected to functional verification including at least file transfer and SSH.
[0018] Furthermore, the step S40 is specifically as follows:
[0019] Add the bridge.yaml configuration file to the templates of the PODs in each subnet, and modify the deployment.yaml file in the templates to remove the anti-affinity scheduling configuration and add the affinity scheduling configuration to allow a group of PODs in the same subnet to be scheduled to the same node;
[0020] Add a fixed IP address for each POD in the deployment.yaml file to complete the construction of the cloud teaching environment.
[0021] In a second aspect, the present invention provides a multi-plane cloud teaching environment construction system based on a fixed IP, comprising the following modules:
[0022] The subnet creation module is used to create several subnets of the cloud teaching environment based on the bridging method or the MACVLAN method;
[0023] A POD creation module is used to create a plurality of PODs for each of the subnets;
[0024] A POD functionality verification module, configured to perform functionality verification on the PODs within each of the subnets;
[0025] The POD configuration module is used to configure the PODs in each subnet so that they are dispatched to the same node based on a fixed IP address, thereby completing the construction of the cloud teaching environment.
[0026] Furthermore, in the subnet creation module, the several subnets for creating the cloud teaching environment based on the MACVLAN method are specifically:
[0027] Select a network card from a host computer in a cloud teaching environment, virtualize the selected network card into several sub-network cards, and create a subnet based on each of the sub-network cards;
[0028] The name of each subnet is globally unique.
[0029] Furthermore, the POD creation module is specifically used to:
[0030] Based on the set host name and IP address, several PODs are created for each subnet.
[0031] Furthermore, the POD functionality verification module is specifically used to:
[0032] The PODs in each subnet are subjected to functional verification including at least file transfer and SSH.
[0033] Furthermore, the POD configuration module is specifically used to:
[0034] Add the bridge.yaml configuration file to the templates of the PODs in each subnet, and modify the deployment.yaml file in the templates to remove the anti-affinity scheduling configuration and add the affinity scheduling configuration to allow a group of PODs in the same subnet to be scheduled to the same node;
[0035] Add a fixed IP address for each POD in the deployment.yaml file to complete the construction of the cloud teaching environment.
[0036] The advantages of the present invention are:
[0037] 1. Create several subnets of the cloud teaching environment through bridging or MACVLAN, create several PODs for each subnet, and after functional verification of the PODs in each subnet, configure the PODs in each subnet so that they are dispatched to the same node based on a fixed IP address to complete the construction of the cloud teaching environment. That is, a two-layer network structure is designed. On the original single network architecture based on Kubernetes, an isolated and completely homogeneous subnet plane is built for each student, realizing the construction of a mutually isolated and homogeneous teaching environment, maintaining the consistency of the teaching environment and the teaching image, and thus greatly improving the uniformity and standardization of cloud teaching.
[0038] 2. Apply multi-plane network construction technology to the construction of cloud teaching environment, effectively improving the uniformity and standardization of cloud teaching environment; by building multiple homogeneous subnets under the same namespace of cloud teaching environment, a unified and isolated network structure is formed, which not only ensures the independence and integrity of each student's teaching environment, but also ensures the uniformity of courseware images and teaching materials; and by building homogeneous subnets, cloud teaching environment management and network management are integrated, simplifying the cloud environment management process, and eliminating the need to build different namespaces. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0040] Figure 1 This is a flow chart of a method for building a multi-plane cloud teaching environment based on a fixed IP address in the present invention.
[0041] Figure 2 It is a structural diagram of a multi-plane cloud teaching environment construction system based on fixed IP of the present invention.
[0042] Figure 3 It is a network architecture diagram of the present invention. DETAILED DESCRIPTION
[0043] The technical solution in the embodiments of the present application has the following overall idea: several subnets of the cloud teaching environment are created through bridging or MACVLAN, several PODs are created for each subnet, and the PODs in each subnet are configured so that they are scheduled to the same node. That is, a two-layer network structure is designed to build an isolated and completely homogeneous subnet plane for each student, so as to realize the construction of a mutually isolated and homogeneous teaching environment and maintain the consistency of the teaching environment and the teaching image.
[0044] Please refer to Figures 1 to 3 As shown, a preferred embodiment of the method for building a multi-plane cloud teaching environment based on a fixed IP of the present invention includes the following steps:
[0045] Step S10: Create several subnets of the cloud teaching environment based on the bridging method or the MACVLAN method. The bridging method requires affinity scheduling configuration, that is, aggregating each POD on the same node (host), reducing cross-node network calls, and improving the execution efficiency of teaching cases. The MACVLAN method supports distributing each POD on different nodes, which can solve problems such as unbalanced cloud platform resources and service port conflicts.
[0046] The bridging mode acts as a network switch between multiple PODs on the same node. It creates a bridge interface that is not linked to any physical host interface, so it will not establish a connection with any external network, including other PODs on other nodes, that is, the subnet cannot cross nodes; the MACVLAN mode is consistent with the traditional network connection and can cross nodes. Its connection uses each sub-interface with a MAC address to bind directly to the underlying network, that is, it must be linked to a specific network card.
[0047] Step S20: creating several PODs for each subnet;
[0048] Step S30: Perform functionality verification on the PODs in each subnet;
[0049] Step S40: Configure the PODs in each subnet so that they are dispatched to the same node based on a fixed IP address, thereby completing the construction of the cloud teaching environment.
[0050] In step S10, the multiple subnets of the cloud teaching environment created based on the MACVLAN method are specifically:
[0051] Select a network card from a host computer in a cloud teaching environment, virtualize the selected network card into several sub-network cards, and create a subnet based on each of the sub-network cards;
[0052] The name of each subnet is globally unique.
[0053] The step S20 is specifically as follows:
[0054] Based on the set host name and IP address, several PODs are created for each subnet.
[0055] The step S30 is specifically as follows:
[0056] The PODs in each subnet are subjected to functional verification including at least file transfer and SSH.
[0057] The step S40 is specifically as follows:
[0058] Since the cloud teaching environment is deployed using Helm in actual applications, the original chart needs to be modified to support multi-environment isomorphism with fixed IP addresses. That is, the bridge.yaml configuration file is added to the templates of the PODs in each subnet, and the deployment.yaml file in the templates is modified to remove the anti-affinity scheduling configuration and add the affinity scheduling configuration to allow a group of PODs in the same subnet to be scheduled to the same node.
[0059] Add a fixed IP address to each POD in the annotations of the deployment.yaml file to complete the construction of the cloud teaching environment.
[0060] A preferred embodiment of a multi-plane cloud teaching environment construction system based on fixed IP of the present invention includes the following modules:
[0061] The subnet creation module is used to create several subnets of the cloud teaching environment based on bridging or MACVLAN. The bridging method requires affinity scheduling configuration, that is, aggregating all PODs on the same node (host), reducing cross-node network calls and improving the execution efficiency of teaching cases. The MACVLAN method supports distributing each POD on different nodes, which can solve problems such as unbalanced cloud platform resources and service port conflicts.
[0062] The bridging mode acts as a network switch between multiple PODs on the same node. It creates a bridge interface that is not linked to any physical host interface, so it will not establish a connection with any external network, including other PODs on other nodes, that is, the subnet cannot cross nodes; the MACVLAN mode is consistent with the traditional network connection and can cross nodes. Its connection uses each sub-interface with a MAC address to bind directly to the underlying network, that is, it must be linked to a specific network card.
[0063] A POD creation module is used to create a plurality of PODs for each of the subnets;
[0064] A POD functionality verification module, configured to perform functionality verification on the PODs within each of the subnets;
[0065] The POD configuration module is used to configure the PODs in each subnet so that they are dispatched to the same node based on a fixed IP address, thereby completing the construction of the cloud teaching environment.
[0066] In the subnet creation module, the multiple subnets for creating the cloud teaching environment based on the MACVLAN method are specifically:
[0067] Select a network card from a host computer in a cloud teaching environment, virtualize the selected network card into several sub-network cards, and create a subnet based on each of the sub-network cards;
[0068] The name of each subnet is globally unique.
[0069] The POD creation module is specifically used to:
[0070] Based on the set host name and IP address, several PODs are created for each subnet.
[0071] The POD functional verification module is specifically used for:
[0072] The PODs in each subnet are subjected to functional verification including at least file transfer and SSH.
[0073] The POD configuration module is specifically used for:
[0074] Since the cloud teaching environment is deployed using Helm in actual applications, the original chart needs to be modified to support multi-environment isomorphism with fixed IP addresses. That is, the bridge.yaml configuration file is added to the templates of the PODs in each subnet, and the deployment.yaml file in the templates is modified to remove the anti-affinity scheduling configuration and add the affinity scheduling configuration to allow a group of PODs in the same subnet to be scheduled to the same node.
[0075] Add a fixed IP address to each POD in the annotations of the deployment.yaml file to complete the construction of the cloud teaching environment.
[0076] To facilitate understanding of the present invention, the following is further explained through examples and codes:
[0077] 1. Bridging method:
[0078] (1) Create a unique subnet for each training case.
[0079]
[0080]
[0081] (2) Create three pods. Assume that their host names are master, slave1, and slave2, and their IP addresses are 192.168.1.203, 192.168.1.204, and 192.168.1.205. (Using pods as an example, the Deployment, StatefulSet, and other YAML files can be modified accordingly.)
[0082]
[0083]
[0084]
[0085] (3) Start three PODs
[0086] Repeat the above process (1) to (3) to create different subnets and PODs, and verify file transfer, SSH and other functions between PODs in the subnet.
[0087] 2. MACVLAN mode:
[0088] (1) Create a MACVLAN subnet
[0089] ① Virtualize a network card (such as eh0) on the host machine (physical machine or virtual machine) into multiple sub-network cards
[0090] Install vconfig
[0091] Execute on all nodes:
[0092] #Confirm whether the kernel has loaded the 802.1q module
[0093] lsmod|grep 8021q
[0094] #If not loaded use this command to load the module
[0095] modprobe -a 8021q
[0096] #Configure the epel source
[0097] yum install epel-release-y
[0098] #Install vconfig
[0099] yum install vconfig-y
[0100] # Check whether it is effective through ip-a or ifconfig-a
[0101] (vconfig only needs to be installed once on each host)
[0102] Create and start the subnet card
[0103] #Use the vconfig command to configure a VLAN on eth0
[0104] vconfig add eth0 100 (Note: Each time a subnet card is created, the number is unique)
[0105] #Set the REORDER_HDR parameter of VLAN, the default is ok
[0106] vconfig set_flag eth0.100 1 1
[0107] #Enable the interface
[0108] ifconfig eth0.100 up
[0109] ②Create a subnet
[0110]
[0111]
[0112] (2) Create three pods. Assume that their host names are master, slave1, and slave2, and their IP addresses are 192.168.1.203, 192.168.1.204, and 192.168.1.205. (Using pods as an example, the Deployment, StatefulSet, and other YAML files can be modified accordingly.)
[0113]
[0114]
[0115]
[0116] (3) Start three PODs
[0117] Repeat the above process (1) to (3) to create different subnets and PODs, and verify file transfer, SSH and other functions between PODs in the subnet.
[0118] 3. Since the cloud teaching environment is deployed using Helm in actual applications, the original chart needs to be modified to support multi-environment isomorphism with fixed IP addresses:
[0119] (1) Add the bridge.yaml configuration file to the templates of the POD in each subnet. Copy it directly without modification. The network segment range defined by the second network card of the POD is
[0120]
[0121] (2) Modify the deployment.yaml file in templates.
[0122] Delete the anti-affinity scheduling configuration and add the affinity scheduling configuration to schedule a group of pods in the same subnet to the same node. The three deployment configurations are the same:
[0123]
[0124]
[0125] (3) Add a fixed IP address for each POD in the annotations of the deployment.yaml file. Define the IP addresses of the three PODs as: 192.170.1.201, 192.170.1.202, and 192.170.1.203.
[0126] k8s.v1.cni.cncf.io / networks:'[{"name":"{{.Values.nameStep1}}","ips":["192.170.1.201"]}]'
[0127] k8s.v1.cni.cncf.io / networks:'[{"name":"{{.Values.nameStep1}}","ips":["192.170.1.202"]}]'
[0128] k8s.v1.cni.cncf.io / networks:'[{"name":"{{.Values.nameStep1}}","ips":["192.170.1.203"]}]'.
[0129] In summary, the advantages of the present invention are:
[0130] 1. Create several subnets of the cloud teaching environment through bridging or MACVLAN, create several PODs for each subnet, and after functional verification of the PODs in each subnet, configure the PODs in each subnet so that they are dispatched to the same node based on a fixed IP address to complete the construction of the cloud teaching environment. That is, a two-layer network structure is designed. On the original single network architecture based on Kubernetes, an isolated and completely homogeneous subnet plane is built for each student, realizing the construction of a mutually isolated and homogeneous teaching environment, maintaining the consistency of the teaching environment and the teaching image, and thus greatly improving the uniformity and standardization of cloud teaching.
[0131] 2. Apply multi-plane network construction technology to the construction of cloud teaching environment, effectively improving the uniformity and standardization of cloud teaching environment; by building multiple homogeneous subnets under the same namespace of cloud teaching environment, a unified and isolated network structure is formed, which not only ensures the independence and integrity of each student's teaching environment, but also ensures the uniformity of courseware images and teaching materials; and by building homogeneous subnets, cloud teaching environment management and network management are integrated, simplifying the cloud environment management process, and eliminating the need to build different namespaces.
[0132] Although the specific embodiments of the present invention are described above, those skilled in the art should understand that the specific embodiments described are merely illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included within the scope of protection of the claims of the present invention.
Claims
1. A method for building a multi-plane cloud teaching environment based on a fixed IP, characterized by: The steps include: Step S10: creating several subnets of the cloud teaching environment based on a bridging method or a MACVLAN method; The method of creating several subnets of the cloud teaching environment based on the MACVLAN method is as follows: selecting a network card from a host computer of the cloud teaching environment, virtualizing the selected network card into several subnet cards, and creating a subnet based on each of the subnet cards; the name of each subnet is globally unique; Step S20: Based on the set host name and IP address, create several PODs for each subnet; Step S30: Perform functional verification on the PODs in each subnet, including at least file transfer and SSH. Step S40: Add a bridge.yaml configuration file to the templates of the PODs in each subnet, and modify the deployment.yaml file in the templates to delete the anti-affinity scheduling configuration and add the affinity scheduling configuration so that a group of PODs in the same subnet are scheduled to the same node; Add a fixed IP address for each POD in the deployment.yaml file to complete the construction of the cloud teaching environment.
2. A multi-plane cloud teaching environment construction system based on fixed IP, characterized by: Includes the following modules: The subnet creation module is used to create several subnets of the cloud teaching environment based on the bridging method or the MACVLAN method; The method of creating several subnets of the cloud teaching environment based on the MACVLAN method is as follows: selecting a network card from a host computer of the cloud teaching environment, virtualizing the selected network card into several subnet cards, and creating a subnet based on each of the subnet cards; the name of each subnet is globally unique; A POD creation module is used to create a number of PODs for each subnet based on the set host name and IP address; A POD functional verification module is used to perform functional verification of the PODs in each subnet, including at least file transfer and SSH; The POD configuration module is used to add the bridge.yaml configuration file to the templates of the PODs in each subnet and modify the deployment.yaml file in the templates to remove the anti-affinity scheduling configuration and add the affinity scheduling configuration so that a group of PODs in the same subnet are scheduled to the same node; Add a fixed IP address for each POD in the deployment.yaml file to complete the construction of the cloud teaching environment.
Citation Information
Patent Citations
Method and device for realizing fixed IP of pod, electronic equipment and readable storage medium
CN113986539A
Multi-level network deployment method and device, equipment and storage medium
CN114124714A