Commit 8e6bd763 authored by yangalicace1's avatar yangalicace1
Browse files

Deployed 89dc86cb to develop in public with MkDocs 1.6.1 and mike 2.1.3

parent 44599f95
Loading
Loading
Loading
Loading
+286 −1
Original line number Diff line number Diff line
@@ -77,6 +77,11 @@
    <label class="md-overlay" for="__drawer"></label>
    <div data-md-component="skip">
      
        
        <a href="#install-prerequisites" class="md-skip">
          Skip to content
        </a>
      
    </div>
    <div data-md-component="announce">
      
@@ -441,6 +446,17 @@
      
      
      
        <label class="md-nav__link md-nav__link--active" for="__toc">
          
  
  <span class="md-ellipsis">
    Deploy TeraFlowSDN
  </span>
  

          <span class="md-nav__icon md-icon"></span>
        </label>
      
      <a href="./" class="md-nav__link md-nav__link--active">
        
  
@@ -451,6 +467,77 @@

      </a>
      
        

<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
  
  
  
  
    <label class="md-nav__title" for="__toc">
      <span class="md-nav__icon md-icon"></span>
      Table of contents
    </label>
    <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
      
        <li class="md-nav__item">
  <a href="#install-prerequisites" class="md-nav__link">
    <span class="md-ellipsis">
      Install prerequisites
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#clone-the-git-repository-of-the-teraflowsdn-controller" class="md-nav__link">
    <span class="md-ellipsis">
      Clone the Git repository of the TeraFlowSDN controller
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#checkout-the-appropriate-git-branch" class="md-nav__link">
    <span class="md-ellipsis">
      Checkout the appropriate Git branch
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#prepare-a-deployment-script-with-the-deployment-settings" class="md-nav__link">
    <span class="md-ellipsis">
      Prepare a deployment script with the deployment settings
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#confirm-that-microk8s-is-running" class="md-nav__link">
    <span class="md-ellipsis">
      Confirm that MicroK8s is running
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#deploy-tfs-controller" class="md-nav__link">
    <span class="md-ellipsis">
      Deploy TFS controller
    </span>
  </a>
  
</li>
      
    </ul>
  
</nav>
      
    </li>
  

@@ -775,6 +862,68 @@
  
  
  
    <label class="md-nav__title" for="__toc">
      <span class="md-nav__icon md-icon"></span>
      Table of contents
    </label>
    <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
      
        <li class="md-nav__item">
  <a href="#install-prerequisites" class="md-nav__link">
    <span class="md-ellipsis">
      Install prerequisites
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#clone-the-git-repository-of-the-teraflowsdn-controller" class="md-nav__link">
    <span class="md-ellipsis">
      Clone the Git repository of the TeraFlowSDN controller
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#checkout-the-appropriate-git-branch" class="md-nav__link">
    <span class="md-ellipsis">
      Checkout the appropriate Git branch
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#prepare-a-deployment-script-with-the-deployment-settings" class="md-nav__link">
    <span class="md-ellipsis">
      Prepare a deployment script with the deployment settings
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#confirm-that-microk8s-is-running" class="md-nav__link">
    <span class="md-ellipsis">
      Confirm that MicroK8s is running
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#deploy-tfs-controller" class="md-nav__link">
    <span class="md-ellipsis">
      Deploy TFS controller
    </span>
  </a>
  
</li>
      
    </ul>
  
</nav>
                  </div>
                </div>
@@ -790,7 +939,143 @@

  <h1>Deploy TeraFlowSDN</h1>


<p>This section describes how to deploy TeraFlowSDN controller on top of MicroK8s using the 
environment configured in the previous sections.</p>
<h2 id="install-prerequisites">Install prerequisites</h2>
<pre><code class="language-bash">sudo apt-get install -y git curl jq
</code></pre>
<h2 id="clone-the-git-repository-of-the-teraflowsdn-controller">Clone the Git repository of the TeraFlowSDN controller</h2>
<p>Clone from ETSI-hosted GitLab code repository:</p>
<pre><code class="language-bash">mkdir ~/tfs-ctrl
git clone https://labs.etsi.org/rep/tfs/controller.git ~/tfs-ctrl
</code></pre>
<p><strong>Important</strong>: The original H2020-TeraFlow project hosted on GitLab.com has been 
archieved and will not receive further contributions/updates.
Please, clone from <a href="https://labs.etsi.org/rep/tfs/controller">ETSI-hosted GitLab code repository</a>.</p>
<h2 id="checkout-the-appropriate-git-branch">Checkout the appropriate Git branch</h2>
<p>TeraFlowSDN controller versions can be found in the appropriate release tags and/or branches as described in <a href="/Home#versions">Home &gt; Versions</a>.</p>
<p>By default the branch <em>master</em> is checked out and points to the latest stable version of the TeraFlowSDN controller, while branch <em>develop</em> contains the latest developments and contributions under test and validation.</p>
<p>To switch to the appropriate branch run the following command, changing <code>develop</code> by the name of the branch you want to deploy:</p>
<pre><code class="language-bash">cd ~/tfs-ctrl
git checkout develop
</code></pre>
<h2 id="prepare-a-deployment-script-with-the-deployment-settings">Prepare a deployment script with the deployment settings</h2>
<p>Create a new deployment script, e.g., <code>my_deploy.sh</code>, adding the appropriate settings as 
follows.
This section provides just an overview of the available settings. An example <a href="https://labs.etsi.org/rep/tfs/controller/-/blob/master/my_deploy.sh"><code>my_deploy.sh</code></a> script is provided in the root folder of the project for your convenience with full description of all the settings.</p>
<p><strong>Note</strong>: The example <code>my_deploy.sh</code> 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 <code>deploy</code> folder.</p>
<pre><code class="language-bash">cd ~/tfs-ctrl
tee my_deploy.sh &gt;/dev/null &lt;&lt; EOF
# ----- TeraFlowSDN ------------------------------------------------------------
export TFS_REGISTRY_IMAGES=&quot;http://localhost:32000/tfs/&quot;
export TFS_COMPONENTS=&quot;context device ztp monitoring pathcomp service slice nbi webui load_generator&quot;
export TFS_IMAGE_TAG=&quot;dev&quot;
export TFS_K8S_NAMESPACE=&quot;tfs&quot;
export TFS_EXTRA_MANIFESTS=&quot;manifests/nginx_ingress_http.yaml&quot;
export TFS_GRAFANA_PASSWORD=&quot;admin123+&quot;
export TFS_SKIP_BUILD=&quot;&quot;

# ----- CockroachDB ------------------------------------------------------------
export CRDB_NAMESPACE=&quot;crdb&quot;
export CRDB_EXT_PORT_SQL=&quot;26257&quot;
export CRDB_EXT_PORT_HTTP=&quot;8081&quot;
export CRDB_USERNAME=&quot;tfs&quot;
export CRDB_PASSWORD=&quot;tfs123&quot;
export CRDB_DATABASE=&quot;tfs&quot;
export CRDB_DEPLOY_MODE=&quot;single&quot;
export CRDB_DROP_DATABASE_IF_EXISTS=&quot;YES&quot;
export CRDB_REDEPLOY=&quot;&quot;

# ----- NATS -------------------------------------------------------------------
export NATS_NAMESPACE=&quot;nats&quot;
export NATS_EXT_PORT_CLIENT=&quot;4222&quot;
export NATS_EXT_PORT_HTTP=&quot;8222&quot;
export NATS_REDEPLOY=&quot;&quot;

# ----- QuestDB ----------------------------------------------------------------
export QDB_NAMESPACE=&quot;qdb&quot;
export QDB_EXT_PORT_SQL=&quot;8812&quot;
export QDB_EXT_PORT_ILP=&quot;9009&quot;
export QDB_EXT_PORT_HTTP=&quot;9000&quot;
export QDB_USERNAME=&quot;admin&quot;
export QDB_PASSWORD=&quot;quest&quot;
export QDB_TABLE_MONITORING_KPIS=&quot;tfs_monitoring_kpis&quot;
export QDB_TABLE_SLICE_GROUPS=&quot;tfs_slice_groups&quot;
export QDB_DROP_TABLES_IF_EXIST=&quot;YES&quot;
export QDB_REDEPLOY=&quot;&quot;

EOF
</code></pre>
<p>The settings are organized in 4 sections:
- Section <code>TeraFlowSDN</code>:
  - <code>TFS_REGISTRY_IMAGE</code> enables to specify the private Docker registry to be used, by default, we assume to use the Docker respository enabled in MicroK8s.
  - <code>TFS_COMPONENTS</code> specifies the components their Docker image will be rebuilt, uploaded to the private Docker registry, and deployed in Kubernetes.
  - <code>TFS_IMAGE_TAG</code> defines the tag to be used for Docker images being rebuilt and uploaded to the private Docker registry.
  - <code>TFS_K8S_NAMESPACE</code> specifies the name of the Kubernetes namespace to be used for deploying the TFS components.
  - <code>TFS_EXTRA_MANIFESTS</code> enables to provide additional manifests to be applied into the Kubernetes environment during the deployment. Typical use case is to deploy ingress controllers, service monitors for Prometheus, etc.
  - <code>TFS_GRAFANA_PASSWORD</code> lets you specify the password you want to use for the <code>admin</code> user of the Grafana instance being deployed and linked to the Monitoring component.
  - <code>TFS_SKIP_BUILD</code>, if set to <code>YES</code>, prevents rebuilding the Docker images. That means, the deploy script will redeploy existing Docker images without rebuilding/updating them.</p>
<ul>
<li>Section <code>CockroachDB</code>: enables to configure the deployment of the backend <a href="https://www.cockroachlabs.com/">CockroachDB</a> database.</li>
<li>
<p>Check example script <a href="https://labs.etsi.org/rep/tfs/controller/-/blob/master/my_deploy.sh"><code>my_deploy.sh</code></a> for further details.</p>
</li>
<li>
<p>Section <code>NATS</code>: enables to configure the deployment of the backend <a href="https://nats.io/">NATS</a> message broker.</p>
</li>
<li>
<p>Check example script <a href="https://labs.etsi.org/rep/tfs/controller/-/blob/master/my_deploy.sh"><code>my_deploy.sh</code></a> for further details.</p>
</li>
<li>
<p>Section <code>QuestDB</code>: enables to configure the deployment of the backend <a href="https://questdb.io/">QuestDB</a> timeseries database.</p>
</li>
<li>Check example script <a href="https://labs.etsi.org/rep/tfs/controller/-/blob/master/my_deploy.sh"><code>my_deploy.sh</code></a> for further details.</li>
</ul>
<h2 id="confirm-that-microk8s-is-running">Confirm that MicroK8s is running</h2>
<p>Run the following command:</p>
<pre><code class="language-bash">microk8s status
</code></pre>
<p>If it is reported <code>microk8s is not running, try microk8s start</code>, run the following command to start MicroK8s:</p>
<pre><code class="language-bash">microk8s start
</code></pre>
<p>Confirm everything is up and running:</p>
<ol>
<li>Periodically <a href="/1.-Deployment-Guide/1.2.-Install-MicroK8s#check-status-of-kubernetes-and-addons">Check the status of Kubernetes</a> until you see the addons [dns, ha-cluster, helm3, hostpath-storage, ingress, registry, storage] in the enabled block.</li>
<li>Periodically <a href="/1.-Deployment-Guide/1.2.-Install-MicroK8s#check-all-resources-in-kubernetes">Check Kubernetes resources</a> until all pods are <strong>Ready</strong> and <strong>Running</strong>.</li>
</ol>
<h2 id="deploy-tfs-controller">Deploy TFS controller</h2>
<p>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.</p>
<pre><code class="language-bash">cd ~/tfs-ctrl
source my_deploy.sh
./deploy/all.sh
</code></pre>
<p>The script performs the following steps:
- Executes script <code>./deploy/crdb.sh</code> 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 <code>./deploy/nats.sh</code> 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 <code>./deploy/qdb.sh</code> 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 <code>./deploy/tfs.sh</code> to automate deployment of TeraFlowSDN.
  - Creates the namespace defined in <code>TFS_K8S_NAMESPACE</code>
  - Creates secrets for CockroachDB, NATS, and QuestDB to be used by Context and Monitoring components.
  - Builds the Docker images for the components defined in <code>TFS_COMPONENTS</code>
  - Tags the Docker images with the value of <code>TFS_IMAGE_TAG</code>
  - Pushes the Docker images to the repository defined in <code>TFS_REGISTRY_IMAGE</code>
  - Deploys the components defined in <code>TFS_COMPONENTS</code>
  - Creates the file <code>tfs_runtime_env_vars.sh</code> with the environment variables for the components defined in <code>TFS_COMPONENTS</code> defining their local host addresses and their port numbers.
  - Applies extra manifests defined in <code>TFS_EXTRA_MANIFESTS</code> 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 <a href="./1.5.-Show-Deployment-and-Logs">Show Deployment and Logs</a></p>



+382 −1

File changed.

Preview size limit exceeded, changes collapsed.

+100 −1
Original line number Diff line number Diff line
@@ -77,6 +77,11 @@
    <label class="md-overlay" for="__drawer"></label>
    <div data-md-component="skip">
      
        
        <a href="#report-the-deployment-of-the-tfs-controller" class="md-skip">
          Skip to content
        </a>
      
    </div>
    <div data-md-component="announce">
      
@@ -483,6 +488,17 @@
      
      
      
        <label class="md-nav__link md-nav__link--active" for="__toc">
          
  
  <span class="md-ellipsis">
    Show deployments and Logs
  </span>
  

          <span class="md-nav__icon md-icon"></span>
        </label>
      
      <a href="./" class="md-nav__link md-nav__link--active">
        
  
@@ -493,6 +509,41 @@

      </a>
      
        

<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
  
  
  
  
    <label class="md-nav__title" for="__toc">
      <span class="md-nav__icon md-icon"></span>
      Table of contents
    </label>
    <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
      
        <li class="md-nav__item">
  <a href="#report-the-deployment-of-the-tfs-controller" class="md-nav__link">
    <span class="md-ellipsis">
      Report the deployment of the TFS controller
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#report-the-log-of-a-specific-tfs-controller-component" class="md-nav__link">
    <span class="md-ellipsis">
      Report the log of a specific TFS controller component
    </span>
  </a>
  
</li>
      
    </ul>
  
</nav>
      
    </li>
  

@@ -775,6 +826,32 @@
  
  
  
    <label class="md-nav__title" for="__toc">
      <span class="md-nav__icon md-icon"></span>
      Table of contents
    </label>
    <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
      
        <li class="md-nav__item">
  <a href="#report-the-deployment-of-the-tfs-controller" class="md-nav__link">
    <span class="md-ellipsis">
      Report the deployment of the TFS controller
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#report-the-log-of-a-specific-tfs-controller-component" class="md-nav__link">
    <span class="md-ellipsis">
      Report the log of a specific TFS controller component
    </span>
  </a>
  
</li>
      
    </ul>
  
</nav>
                  </div>
                </div>
@@ -790,7 +867,29 @@

  <h1>Show deployments and Logs</h1>


<p>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.</p>
<h2 id="report-the-deployment-of-the-tfs-controller">Report the deployment of the TFS controller</h2>
<p>The summary report given at the end of the <a href="./1.3.-Deploy-TeraFlowSDN#deploy-tfs-controller">Deploy TFS controller</a>
procedure can be generated manually at any time by running the following command.
You can avoid sourcing <code>my_deploy.sh</code> if it has been already done.</p>
<pre><code class="language-bash">cd ~/tfs-ctrl
source my_deploy.sh
./deploy/show.sh
</code></pre>
<p>Use this script to validate that all the pods, deployments, replica sets, ingress 
controller, etc. are ready and have the appropriate state, e.g., <em>running</em> for Pods, and 
the services are deployed and have appropriate IP addresses and port numbers.</p>
<h2 id="report-the-log-of-a-specific-tfs-controller-component">Report the log of a specific TFS controller component</h2>
<p>A number of scripts are pre-created in the <code>scripts</code> 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 <code>my_deploy.sh</code> if it has been already done.</p>
<pre><code class="language-bash">source my_deploy.sh
./scripts/show_logs_context.sh
</code></pre>



+70 −1
Original line number Diff line number Diff line
@@ -77,6 +77,11 @@
    <label class="md-overlay" for="__drawer"></label>
    <div data-md-component="skip">
      
        
        <a href="#access-the-teraflowsdn-webui" class="md-skip">
          Skip to content
        </a>
      
    </div>
    <div data-md-component="announce">
      
@@ -462,6 +467,17 @@
      
      
      
        <label class="md-nav__link md-nav__link--active" for="__toc">
          
  
  <span class="md-ellipsis">
    WebUI and Grafana Dashboards
  </span>
  

          <span class="md-nav__icon md-icon"></span>
        </label>
      
      <a href="./" class="md-nav__link md-nav__link--active">
        
  
@@ -472,6 +488,32 @@

      </a>
      
        

<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
  
  
  
  
    <label class="md-nav__title" for="__toc">
      <span class="md-nav__icon md-icon"></span>
      Table of contents
    </label>
    <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
      
        <li class="md-nav__item">
  <a href="#access-the-teraflowsdn-webui" class="md-nav__link">
    <span class="md-ellipsis">
      Access the TeraFlowSDN WebUI
    </span>
  </a>
  
</li>
      
    </ul>
  
</nav>
      
    </li>
  

@@ -775,6 +817,23 @@
  
  
  
    <label class="md-nav__title" for="__toc">
      <span class="md-nav__icon md-icon"></span>
      Table of contents
    </label>
    <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
      
        <li class="md-nav__item">
  <a href="#access-the-teraflowsdn-webui" class="md-nav__link">
    <span class="md-ellipsis">
      Access the TeraFlowSDN WebUI
    </span>
  </a>
  
</li>
      
    </ul>
  
</nav>
                  </div>
                </div>
@@ -790,7 +849,17 @@

  <h1>WebUI and Grafana Dashboards</h1>


<p>This section describes how to get access to the TeraFlowSDN controller WebUI and the monitoring Grafana dashboards.</p>
<h2 id="access-the-teraflowsdn-webui">Access the TeraFlowSDN WebUI</h2>
<p>If you followed the installation steps based on MicroK8s, you got an ingress controller installed that exposes on TCP port 80.</p>
<p>Besides, the ingress controller defines the following reverse proxy paths (on your local machine):
- <code>http://127.0.0.1/webui</code>: points to the WebUI of TeraFlowSDN.
- <code>http://127.0.0.1/grafana</code>: points to the Grafana dashboards.
  This endpoint brings access to the monitoring dashboards of TeraFlowSDN.
  The credentials for the <code>admin</code>user are those defined in the <code>my_deploy.sh</code> script, in the <code>TFS_GRAFANA_PASSWORD</code> variable.
- <code>http://127.0.0.1/restconf</code>: points to the Compute component NBI based on RestCONF. 
  This endpoint enables connecting external software, such as ETSI OpenSourceMANO NFV Orchestrator, to TeraFlowSDN.</p>
<p><strong>Note</strong>: 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 <code>127.0.0.1:8080</code> of your local machine instead of <code>127.0.0.1:80</code>.</p>



+204 −1

File changed.

Preview size limit exceeded, changes collapsed.

Loading