Newer
Older
1. Periodically [Check the status of Kubernetes](#check-status-of-kubernetes-and-addons) until you see the addons \[dns, ha-cluster, helm3, hostpath-storage, ingress, registry, storage\] in the enabled block.
2. Periodically [Check Kubernetes resources](#check-all-resources-in-kubernetes) until all pods are **Ready** and **Running**.
<h3><u id="deploy-tfs-controller">Deploy TFS controller</h3></u>
First, source the deployment settings defined in the previous section.
This way, you do not need to specify the environment variables in each and every command you execute to operate the TFS controller.
Be aware to re-source the file if you open new terminal sessions.
Then, run the following command to deploy TeraFlowSDN controller on top of the MicroK8s Kubernetes platform.
```bash
cd ~/tfs-ctrl
source my_deploy.sh
./deploy/all.sh
```
The script performs the following steps:
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
- Executes script `./deploy/crdb.sh` to automate deployment of CockroachDB database used by Context component.
- The script automatically checks if CockroachDB is already deployed.
- If there are settings instructing to drop the database and/or redeploy CockroachDB, it does the appropriate actions to honor them as defined in previous section.
- Executes script `./deploy/nats.sh` to automate deployment of NATS message broker used by Context component.
- The script automatically checks if NATS is already deployed.
- If there are settings instructing to redeploy the message broker, it does the appropriate actions to honor them as defined in previous section.
- Executes script `./deploy/qdb.sh` to automate deployment of QuestDB timeseries database used by Monitoring component.
- The script automatically checks if QuestDB is already deployed.
- If there are settings instructing to redeploy the timeseries database, it does the appropriate actions to honor them as defined in previous section.
- Executes script `./deploy/tfs.sh` to automate deployment of TeraFlowSDN.
- Creates the namespace defined in `TFS_K8S_NAMESPACE`
- Creates secrets for CockroachDB, NATS, and QuestDB to be used by Context and Monitoring components.
- Builds the Docker images for the components defined in `TFS_COMPONENTS`
- Tags the Docker images with the value of `TFS_IMAGE_TAG`
- Pushes the Docker images to the repository defined in `TFS_REGISTRY_IMAGE`
- Deploys the components defined in `TFS_COMPONENTS`
- Creates the file `tfs_runtime_env_vars.sh` with the environment variables for the components defined in `TFS_COMPONENTS` defining their local host addresses and their port numbers.
- Applies extra manifests defined in `TFS_EXTRA_MANIFESTS` such as:
- Creating an ingress controller listening at port 80 for HTTP connections to enable external access to the TeraFlowSDN WebUI, Grafana Dashboards, and Compute NBI interfaces.
- Deploying service monitors to enable monitoring the performance of the components, device drivers and service handlers.
- Initialize and configure the Grafana dashboards (if Monitoring component is deployed)
- Report a summary of the deployment
- See [Show Deployment and Logs](#15-show-deployment-and-logs)
## **1.4. WebUI and Grafana Dashboards**
This section describes how to get access to the TeraFlowSDN controller WebUI and the monitoring Grafana dashboards.
<h3><u>Access the TeraFlowSDN WebUI</h3></u>
If you followed the installation steps based on MicroK8s, you got an ingress controller installed that exposes on TCP port 80.
Besides, the ingress controller defines the following reverse proxy paths (on your local machine):
- `http://127.0.0.1/webui`: points to the WebUI of TeraFlowSDN.
- `http://127.0.0.1/grafana`: points to the Grafana dashboards.
This endpoint brings access to the monitoring dashboards of TeraFlowSDN.
The credentials for the `admin`user are those defined in the `my_deploy.sh` script, in the `TFS_GRAFANA_PASSWORD` variable.
- `http://127.0.0.1/restconf`: points to the Compute component NBI based on RestCONF.
This endpoint enables connecting external software, such as ETSI OpenSourceMANO NFV Orchestrator, to TeraFlowSDN.
**Note**: In the creation of the VM, a forward from host TCP port 8080 to VM's TCP port 80 is configured, so the WebUIs and REST APIs of TeraFlowSDN should be exposed on the endpoint `127.0.0.1:8080` of your local machine instead of `127.0.0.1:80`.
## **1.5. Show Deployment and Logs**
This section presents some helper scripts to inspect the status of the deployment and
the logs of the components.
These scripts are particularly helpful for troubleshooting during execution of
experiments, development, and debugging.
<h3><u>Report the deployment of the TFS controller</h3></u>
The summary report given at the end of the [Deploy TFS controller](#deploy-tfs-controller)
procedure can be generated manually at any time by running the following command.
You can avoid sourcing `my_deploy.sh` if it has been already done.
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
```bash
cd ~/tfs-ctrl
source my_deploy.sh
./deploy/show.sh
```
Use this script to validate that all the pods, deployments, replica sets, ingress
controller, etc. are ready and have the appropriate state, e.g., *running* for Pods, and
the services are deployed and have appropriate IP addresses and port numbers.
<h3><u>Report the log of a specific TFS controller component</h3></u>
A number of scripts are pre-created in the `scripts` folder to facilitate the inspection
of the component logs.
For instance, to dump the log of the Context component, run the following command.
You can avoid sourcing `my_deploy.sh` if it has been already done.
```bash
source my_deploy.sh
./scripts/show_logs_context.sh
```