-
Alex ubuntu vm authoredAlex ubuntu vm authored
L2S-M Application Development Guide
Welcome to the L2S-M development guide. This README provides detailed instructions for setting up and developing L2S-M, which consists of four main components: l2sm-controller
, l2sm-operator
, l2sm-switch
, and l2sm-ned
. Follow the steps below to set up your development environment and deploy each component.
Table of Contents
Repository Structure
Below is a brief overview of the repository's structure and the purpose of major directories:
L2S-M
├── .vscode
│ └── launch.json
├── LICENSE
├── README.md
├── deployment
| └── custom-installation
├── build
... [shortened for brevity] ...
└── src
├── controller
├── operator
└── switch
In the L2S-M/src directory you will find the source code of each component, which is used to build the images in L2S-M/build.
Prerequisites
Before you begin, ensure you have met the following requirements:
- A kubernetes cluster you have complete access to.
- Multus installed in the cluster.
- For each component you're gonna develop, you may need specific tools and software.
- L2S-M custom installation. Install L2S-M up to the component you want to modify/debug/develop, and come back here to check how to proceed with the installation.
Component Development and Deployment
L2SM-Controller
-
Custom installation: The source code for
l2sm-controller
is hosted in a separate repository. Refer to it to see how this component works and how to change it and deploy it manually. -
Configuration: Specify the IP address the
l2sm-controller
is working on in thedeployOperator.yaml
anddeploySwitch.yaml
files, in the L2S-M/deployment/custom-installation/ directory. -
Custom Installation: Follow the custom installation instructions exactly as described in the
custom-installation
directory.
L2SM-Operator
Note: you need python3 and the requirements specified in the L2S-M/src/operator/requirements.txt to run it.
-
Custom Installation: Follow the custom installation steps up to the controller part.
-
Database Setup: Run the MySQL development database using
mysql-development.yaml
. -
Configuration: Update
launch.json
with thel2sm-controller
service IP and the database IP. This file has been made to help launching the application locally. -
Debugging: In Visual Studio Code, run the debug Kopf application. It will launch the app in a terminal, but it doesn't allow actual debugging tools such as custom breakpoints, as it's not a feature in kopf applications.
L2SM-Switch
-
Deployment: Deploy
l2sm-switch
normally, ensuring to comment outinitContainers
in the YAML file. Remove the initial configuration script by using as input args: ["sleep infinity"] -
Debugging: For debugging, remove the initial configuration script by and use
exec -it
on the pods to achieve the desired configuration. Since it doesn’t run any background process, no specific image is needed, the current one implements custom commands that enable the current configuration.