Skip to content
Snippets Groups Projects
Commit 5b3e1fdc authored by Julien Satti's avatar Julien Satti :sparkles:
Browse files

Align documentation guidelines

parent 6ab9c81f
No related branches found
No related tags found
1 merge request!17TeraFlowSDN Release 5
Pipeline #12254 passed
TFS documentation (c) by ETSI TFS documentation (c) ETSI
TFS documentation is licensed under a TFS documentation is licensed under a
Creative Commons Attribution 4.0 International License. Creative Commons Attribution 4.0 International License.
......
...@@ -2,96 +2,6 @@ ...@@ -2,96 +2,6 @@
This respository contains the documentation of TeraFlowSDN. This respository contains the documentation of TeraFlowSDN.
## How it works? ## Getting Started
There are 2 ways to upgrade documentation published on [TFS Documentation]: Please check the relevant document at [doc/contribute/documenting.md](documenting.md).
* Push any change on **develop** branch will force update of **develop** version on [TFS Documentation]. \ No newline at end of file
* Create a tag, this will create a version with tag name on [TFS Documentation].
## Repository Branches
This documentation repository has 2 protected branches:
* **main**
* This branch will store the information stable.
* **develop**
* Any change uploaded on this branch will upgrade **develop** version on documentation published on [TFS Documentation]
## What should be the flow to add documentation during development
The steps to upgrade documentation are:
1. Perform the development of functionality on tfs code respository.
2. Create an issue on [Documentation Gitlab](https://labs.etsi.org/rep/tfs/documentation/-/issues)
3. Create new branch with source from **develop**.
4. Update documentation:
1. ***Remember to update index.md with new functionalities for latest version***
2. New testplan is defined? **Update test plan documentation**
5. Check if all new documentation is ok using **mike** [Checking documentation with local deployment](#checking-documentation-with-local-deployment) section.
6. Push changes to branch.
7. Create Merge Request.
8. Send Merge Request to one TSC Member to approve it.
## Release new version of documentation
When **TeraFlowSDN** code repository is ready to share a new release we need to follow next steps by a **TSC Member**:
1. Create a new branch with released version, and merge it to **develop**.
2. Create a Merge request from **develop** to **main**.
3. When develop is merged to **main**, then we need to **create a tag with released version.**
## Checking documentation with local deployment
The easy way to check if documentation will be generated properly is check locally with [mike utility](https://github.com/jimporter/mike).
## Requirements
1. You will need python or any python virtual environment installed on your computer with **pip**.
2. Install mike and mkdocs-material:
```
pip install -q mkdocs-material mike
```
3. Set default tag:
```
mike set-default --allow-undefined version1
```
4. Run mike development server:
```
mike deploy version1; mike serve
```
5. Use any web browser to reach http://localhost:8000/version1/
> **To see changes on documentation you will need to restart mike server**
## What is the documentation structure
At mkdocs.yml you will have the navigation structure of documentation, there you can sections with sub-sections. after semicolon you can place the markdown to use on it. For example:
```
nav:
- Overview:
- Introduction: index.md
- Getting Started:
- How to Run: ./gettingstarted/howtorun.md
- Testing:
- Test Plan: ./testing/testplan/README.md
- Robot Framework: ./testing/robotframework/README.md
- Postman: ./testing/postman/README.md
- FAQ: ./FAQ.md
```
As you can see, in the example, we have 4 main sections:
* Overview:
* Here we must place high level information like, version changelog, some inital scripts, ...
* Getting Started:
* This section must contain a simple way to start working with project.
* Testing:
* Detailed information of **how to test** TeraFlowSDN, and test plan developed to ensure the code has all implemented functionallity checked.
* FAQ
## Main page
The page shown on first view is at **doc/index.md**
That page should be updated with latest changes on TFS, also including the version.
[TFS Web]: https://tfs.etsi.org/ "TFS Web"
[TFS Documentation]: https://tfs.etsi.org/documentation/ "TFS Documentation"
\ No newline at end of file
# Documenting
TeraFlowSDN's documentation runs on [MkDocs](https://www.mkdocs.org/).
## Eligibility
Documenting TeraFlowSDN is limited to active contributors. So, if you:
1. are an active member or participant;
2. wish to contribute to it;
3. you're ready!
## System and Structure
[MkDocs](https://www.mkdocs.org/) is a fast and simple static site generator that's geared towards building project documentation. Documentation source files are written in `Markdown`, and configured with a single `YAML` configuration file. Start by reading the [introductory tutorial](https://www.mkdocs.org/getting-started/), then check the [User Guide](https://www.mkdocs.org/user-guide/) for more information.
### How does it work?
There are 2 ways to upgrade documentation published on the [TFS Documentation] website:
* Push any change on **develop** branch will force update of the **develop** version on the [TFS Documentation] website;
* Create a tag, this will create a version with the tag name on the [TFS Documentation] website.
### Branches
This documentation repository has 2 protected branches:
* **main**: stable timeline on which tags are made;
* **develop**: edge timeline, also published on the [TFS Documentation] website.
### Structure
In the `mkdocs.yml` file you will find the navigation structure of the documentation, there you can sections with sub-sections.
*For example:*
```yaml
nav:
- 0. Home : ./index.md
- 1. Deployment Guide: ./deployment_guide.md
- 2. Development Guide: ./development_guide.md
- 3. Run Experiments: ./run_experiments.md
- 4. Feature and bugs: ./features_and_bugs.md
- 5. Supported SBIs and Network Elements: ./supported_sbis_and_network_elements.md
- 6. Supported NBIs: ./supported_nbis.md
- 7. Supported Service Handlers: ./supported_service_handlers.md
- 8. Troubleshooting: ./troubleshooting.md
- 9. FAQ: ./faq.md
```
Please take a moment to understand the current structure of the documentations and think to update after contributing if necessary.
### Main Page
The page shown first is at **doc/index.md**. That page should be updated with the latest changes of TeraFlowSDN and should reference the version (useful shortcut is ``{{{ documentation_version }}}``).
## Getting Started
To contribute to TeraFlowSDN's documentation, you need to follow these easy steps:
1) Clone the [Documentation repository](https://labs.etsi.org/rep/tfs/documentation) with:
```bash
git clone https://labs.etsi.org/rep/tfs/documentation.git
```
2) Checkout the develop branch (incoming contributions are only accepted to the **develop** branch):
```bash
cd ./documentation
git checkout develop
```
3) Setup a virtual environment:
* On Linux/macOS:
```bash
python3 -m venv venv # Linux/macOS
source venv/bin/activate #Linux/macOS
```
* On Windows:
```bash
python -m venv venv # Windows
venv\Scripts\activate # Windows
```
4) Setup a local ``mkdocs`` server by installing requirements:
```bash
python -m pip install -r requirements.txt
```
4) Wait for all downloads to finish and start the local ``mkdocs`` server:
```bash
mkdocs serve
```
5) Document! 😊
> You should always make sure that the local *MkDocs* server terminal is not producing any `INFO`/``WARNING`` messages regarding your contributions.
### Add Documentation During Development
To update the documentation properly during development, follow those additional steps:
1. Create an issue on the documentation [GitLab](https://labs.etsi.org/rep/tfs/documentation/-/issues) repository;
2. Create a new branch with the **develop** branch as a source;
3. Update the documentation and any relevant parts (ie: the ``index.md`` with new functionalities for the latest version);
4. Check if errors are not being produced by ``mkdocs`` [locally](#getting-started);
5. Commit and push changes to the new branch;
6. Create a MR request towards **develop**;
7. Send the request for review and approval to at least one **TSC Member**.
> The documentation website supports branches, so your accepted changes will be reflected to the **develop** branch which then becomes the **release** branch after each corresponding cycle.
### Release a New Version of the Documentation
When **TeraFlowSDN** code repository is ready for a new release, we need to follow these steps (made by a **TSC Member**):
1. Create a MR from **develop** towards **main**;
2. When **develop** is merged to **main**... then **create a tag with the released version** scheme... and you're done!
[TFS Web]: https://tfs.etsi.org/ "TFS Web"
[TFS Documentation]: https://tfs.etsi.org/documentation/ "TFS Documentation"
...@@ -3,7 +3,7 @@ The guide includes the details on configuring and installing the machine, instal ...@@ -3,7 +3,7 @@ The guide includes the details on configuring and installing the machine, instal
configuring MicroK8s, and deploying and reporting the status of the TeraFlowSDN configuring MicroK8s, and deploying and reporting the status of the TeraFlowSDN
controller. controller.
## **1.1. Configure your Machine** ## 1.1. Configure your Machine
In this section, we describe how to configure a machine (physical or virtual) to be used as the deployment, execution, and development environment for the ETSI TeraFlowSDN controller. Choose your preferred environment below and follow the instructions provided. In this section, we describe how to configure a machine (physical or virtual) to be used as the deployment, execution, and development environment for the ETSI TeraFlowSDN controller. Choose your preferred environment below and follow the instructions provided.
...@@ -17,7 +17,7 @@ Virtualization platforms tested are: ...@@ -17,7 +17,7 @@ Virtualization platforms tested are:
- [OpenStack](#114-openstack) - [OpenStack](#114-openstack)
- [Vagrant Box](#115-vagrant-box) - [Vagrant Box](#115-vagrant-box)
### **1.1.1. Physical Server** ### 1.1.1. Physical Server
This section describes how to configure a physical server for running ETSI TeraFlowSDN(TFS) controller. This section describes how to configure a physical server for running ETSI TeraFlowSDN(TFS) controller.
<h3><u>Server Specifications</u></h3> <h3><u>Server Specifications</u></h3>
...@@ -51,10 +51,12 @@ Given that TeraFlowSDN follows a micro-services architecture, for the deployment ...@@ -51,10 +51,12 @@ Given that TeraFlowSDN follows a micro-services architecture, for the deployment
<h3><u>Clusterized Deployment</u></h3> <h3><u>Clusterized Deployment</u></h3>
You might consider creating a cluster of machines each featuring, at least, the minimum server specifications. That solution brings you scalability in the future. You might consider creating a cluster of machines each featuring, at least, the minimum server specifications. That solution brings you scalability in the future.
<h3><u>Networking</u></h3> <h3><u>Networking</u></h3>
No explicit indications are given in terms of networking besides that servers need access to the Internet for downloading dependencies, binaries, and packages while building and deploying the TeraFlowSDN components. No explicit indications are given in terms of networking besides that servers need access to the Internet for downloading dependencies, binaries, and packages while building and deploying the TeraFlowSDN components.
Besides that, the network requirements are essentially the same than that required for running a classical Kubernetes environment. To facilitate the deployment, we extensively use [MicroK8s](https://microk8s.io/), thus the network requirements are, essentially, the same demanded by MicroK8s, especially, if you consider creating a Kubernetes cluster. Besides that, the network requirements are essentially the same than that required for running a classical Kubernetes environment. To facilitate the deployment, we extensively use [MicroK8s](https://microk8s.io/), thus the network requirements are, essentially, the same demanded by MicroK8s, especially, if you consider creating a Kubernetes cluster.
...@@ -104,34 +106,35 @@ Below we provide some installation guidelines: ...@@ -104,34 +106,35 @@ Below we provide some installation guidelines:
- Restart the VM when the installation is completed. - Restart the VM when the installation is completed.
<h3><u>Upgrade the Ubuntu distribution</u></h3> <h3><u>Upgrade the Ubuntu distribution</u></h3>
```bash ```bash
sudo apt-get update -y sudo apt-get update -y
sudo apt-get dist-upgrade -y sudo apt-get dist-upgrade -y
``` ```
- If asked to restart services, restart the default ones proposed. - If asked to restart services, restart the default ones proposed.
- Restart the VM when the installation is completed. - Restart the VM when the installation is completed.
### **1.1.2. Oracle Virtual Box** ### 1.1.2. Oracle Virtual Box
This section describes how to configure a VM for running ETSI TeraFlowSDN(TFS) controller using [Oracle VirtualBox](https://www.virtualbox.org/). It has been tested with VirtualBox up to version 6.1.40 r154048. This section describes how to configure a VM for running ETSI TeraFlowSDN(TFS) controller using [Oracle VirtualBox](https://www.virtualbox.org/). It has been tested with VirtualBox up to version 6.1.40 r154048.
<h3><u>Create a NAT Network in VirtualBox</u></h3> <h3><u>Create a NAT Network in VirtualBox</u></h3>
In "Oracle VM VirtualBox Manager", Menu "File > Preferences... > Network", create a NAT
network with the following specifications: In "Oracle VM VirtualBox Manager", Menu "File > Preferences... > Network", create a NAT network with the following specifications:
|Name |CIDR |DHCP |IPv6 | |Name |CIDR |DHCP |IPv6 |
|-----------|-----------|--------|--------| |-----------|-----------|--------|--------|
|TFS-NAT-Net|10.0.2.0/24|Disabled|Disabled| |TFS-NAT-Net|10.0.2.0/24|Disabled|Disabled|
Within the newly created "TFS-NAT-Net" NAT network, configure the following IPv4 Within the newly created "TFS-NAT-Net" NAT network, configure the following IPv4 forwarding rules:
forwarding rules:
|Name|Protocol|Host IP |Host Port|Guest IP |Guest Port| |Name|Protocol|Host IP |Host Port|Guest IP |Guest Port|
|----|--------|---------|---------|---------|----------| |----|--------|---------|---------|---------|----------|
|SSH |TCP |127.0.0.1|2200 |10.0.2.10|22 | |SSH |TCP |127.0.0.1|2200 |10.0.2.10|22 |
|HTTP|TCP |127.0.0.1|8080 |10.0.2.10|80 | |HTTP|TCP |127.0.0.1|8080 |10.0.2.10|80 |
__Note__: IP address 10.0.2.10 is the one that will be assigned to the VM. > __Note__: IP address 10.0.2.10 is the one that will be assigned to the VM.
<h3><u>Create VM in VirtualBox:</u></h3> <h3><u>Create VM in VirtualBox:</u></h3>
...@@ -148,12 +151,12 @@ __Note__: IP address 10.0.2.10 is the one that will be assigned to the VM. ...@@ -148,12 +151,12 @@ __Note__: IP address 10.0.2.10 is the one that will be assigned to the VM.
- Audio: disabled - Audio: disabled
- Boot order: disable "Floppy" - Boot order: disable "Floppy"
__Note__: (*) settings to be editing after the VM is created. > __Note__: (*) settings to be editing after the VM is created.
<h3><u>Install Ubuntu 22.04 LTS Operating System</u></h3> <h3><u>Install Ubuntu 22.04 LTS Operating System</u></h3>
In "Oracle VM VirtualBox Manager", start the VM in normal mode, and follow the In "Oracle VM VirtualBox Manager", start the VM in normal mode, and follow the installation procedure.
installation procedure.
Below we provide some installation guidelines: Below we provide some installation guidelines:
- Installation Language: English - Installation Language: English
...@@ -189,10 +192,10 @@ Below we provide some installation guidelines: ...@@ -189,10 +192,10 @@ Below we provide some installation guidelines:
sudo apt-get update -y sudo apt-get update -y
sudo apt-get dist-upgrade -y sudo apt-get dist-upgrade -y
``` ```
- If asked to restart services, restart the default ones proposed. - If asked to restart services, restart the default ones proposed.
- Restart the VM when the installation is completed. - Restart the VM when the installation is completed.
**Install VirtualBox Guest Additions** **Install VirtualBox Guest Additions**
On VirtualBox Manager, open the VM main screen. If you are running the VM in headless On VirtualBox Manager, open the VM main screen. If you are running the VM in headless
...@@ -203,6 +206,7 @@ pressing "Switch" button. The interface of the VM should appear. ...@@ -203,6 +206,7 @@ pressing "Switch" button. The interface of the VM should appear.
Click menu "Device > Insert Guest Additions CD image..." Click menu "Device > Insert Guest Additions CD image..."
On the VM terminal, type: On the VM terminal, type:
```bash ```bash
sudo apt-get install -y linux-headers-$(uname -r) build-essential dkms sudo apt-get install -y linux-headers-$(uname -r) build-essential dkms
# This command might take some minutes depending on your VM specs and your Internet access speed. # This command might take some minutes depending on your VM specs and your Internet access speed.
...@@ -213,7 +217,7 @@ sudo ./VBoxLinuxAdditions.run ...@@ -213,7 +217,7 @@ sudo ./VBoxLinuxAdditions.run
sudo reboot sudo reboot
``` ```
### **1.1.3. VMWare Fusion** ### 1.1.3. VMWare Fusion
This section describes how to configure a VM for running ETSI TeraFlowSDN(TFS) controller using [VMWare Fusion](https://www.vmware.com/products/fusion.html). It has been tested with VMWare Fusion version 12 and 13. This section describes how to configure a VM for running ETSI TeraFlowSDN(TFS) controller using [VMWare Fusion](https://www.vmware.com/products/fusion.html). It has been tested with VMWare Fusion version 12 and 13.
...@@ -266,12 +270,13 @@ The installation will be automatic, without any configuration required. ...@@ -266,12 +270,13 @@ The installation will be automatic, without any configuration required.
- Restart the VM when the installation is completed. - Restart the VM when the installation is completed.
<h3><u>Upgrade the Ubuntu distribution</u></h3> <h3><u>Upgrade the Ubuntu distribution</u></h3>
```bash ```bash
sudo apt-get update -y sudo apt-get update -y
sudo apt-get dist-upgrade -y sudo apt-get dist-upgrade -y
``` ```
### **1.1.4. OpenStack** ### 1.1.4. OpenStack
This section describes how to configure a VM for running ETSI TeraFlowSDN(TFS) controller using [OpenStack](https://www.openstack.org/). It has been tested with OpenStack Kolla up to Yoga version. This section describes how to configure a VM for running ETSI TeraFlowSDN(TFS) controller using [OpenStack](https://www.openstack.org/). It has been tested with OpenStack Kolla up to Yoga version.
...@@ -289,7 +294,7 @@ Add the following rules: ...@@ -289,7 +294,7 @@ Add the following rules:
|Egress |IPv4 |Any |Any |0.0.0.0/0| |Egress |IPv4 |Any |Any |0.0.0.0/0|
|Egress |IPv6 |Any |Any |::/0| |Egress |IPv6 |Any |Any |::/0|
__Note__: The IP address will be assigned depending on the network you have configured inside OpenStack. This IP will have to be modified in TeraFlow configuration files which by default use IP 10.0.2.10 > __Note__: The IP address will be assigned depending on the network you have configured inside OpenStack. This IP will have to be modified in TeraFlow configuration files which by default use IP 10.0.2.10
<h3><u>Create a flavour</h3></u> <h3><u>Create a flavour</h3></u>
...@@ -303,9 +308,11 @@ Go to Admin - Compute - Flavors and press Create Flavor ...@@ -303,9 +308,11 @@ Go to Admin - Compute - Flavors and press Create Flavor
- Root Disk (GB): 60 - Root Disk (GB): 60
**From CLI** **From CLI**
``` ```
openstack flavor create TFS --id auto --ram 8192 --disk 60 --vcpus 8 openstack flavor create TFS --id auto --ram 8192 --disk 60 --vcpus 8
``` ```
<h3><u>Create an instance in OpenStack:</h3></u> <h3><u>Create an instance in OpenStack:</h3></u>
- Instance name: TFS-VM - Instance name: TFS-VM
...@@ -332,10 +339,11 @@ ssh_pwauth: True ...@@ -332,10 +339,11 @@ ssh_pwauth: True
sudo apt-get update -y sudo apt-get update -y
sudo apt-get dist-upgrade -y sudo apt-get dist-upgrade -y
``` ```
- If asked to restart services, restart the default ones proposed. - If asked to restart services, restart the default ones proposed.
- Restart the VM when the installation is completed. - Restart the VM when the installation is completed.
### **1.1.5. Vagrant Box** ### 1.1.5. Vagrant Box
This section describes how to create a Vagrant Box, using the base virtual machine configured in [Oracle Virtual Box](#112-oracle-virtual-box). This section describes how to create a Vagrant Box, using the base virtual machine configured in [Oracle Virtual Box](#112-oracle-virtual-box).
...@@ -357,6 +365,7 @@ Also, before initiating the VM and installing the OS, we'll need to: ...@@ -357,6 +365,7 @@ Also, before initiating the VM and installing the OS, we'll need to:
- Ensure Network Adapter 1 is set to NAT - Ensure Network Adapter 1 is set to NAT
<h3><u>Network configurations</h3></u> <h3><u>Network configurations</h3></u>
At Network Adapt 1, the following port-forwarding rule must be set. At Network Adapt 1, the following port-forwarding rule must be set.
| Name | Protocol | Host IP | Host Port | Guest IP | Guest Port | | Name | Protocol | Host IP | Host Port | Guest IP | Guest Port |
...@@ -380,6 +389,7 @@ Make sure the disk is not configured as an LVM group! ...@@ -380,6 +389,7 @@ Make sure the disk is not configured as an LVM group!
![Screenshot_from_2023-07-10_18-43-16](../images/deployment_guide/06_vagrant_box.jpg) ![Screenshot_from_2023-07-10_18-43-16](../images/deployment_guide/06_vagrant_box.jpg)
<h3><u>Vagrant ser</h3></u> <h3><u>Vagrant ser</h3></u>
Vagrant expects by default, that in the box's OS exists the user `vagrant` with the password also being `vagrant`. Vagrant expects by default, that in the box's OS exists the user `vagrant` with the password also being `vagrant`.
![Screenshot_from_2023-07-10_18-54-12](../images/deployment_guide/07_vagrant_box.jpg) ![Screenshot_from_2023-07-10_18-54-12](../images/deployment_guide/07_vagrant_box.jpg)
...@@ -399,6 +409,7 @@ Do not install featured server snaps. It will be done manually [later](#12-insta ...@@ -399,6 +409,7 @@ Do not install featured server snaps. It will be done manually [later](#12-insta
Let the system install and upgrade the packages. This operation might take some minutes depending on how old is the Optical Drive ISO image you use and your Internet connection speed. Let the system install and upgrade the packages. This operation might take some minutes depending on how old is the Optical Drive ISO image you use and your Internet connection speed.
<h3><u>Upgrade the Ubuntu distribution</h3></u> <h3><u>Upgrade the Ubuntu distribution</h3></u>
```bash ```bash
sudo apt-get update -y sudo apt-get update -y
sudo apt-get dist-upgrade -y sudo apt-get dist-upgrade -y
...@@ -407,10 +418,9 @@ sudo apt-get dist-upgrade -y ...@@ -407,10 +418,9 @@ sudo apt-get dist-upgrade -y
- Restart the VM when the installation is completed. - Restart the VM when the installation is completed.
<h3><u>Install VirtualBox Guest Additions</h3></u> <h3><u>Install VirtualBox Guest Additions</h3></u>
On VirtualBox Manager, open the VM main screen. If you are running the VM in headless
mode, right-click over the VM in the VirtualBox Manager window, and click "Show". On VirtualBox Manager, open the VM main screen. If you are running the VM in headless mode, right-click over the VM in the VirtualBox Manager window, and click "Show".
If a dialog informing about how to leave the interface of the VM is shown, confirm If a dialog informing about how to leave the interface of the VM is shown, confirm by pressing the "Switch" button. The interface of the VM should appear.
by pressing the "Switch" button. The interface of the VM should appear.
Click the menu "Device > Insert Guest Additions CD image..." Click the menu "Device > Insert Guest Additions CD image..."
...@@ -426,42 +436,55 @@ sudo reboot ...@@ -426,42 +436,55 @@ sudo reboot
``` ```
<h3><u>ETSI TFS Installation</h3></u> <h3><u>ETSI TFS Installation</h3></u>
After this, proceed to [1.2. Install Microk8s](#12-install-microk8s), after which, return to this wiki to finish the Vagrant Box creation. After this, proceed to [1.2. Install Microk8s](#12-install-microk8s), after which, return to this wiki to finish the Vagrant Box creation.
<h3><u>Box configuration and creation</h3></u> <h3><u>Box configuration and creation</h3></u>
Make sure the ETSI TFS controller is correctly configured. **You will not be able to change it after!** Make sure the ETSI TFS controller is correctly configured. **You will not be able to change it after!**
It is advisable to do the next configurations from a host's terminal, via a SSH connection. It is advisable to do the next configurations from a host's terminal, via a SSH connection.
```bash ```bash
ssh -p 2222 vagrant@127.0.0.1 ssh -p 2222 vagrant@127.0.0.1
``` ```
<h3><u>Set root password</h3></u> <h3><u>Set root password</h3></u>
Set the root password to `vagrant`.
Set the root password to `vagrant`:
```bash ```bash
sudo passwd root sudo passwd root
``` ```
<h3><u>Set the superuser</h3></u> <h3><u>Set the superuser</h3></u>
Set up the Vagrant user so that it’s able to use sudo without being prompted for a password. Set up the Vagrant user so that it’s able to use sudo without being prompted for a password.
Anything in the `/etc/sudoers.d/*` directory is included in the sudoers privileges when created by the root user.
Anything in the ``/etc/sudoers.d/*`` directory is included in the sudoers privileges when created by the root user.
Create a new sudo file. Create a new sudo file.
```bash ```bash
sudo visudo -f /etc/sudoers.d/vagrant sudo visudo -f /etc/sudoers.d/vagrant
``` ```
and add the following lines and add the following lines
```text ```text
# add vagrant user # add vagrant user
vagrant ALL=(ALL) NOPASSWD:ALL vagrant ALL=(ALL) NOPASSWD:ALL
``` ```
You can now test that it works by running a simple command. You can now test that it works by running a simple command.
```bash ```bash
sudo pwd sudo pwd
``` ```
Issuing this command should result in an immediate response without a request for a password. Issuing this command should result in an immediate response without a request for a password.
<h3><u>Install the Vagrant key</h3></u> <h3><u>Install the Vagrant key</h3></u>
Vagrant uses a default set of SSH keys for you to directly connect to boxes via the CLI command `vagrant ssh`, after which it creates a new set of SSH keys for your new box. Because of this, we need to load the default key to be able to access the box after created. Vagrant uses a default set of SSH keys for you to directly connect to boxes via the CLI command `vagrant ssh`, after which it creates a new set of SSH keys for your new box. Because of this, we need to load the default key to be able to access the box after created.
```bash ```bash
chmod 0700 /home/vagrant/.ssh chmod 0700 /home/vagrant/.ssh
wget --no-check-certificate https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub -O /home/vagrant/.ssh/authorized_keys wget --no-check-certificate https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub -O /home/vagrant/.ssh/authorized_keys
...@@ -470,35 +493,47 @@ chown -R vagrant /home/vagrant/.ssh ...@@ -470,35 +493,47 @@ chown -R vagrant /home/vagrant/.ssh
``` ```
<h3><u>Configure the OpenSSH Server</h3></u> <h3><u>Configure the OpenSSH Server</h3></u>
Edit the `/etc/ssh/sshd_config` file: Edit the `/etc/ssh/sshd_config` file:
```bash ```bash
sudo vim /etc/ssh/sshd_config sudo vim /etc/ssh/sshd_config
``` ```
And uncomment the following line: And uncomment the following line:
```bash ```bash
AuthorizedKeysFile %h/.ssh/authorized_keys AuthorizedKeysFile %h/.ssh/authorized_keys
``` ```
Then restart SSH. Then restart SSH.
```bash ```bash
sudo service ssh restart sudo service ssh restart
``` ```
<h3><u>Package the box</h3></u> <h3><u>Package the box</h3></u>
Before you package the box, if you intend to make your box public, it is best to clean your bash history with: Before you package the box, if you intend to make your box public, it is best to clean your bash history with:
```bash ```bash
history -c history -c
``` ```
Exit the SSH connection, and **at you're host machine**, package the VM: Exit the SSH connection, and **at you're host machine**, package the VM:
```bash ```bash
vagrant package --base teraflowsdncontroller --output teraflowsdncontroller.box vagrant package --base teraflowsdncontroller --output teraflowsdncontroller.box
``` ```
<h3><u>Test run the box</h3></u> <h3><u>Test run the box</h3></u>
Add the base box to you local Vagrant box list: Add the base box to you local Vagrant box list:
```bash ```bash
vagrant box add --name teraflowsdncontroller ./teraflowsdncontroller.box vagrant box add --name teraflowsdncontroller ./teraflowsdncontroller.box
``` ```
Now you should try to run it, for that you'll need to create a **Vagrantfile**. For a simple run, this is the minimal required code for this box: Now you should try to run it, for that you'll need to create a **Vagrantfile**. For a simple run, this is the minimal required code for this box:
```ruby ```ruby
# -*- mode: ruby -*- # -*- mode: ruby -*-
# vi: set ft=ruby : # vi: set ft=ruby :
...@@ -509,11 +544,14 @@ Vagrant.configure("2") do |config| ...@@ -509,11 +544,14 @@ Vagrant.configure("2") do |config|
config.vm.network :forwarded_port, host: 8080 ,guest: 80 config.vm.network :forwarded_port, host: 8080 ,guest: 80
end end
``` ```
Now you'll be able to spin up the virtual machine by issuing the command: Now you'll be able to spin up the virtual machine by issuing the command:
```bash ```bash
vagrant up vagrant up
``` ```
And connect to the machine using: And connect to the machine using:
```bash ```bash
vagrant ssh vagrant ssh
``` ```
...@@ -567,6 +605,7 @@ BRANCH=develop vagrant up controller ...@@ -567,6 +605,7 @@ BRANCH=develop vagrant up controller
``` ```
<h3><u>Linkerd DNS rebinding bypass</h3></u> <h3><u>Linkerd DNS rebinding bypass</h3></u>
Because of Linkerd's security measures against DNS rebinding, a reverse proxy, that modifies the request's header `Host` field, is needed to expose the GUI to the host. The previous Vagrantfile already deploys such configurations, for that, all you need to do is create the `reverse-proxy-linkerdviz.sh` file in the same directory. The content of this file is displayed below. Because of Linkerd's security measures against DNS rebinding, a reverse proxy, that modifies the request's header `Host` field, is needed to expose the GUI to the host. The previous Vagrantfile already deploys such configurations, for that, all you need to do is create the `reverse-proxy-linkerdviz.sh` file in the same directory. The content of this file is displayed below.
```bash ```bash
...@@ -601,7 +640,7 @@ linkerd viz dashboard & ...@@ -601,7 +640,7 @@ linkerd viz dashboard &
echo "Linkerd Viz dashboard running!" echo "Linkerd Viz dashboard running!"
``` ```
## **1.2. Install MicroK8s** ## 1.2. Install MicroK8s
This section describes how to deploy the MicroK8s Kubernetes platform and configure it to be used with ETSI TeraFlowSDN controller. Besides, Docker is installed to build docker images for the ETSI TeraFlowSDN controller. This section describes how to deploy the MicroK8s Kubernetes platform and configure it to be used with ETSI TeraFlowSDN controller. Besides, Docker is installed to build docker images for the ETSI TeraFlowSDN controller.
...@@ -611,13 +650,14 @@ To facilitate work, these steps are easier to be executed through an SSH connect ...@@ -611,13 +650,14 @@ To facilitate work, these steps are easier to be executed through an SSH connect
<h3><u>Upgrade the Ubuntu distribution</h3></u> <h3><u>Upgrade the Ubuntu distribution</h3></u>
Skip this step if you already did it during the creation of the VM. Skip this step if you already did it during the creation of the VM.
```bash ```bash
sudo apt-get update -y sudo apt-get update -y
sudo apt-get dist-upgrade -y sudo apt-get dist-upgrade -y
``` ```
<h3><u>Install prerequisites</h3></u> <h3><u>Install prerequisites</h3></u>
```bash ```bash
sudo apt-get install -y ca-certificates curl gnupg lsb-release snapd jq sudo apt-get install -y ca-certificates curl gnupg lsb-release snapd jq
``` ```
...@@ -628,7 +668,7 @@ Install Docker CE and Docker BuildX plugin ...@@ -628,7 +668,7 @@ Install Docker CE and Docker BuildX plugin
sudo apt-get install -y docker.io docker-buildx sudo apt-get install -y docker.io docker-buildx
``` ```
**NOTE**: Starting from Docker v23, [Build architecture](https://docs.docker.com/build/architecture/) has been updated and `docker build` command entered into deprecation process in favor of the new `docker buildx build` command. Package `docker-buildx` provides the new `docker buildx build` command. > **NOTE**: Starting from Docker v23, [Build architecture](https://docs.docker.com/build/architecture/) has been updated and `docker build` command entered into deprecation process in favor of the new `docker buildx build` command. Package `docker-buildx` provides the new `docker buildx build` command.
Add key "insecure-registries" with the private repository to the daemon configuration. It is done in two commands since Add key "insecure-registries" with the private repository to the daemon configuration. It is done in two commands since
sometimes read from and write to same file might cause trouble. sometimes read from and write to same file might cause trouble.
...@@ -669,7 +709,6 @@ To do so, first check the status. ...@@ -669,7 +709,6 @@ To do so, first check the status.
If `ufw` is active, use the following command to enable the communication. If `ufw` is active, use the following command to enable the communication.
```bash ```bash
# Verify status of ufw firewall # Verify status of ufw firewall
sudo ufw status sudo ufw status
...@@ -678,7 +717,7 @@ sudo ufw allow in on cni0 && sudo ufw allow out on cni0 ...@@ -678,7 +717,7 @@ sudo ufw allow in on cni0 && sudo ufw allow out on cni0
sudo ufw default allow routed sudo ufw default allow routed
``` ```
**NOTE**: MicroK8s can be used to compose a Highly Available Kubernetes cluster enabling you to construct an environment combining the CPU, RAM and storage resources of multiple machines. If you are interested in this procedure, review the official instructions in [How to build a highly available Kubernetes cluster with MicroK8s](https://ubuntu.com/tutorials/getting-started-with-kubernetes-ha), in particular, the step [Create a MicroK8s multi-node cluster](https://ubuntu.com/tutorials/getting-started-with-kubernetes-ha#4-create-a-microk8s-multinode-cluster). > **NOTE**: MicroK8s can be used to compose a Highly Available Kubernetes cluster enabling you to construct an environment combining the CPU, RAM and storage resources of multiple machines. If you are interested in this procedure, review the official instructions in [How to build a highly available Kubernetes cluster with MicroK8s](https://ubuntu.com/tutorials/getting-started-with-kubernetes-ha), in particular, the step [Create a MicroK8s multi-node cluster](https://ubuntu.com/tutorials/getting-started-with-kubernetes-ha#4-create-a-microk8s-multinode-cluster).
**References:** **References:**
...@@ -854,8 +893,10 @@ git checkout develop ...@@ -854,8 +893,10 @@ git checkout develop
<h3><u>Prepare a deployment script with the deployment settings</h3></u> <h3><u>Prepare a deployment script with the deployment settings</h3></u>
Create a new deployment script, e.g., `my_deploy.sh`, adding the appropriate settings as Create a new deployment script, e.g., `my_deploy.sh`, adding the appropriate settings as
follows. follows.
This section provides just an overview of the available settings. An example [`my_deploy.sh`](https://labs.etsi.org/rep/tfs/controller/-/blob/master/my_deploy.sh) script is provided in the root folder of the project for your convenience with full description of all the settings. This section provides just an overview of the available settings. An example [`my_deploy.sh`](https://labs.etsi.org/rep/tfs/controller/-/blob/master/my_deploy.sh) script is provided in the root folder of the project for your convenience with full description of all the settings.
__Note__: The example `my_deploy.sh` script provides reasonable settings for deploying a functional and complete enough TeraFlowSDN controller, and a brief description of their meaning. To see extended descriptions, check scripts in the `deploy` folder. __Note__: The example `my_deploy.sh` script provides reasonable settings for deploying a functional and complete enough TeraFlowSDN controller, and a brief description of their meaning. To see extended descriptions, check scripts in the `deploy` folder.
......
This section addresses common questions you may encounter while working with TFS software. This section addresses common questions you may encounter while working with TFS software.
## **How can I contribute to TFS Documentation?** ## What if I have some issues while installing/using TFS?
Please refer to the detailed procedure outlined in our project's README within the GitLab repository. It contains essential instructions and guidelines to assist you.
See the README to [contribute documentation](https://labs.etsi.org/rep/tfs/documentation#what-should-be-the-flow-to-add-documentation-during-development).
## **What if I have some issues while installing/using TFS?**
Feel free to join our Slack community channel and ask questions! Our experts will soon reply your question. Feel free to join our Slack community channel and ask questions! Our experts will soon reply your question.
General [Slack Channel](https://join.slack.com/t/teraflowsdn/shared_invite/zt-18gc5jvkh-1_DEZHFhxeuOqzJZPq~U~A) General [Slack Channel](https://join.slack.com/t/teraflowsdn/shared_invite/zt-18gc5jvkh-1_DEZHFhxeuOqzJZPq~U~A)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment