Commit 78a0d166 authored by Carlos Natalino's avatar Carlos Natalino
Browse files

Merge branch 'develop' into fix/ofc22-tests

parents 7c47f50e c6139486
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
# TeraFlow OS SDN Controller
# TeraFlowSDN Controller

[Teraflow H2020 project](https://teraflow-h2020.eu/) - Secured autonomic traffic management for a Tera of SDN Flows

@@ -7,13 +7,4 @@ Branch "master" : [![pipeline status](https://gitlab.com/teraflow-h2020/controll
Branch "develop" : [![pipeline status](https://gitlab.com/teraflow-h2020/controller/badges/develop/pipeline.svg)](https://gitlab.com/teraflow-h2020/controller/-/commits/develop) [![coverage report](https://gitlab.com/teraflow-h2020/controller/badges/develop/coverage.svg)](https://gitlab.com/teraflow-h2020/controller/-/commits/develop)

# Installation Instructions
To install TeraFlow OS SDN Controller in your local Kubernetes deployment, we assume you deployed Kubernetes following the instructions provided in [Wiki: Installing Kubernetes on your Linux machine](https://gitlab.com/teraflow-h2020/controller/-/wikis/Installing-Kubernetes-on-your-Linux-machine).

Then, follow the instructions in [Wiki: Deploying a TeraFlow OS test instance](https://gitlab.com/teraflow-h2020/controller/-/wikis/Deploying-a-TeraFlow-OS-test-instance) to deploy your instance of TeraFlow OS.

# Functional Tests
A functional test has been defined to enable experimentation with the TeraFlow OS:

__Important:__ The OpenConfigDriver, the P4Driver, and the TrandportApiDriver have to be considered as experimental. The configuration and monitoring capabilities they support are limited or partially implemented. Use them with care.

[Demo at OFC'22 (Bootstrap devices, Manage L3VPN services, Monitor Device Endpoints)](./src/tests/ofc22)
For devel and upcoming release 2.0, we have prepared the following tutorial: [TeraFlowSDN tutorial](https://gitlab.com/teraflow-h2020/controller/-/tree/develop/tutorial).
+1 −0
Original line number Diff line number Diff line
@@ -6,3 +6,4 @@ prometheus-client==0.13.0
protobuf==3.20.*
pytest==6.2.5
pytest-benchmark==3.4.1
python-dateutil==2.8.2
+2 −2
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ for COMPONENT in $TFS_COMPONENTS; do
    printf "\n"
done

if [[ "$TFS_COMPONENTS" == *"webui"* ]]; then
if [[ "$TFS_COMPONENTS" == *"webui"* ]] && [[ "$TFS_COMPONENTS" == *"monitoring"* ]]; then
    echo "Configuring WebUI DataStores and Dashboards..."
    sleep 3

+4 −2
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
########################################################################################################################

# If not already set, set the name of the Kubernetes namespace to deploy to.
export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs-dev"}
export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"}

# If not already set, set the list of components you want to build images for, and deploy.
export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device automation policy service compute monitoring dbscanserving opticalattackmitigator opticalcentralizedattackdetector webui"}
@@ -32,12 +32,14 @@ for COMPONENT in $TFS_COMPONENTS; do
    echo "Processing '$COMPONENT' component..."

    SERVICE_GRPC_PORT=$(kubectl get service ${COMPONENT}service --namespace $TFS_K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.name=="grpc")].port}')
    echo "    '$COMPONENT' service port: $SERVICE_GRPC_PORT"
    if [ -z "${SERVICE_GRPC_PORT}" ]; then
        printf "\n"
        continue;
    fi

    PATCH='{"data": {"'${SERVICE_GRPC_PORT}'": "'$TFS_K8S_NAMESPACE'/'${COMPONENT}service':'${SERVICE_GRPC_PORT}'"}}'
    COMPONENT_OBJNAME=$(echo "${COMPONENT}" | sed "s/\_/-/")
    PATCH='{"data": {"'${SERVICE_GRPC_PORT}'": "'$TFS_K8S_NAMESPACE'/'${COMPONENT_OBJNAME}service':'${SERVICE_GRPC_PORT}'"}}'
    #echo "PATCH: ${PATCH}"
    kubectl patch configmap nginx-ingress-tcp-microk8s-conf --namespace ingress --patch "${PATCH}"

+23 −18
Original line number Diff line number Diff line
@@ -29,22 +29,23 @@ spec:
      terminationGracePeriodSeconds: 5
      restartPolicy: Always
      containers:
      - name: influxdb
        image: influxdb:1.8
      - name: metricsdb
        image: questdb/questdb
        ports:
        - containerPort: 8086
        - containerPort: 9000
        - containerPort: 9009
        - containerPort: 9003
        env:
        - name: LOG_LEVEL
          value: "DEBUG"
        envFrom:
          - secretRef:
              name: influxdb-secrets
        - name: QDB_CAIRO_COMMIT_LAG
          value: "1000"
        - name: QDB_CAIRO_MAX_UNCOMMITTED_ROWS
          value: "100000"
        readinessProbe:
          exec:
            command: ["curl", "-XGET", "localhost:8086/health"]
            command: ["curl", "-XGET", "localhost:9000"]
        livenessProbe:
          exec:
            command: ["curl", "-XGET", "localhost:8086/health"]
            command: ["curl", "-XGET", "localhost:9003/metrics"]
        resources:
          requests:
            cpu: 250m
@@ -58,11 +59,14 @@ spec:
        ports:
        - containerPort: 7070
        env:
        - name: LOG_LEVEL
          value: "DEBUG"
        envFrom:
          - secretRef:
              name: monitoring-secrets
        - name: METRICSDB_HOSTNAME
          value: "localhost"
        - name: METRICSDB_ILP_PORT
          value: "9009"
        - name: METRICSDB_REST_PORT
          value: "9000"
        - name: METRICSDB_TABLE
          value: "monitoring"
        readinessProbe:
          exec:
            command: ["/bin/grpc_health_probe", "-addr=:7070"]
@@ -76,6 +80,7 @@ spec:
          limits:
            cpu: 700m
            memory: 1024Mi

---
apiVersion: v1
kind: Service
@@ -90,7 +95,7 @@ spec:
    protocol: TCP
    port: 7070
    targetPort: 7070
  - name: influxdb
  - name: questdb
    protocol: TCP
    port: 8086
    targetPort: 8086
    port: 9000
    targetPort: 9000
 No newline at end of file
Loading