This guide details the necessary prerequisites to install the L2S-M Kubernetes operator to create and manage virtual networks in your Kubernetes cluster!
This guide details the necessary steps to install the L2S-M Kubernetes operator to create and manage virtual networks in your Kubernetes cluster.
# Prerequisites
# Prerequisites
1. Clone the L2S-M repository in your host. This guide will assume that all commands are executed in the directory where L2S-M was downloaded.
1. Clone the L2S-M repository in your host. This guide will assume that all commands are executed in the directory where L2S-M was downloaded.
2.In order to start with the installation of L2S-M, it is necessary to set up the IP tunnel overlay between the nodes that you want to interconnect. To do so, **it is necessary to have 10 VXLAN interfaces (named vxlan1 up to vxlan10) in the host namespace.**
2.As a prerequisite to start with the installation of L2S-M, it is necessary to set up an IP tunnel overlay among the nodes of your k8s cluster (see [how L2S works](https://github.com/Networks-it-uc3m/L2S-M/tree/main/K8s). To do so, **the installation needs 10 VXLAN interfaces (named vxlan1 up to vxlan10) in the host namespace.**
This repository contains an script to generate the necessary 10 VXLANs with their respective names. To use the script, execute the following command in every node of your cluster:
This repository contains a script to generate the necessary 10 VXLANs with their respective names. To use the script, execute the following command in every node of your cluster (this is the **recommended option**):
```bash
```bash
sudo ./L2S-M/K8s/provision/vxlan.bash
sudo ./L2S-M/K8s/provision/vxlan.bash
```
```
If you want to manually create the VXLANs instead, you can use the following code for every VXLAN in most Linux distributions:
You may want to manually create the VXLANs instead. To that purpose, you can use the following command for every VXLAN in most Linux distributions:
```bash
```bash
sudo ip link add [vxlan_Name] type vxlan id[id] dev [interface_to_use] dstport [dst_port]
sudo ip link add [vxlan_Name] type vxlan id[id] dev [interface_to_use] dstport [dst_port]
```
```
**WARNING:** Make sure that the VXLAN id coincides between each tunnel pairs if you are manually creating the interfaces. You can use the following table in order to check the associated ids with each one of the VXLAN interfaces.
**WARNING:** Make sure that the VXLAN network identifier (VNI) is the same at every pair of k8s nodes terminating an IP tunnel, if you are manually creating the interfaces. In case that you use the script mentioned above for automatic VXLAN configuration, the VXLAN interface names and their corresponding VNIs are indicated in the table below.
| **VXLAN Name** |**ID** |
| **VXLAN Name** |**ID** |
|--|--|
|--|--|
...
@@ -34,19 +34,23 @@ sudo ip link add [vxlan_Name] type vxlan id [id] dev [interface_to_use] dstport
...
@@ -34,19 +34,23 @@ sudo ip link add [vxlan_Name] type vxlan id [id] dev [interface_to_use] dstport
| vxlan9 | 1969|
| vxlan9 | 1969|
| vxlan10 | 1970|
| vxlan10 | 1970|
3. To configure the VXLAN tunnels between neighbouring nodes, use the following command for every pair of interfaces you want to configure in their respective nodes:
3. To finish the configuration of a VXLAN tunnel between two neighboring k8s nodes, you can execute the following command at both K8s nodes:
```bash
```bash
sudo bridge fdb append to 00:00:00:00:00:00 dst [dst_IP] dev [vxlan_Name]
sudo bridge fdb append to 00:00:00:00:00:00 dst [dst_IP] dev [vxlan_Name]
```
```
where *dst_IP* must be replaced by the IP address of the neighboring K8s node in the VXLAN tunnel.
4. Create the vEth virtual interfaces in every host of the cluster by using the following script
4. Create a set of vEth virtual interfaces in every host of the K8s cluster. These interfaces are needed in L2S-M to support the attachment of pods to virtual networks. This can be done executing the following script:
5.
```bash
```bash
sudo ./L2S-M/K8s/provision/veth.bash
sudo ./L2S-M/K8s/provision/veth.bash
```
```
5. Install the Multus CNI Plugin in your K8s cluster. For more information on how to install Multus in your cluster, check their [official GitHub repository](https://github.com/k8snetworkplumbingwg/multus-cni).
5. Install the Multus CNI Plugin in your K8s cluster. For more information on how to install Multus in your cluster, check their [official GitHub repository](https://github.com/k8snetworkplumbingwg/multus-cni).
6. The host-device cni plugin must be able to be used in your cluster. If it is not present in your K8s distribution, you can find how to install it in your K8s cluster in their [official GitHub repository](https://github.com/containernetworking/plugins).
6. The host-device CNI plugin must be able to be used in your cluster. If it is not present in your K8s distribution, you can find how to install it in your K8s cluster in their [official GitHub repository](https://github.com/containernetworking/plugins).
7. Your K8s Controller node must be able to deploy K8s pods for the operator to work. Remove its master and control-plane taints using the following command:
7. Your K8s Controller node must be able to deploy K8s pods for the operator to work. Remove its master and control-plane taints using the following command:
**NOTE:** If you have introduced new interfaces in your cluster besides the vxlans, modify the descriptor to introduce those as well. (Modify both MULTUS annotations and the commands to attach the interface to the OVS switch).
**NOTE:** If you have introduced new interfaces in your cluster besides the VXLANs, you will need to modify the descriptor to introduce those as well (modify both MULTUS annotations and the commands to attach the interface to the OVS switch).
You are all set! If you want to learn how to create virtual networks and use them in your applications, [check the following section of the repository] (https://github.com/Networks-it-uc3m/L2S-M/tree/main/descriptors)
You are all set! If you want to learn how to create virtual networks and use them in your applications, [check the following section of the repository] (https://github.com/Networks-it-uc3m/L2S-M/tree/main/descriptors)