Skip to content
Snippets Groups Projects
Commit 03b55022 authored by yangalicace1's avatar yangalicace1
Browse files

Deployed 9322981a to develop in public with MkDocs 1.6.1 and mike 2.1.3

parent ece28546
No related branches found
No related tags found
No related merge requests found
......@@ -1115,6 +1115,148 @@ sudo apt-get remove --purge docker.io docker-buildx
<p><strong>IMPORTANT</strong>: After uninstalling MicroK8s, it is convenient to reboot the computer (the VM if you work on a VM, or the physical computer if you use a physical computer). Otherwise, there are system configurations that are not correctly cleaned. Especially in what port forwarding and firewall rules matters.</p>
<p>After the reboot, redeploy as it is described in this section.</p>
<h2 id="13-deploy-teraflowsdn"><strong>1.3. Deploy TeraFlowSDN</strong></h2>
<p>This section describes how to deploy TeraFlowSDN controller on top of MicroK8s using the environment configured in the previous sections.</p>
<h3><u>Install prerequisites</h3>
<p></u></p>
<pre><code class="language-bash">sudo apt-get install -y git curl jq
</code></pre>
<h3><u>Clone the Git repository of the TeraFlowSDN controller</h3>
<p></u>
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>
<h3><u>Checkout the appropriate Git branch</h3>
<p></u>
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>
<h3><u>Prepare a deployment script with the deployment settings</h3>
<p></u>
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>
<h3><u>Confirm that MicroK8s is running</h3>
<p></u></p>
<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>
<h3><u>Deploy TFS controller</h3>
<p></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.</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>
<h2 id="14-webui-and-grafana-dashboards"><strong>1.4. WebUI and Grafana Dashboards</strong></h2>
<h2 id="15-show-deployment-and-logs"><strong>1.5. Show Deployment and Logs</strong></h2>
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
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