Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 1 | .. _pod_physical: |
Matteo Scandolo | 1f5530b | 2019-12-17 10:12:31 -0800 | [diff] [blame] | 2 | |
| 3 | Deploy a physical VOLTHA POD |
| 4 | ============================ |
| 5 | |
| 6 | Quickstart |
| 7 | ---------- |
| 8 | |
Zack Williams | c6460c2 | 2019-12-18 14:54:43 -0700 | [diff] [blame] | 9 | The quickstart assumes you POD is already correctly cabled, if not you can |
Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 10 | refer to :ref:`lab_setup` |
Matteo Scandolo | 1f5530b | 2019-12-17 10:12:31 -0800 | [diff] [blame] | 11 | |
| 12 | Requires: |
| 13 | |
| 14 | - a physical kubernetes cluster |
Zack Williams | 6ebfe06 | 2020-04-09 16:08:29 -0700 | [diff] [blame] | 15 | - `kind-voltha <https://gerrit.opencord.org/gitweb?p=kind-voltha.git>`_ cloned |
| 16 | on your machine |
Matteo Scandolo | 1f5530b | 2019-12-17 10:12:31 -0800 | [diff] [blame] | 17 | |
| 18 | |
Zack Williams | c6460c2 | 2019-12-18 14:54:43 -0700 | [diff] [blame] | 19 | Enter the ``kind-voltha`` directory and execute this command (``kubectl`` must |
| 20 | be installed and pointing to your cluster): |
Matteo Scandolo | 1f5530b | 2019-12-17 10:12:31 -0800 | [diff] [blame] | 21 | |
| 22 | .. code:: bash |
| 23 | |
| 24 | DEPLOY_K8S=no WITH_RADIUS=y CONFIG_SADIS=y ./voltha up |
| 25 | |
| 26 | If you already have a ``radius`` server that you want to use, change the flag to ``WITH_RADIUS=n`` |
| 27 | and `configure ONOS accordingly <https://github.com/opencord/aaa>`_. |
| 28 | |
| 29 | TLDR; |
| 30 | ----- |
| 31 | |
Zack Williams | c6460c2 | 2019-12-18 14:54:43 -0700 | [diff] [blame] | 32 | Below are the complete steps to install a physical cluster. It assumes |
| 33 | ``kubectl`` and ``helm`` commands are already available. |
Matteo Scandolo | 1f5530b | 2019-12-17 10:12:31 -0800 | [diff] [blame] | 34 | |
| 35 | Configure Helm |
| 36 | -------------- |
| 37 | |
Zack Williams | c6460c2 | 2019-12-18 14:54:43 -0700 | [diff] [blame] | 38 | Helm provide a capability to install and manage Kubernetes applications. |
Matteo Scandolo | 1f5530b | 2019-12-17 10:12:31 -0800 | [diff] [blame] | 39 | VOLTHA’s default deployment mechanism utilized Helm. Before Helm can be |
| 40 | used to deploy VOLTHA it must be initialized and the repositories that |
| 41 | container the artifacts required to deploy VOLTHA must be added to Helm. |
| 42 | |
| 43 | .. code:: bash |
| 44 | |
| 45 | helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com |
| 46 | helm repo add stable https://kubernetes-charts.storage.googleapis.com |
| 47 | helm repo add onf https://charts.opencord.org |
| 48 | helm repo update |
| 49 | |
| 50 | .. _installation_steps: |
| 51 | |
| 52 | Install EtcdOperator |
| 53 | -------------------- |
| 54 | |
| 55 | ETCD Operator is a utility that allows applications to create and manage |
| 56 | ETCD key/value clusters as Kubernetes resources. VOLTHA utilizes this |
| 57 | utility to create its key/value store. *NOTE: it is not required that |
Zack Williams | c6460c2 | 2019-12-18 14:54:43 -0700 | [diff] [blame] | 58 | VOLTHA create its own datastore as VOLTHA can utilize an existing |
Matteo Scandolo | 1f5530b | 2019-12-17 10:12:31 -0800 | [diff] [blame] | 59 | datastore, but for this example VOLTHA will creates its own datastore* |
| 60 | |
| 61 | .. code:: bash |
| 62 | |
| 63 | helm install -f $TYPE-values.yaml --namespace voltha --name etcd-operator stable/etcd-operator |
| 64 | |
| 65 | Wait for operator pods |
| 66 | ~~~~~~~~~~~~~~~~~~~~~~ |
| 67 | |
Zack Williams | c6460c2 | 2019-12-18 14:54:43 -0700 | [diff] [blame] | 68 | Before continuing, the Kubernetes pods associated with ETCD Operator must |
Matteo Scandolo | 1f5530b | 2019-12-17 10:12:31 -0800 | [diff] [blame] | 69 | be in the ``Running`` state. |
| 70 | |
| 71 | .. code:: bash |
| 72 | |
| 73 | kubectl get -n voltha pod |
| 74 | |
| 75 | Once all the pods are in the ``Running`` state the output, for a |
| 76 | **full** deployment should be similar to the output below. For a |
| 77 | **minimal** deployment there will only be a single pod, the |
| 78 | ``etcd-operator-etcd-operator-etcd-operator`` pod. |
| 79 | |
| 80 | .. code:: bash |
| 81 | |
| 82 | NAME READY STATUS RESTARTS AGE |
| 83 | etcd-operator-etcd-operator-etcd-backup-operator-7897665cfq75w2 1/1 Running 0 2m |
| 84 | etcd-operator-etcd-operator-etcd-operator-7d579799f7-bjdnj 1/1 Running 0 2m |
| 85 | etcd-operator-etcd-operator-etcd-restore-operator-7d77d878wwcn7 1/1 Running 0 2m |
| 86 | |
| 87 | It is not just VOLTHA |
| 88 | --------------------- |
| 89 | |
| 90 | To demonstrate the capability of VOLTHA other *partner* applications are |
Zack Williams | c6460c2 | 2019-12-18 14:54:43 -0700 | [diff] [blame] | 91 | required, such as ONOS. The following sections describe how to install |
Matteo Scandolo | 1f5530b | 2019-12-17 10:12:31 -0800 | [diff] [blame] | 92 | and configure these *partner* applications. |
| 93 | |
Zack Williams | c6460c2 | 2019-12-18 14:54:43 -0700 | [diff] [blame] | 94 | *NOTE: It is important to start ONOS before VOLTHA as if they are started in |
| 95 | the reverse order the ``ofagent`` sometimes does not connect to the SDN |
Matteo Scandolo | 1f5530b | 2019-12-17 10:12:31 -0800 | [diff] [blame] | 96 | controller*\ `VOL-1764 <https://jira.opencord.org/browse/VOL-1764>`__. |
| 97 | |
| 98 | ONOS (OpenFlow Controller) |
| 99 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 100 | |
Zack Williams | c6460c2 | 2019-12-18 14:54:43 -0700 | [diff] [blame] | 101 | VOLTHA exposes an OLT and its connected ONUs as an OpenFlow switch. To control |
| 102 | that virtual OpenFlow switch an OpenFlow controller is required. For most |
| 103 | VOLTHA deployments that controller is ONOS, with a set of ONOS applications |
| 104 | installed. To install ONOS use the following Helm command: |
Matteo Scandolo | 1f5530b | 2019-12-17 10:12:31 -0800 | [diff] [blame] | 105 | |
| 106 | .. code:: bash |
| 107 | |
| 108 | helm install -f $TYPE-values.yaml --name onos onf/onos |
| 109 | |
| 110 | Exposing ONOS Services |
| 111 | ^^^^^^^^^^^^^^^^^^^^^^ |
| 112 | |
| 113 | .. code:: bash |
| 114 | |
| 115 | screen -dmS onos-ui kubectl port-forward service/onos-ui 8181:8181 |
| 116 | screen -dmS onos-ssh kubectl port-forward service/onos-ssh 8101:8101 |
| 117 | |
| 118 | Configuring ONOS Applications |
| 119 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 120 | |
| 121 | Configuration files have been provided to configure aspects of the ONOS |
| 122 | deployment. The following curl commands push those configurations to the |
| 123 | ONOS instance. It is possible (likely) that ONOS won’t be immediately |
| 124 | ready to accept REST requests, so the first ``curl`` command may need |
| 125 | retried until ONOS is ready to accept REST connections. |
| 126 | |
| 127 | .. code:: bash |
| 128 | |
| 129 | curl --fail -sSL --user karaf:karaf \ |
| 130 | -X POST -H Content-Type:application/json \ |
| 131 | http://127.0.0.1:8181/onos/v1/network/configuration/apps/org.opencord.kafka \ |
| 132 | --data @onos-files/onos-kafka.json |
| 133 | curl --fail -sSL --user karaf:karaf \ |
| 134 | -X POST -H Content-Type:application/json \ |
| 135 | http://127.0.0.1:8181/onos/v1/network/configuration/apps/org.opencord.dhcpl2relay \ |
| 136 | --data @onos-files/onos-dhcpl2relay.json |
| 137 | curl --fail -sSL --user karaf:karaf \ |
| 138 | -X POST -H Content-Type:application/json \ |
| 139 | http://127.0.0.1:8181/onos/v1/configuration/org.opencord.olt.impl.Olt \ |
| 140 | --data @onos-files/olt-onos-olt-settings.json |
| 141 | curl --fail -sSL --user karaf:karaf \ |
| 142 | -X POST -H Content-Type:application/json \ |
| 143 | http://127.0.0.1:8181/onos/v1/configuration/org.onosproject.net.flow.impl.FlowRuleManager \ |
| 144 | --data @onos-files/olt-onos-enableExtraneousRules.json |
| 145 | |
| 146 | SADIS Configuration |
| 147 | ^^^^^^^^^^^^^^^^^^^ |
| 148 | |
| 149 | The ONOS applications leverage the *Subscriber and Device Information |
| 150 | Store (SADIS)* when processing EAPOL and DHCP packets from VOLTHA |
Zack Williams | c6460c2 | 2019-12-18 14:54:43 -0700 | [diff] [blame] | 151 | controlled devices. In order for VOLTHA to function properly, SADIS |
Matteo Scandolo | 1f5530b | 2019-12-17 10:12:31 -0800 | [diff] [blame] | 152 | entries must be configured into ONOS. |
| 153 | |
| 154 | The repository contains two example SADIS configuration that can be used |
| 155 | with ONOS depending if you using VOLTHA with *tech profile* support |
| 156 | (``onos-files/onos-sadis-no-tp.json``) or without *tech profile* support |
| 157 | (``onos-files/onos-sadis-tp.json``). Either of these configurations can |
| 158 | be pushed to ONOS using the following command: |
| 159 | |
| 160 | .. code:: bash |
| 161 | |
| 162 | curl --fail -sSL --user karaf:karaf \ |
| 163 | -X POST -H Content-Type:application/json \ |
| 164 | http://127.0.0.1:8181/onos/v1/network/configuration/apps/org.opencord.sadis \ |
| 165 | --data @<selected SADIS configuration file> |
| 166 | |
| 167 | Install VOLTHA Core |
| 168 | ------------------- |
| 169 | |
| 170 | VOLTHA has two main *parts*: core and adapters. The **core** provides |
| 171 | the main logic for the VOLTHA application and the **adapters** contain |
| 172 | logic to adapter vendor neutral operations to vendor specific devices. |
| 173 | |
| 174 | Before any adapters can be deployed the VOLTHA core must be installed |
| 175 | and in the ``Running`` state. The following Helm command installs the |
| 176 | core components of VOLTHA based on the desired deployment type. |
| 177 | |
| 178 | .. code:: bash |
| 179 | |
| 180 | helm install -f $TYPE-values.yaml --set use_go=true --set defaults.log_level=WARN \ |
| 181 | --namespace voltha --name voltha onf/voltha |
| 182 | |
| 183 | During the install of the core VOLTHA components some containers may |
Zack Williams | c6460c2 | 2019-12-18 14:54:43 -0700 | [diff] [blame] | 184 | "crash" or restart. This is normal as there are dependencies, such as |
Matteo Scandolo | 1f5530b | 2019-12-17 10:12:31 -0800 | [diff] [blame] | 185 | the read/write cores cannot start until the ETCD cluster is established |
| 186 | and so they crash until the ETCD cluster is operational. Eventually all |
| 187 | the containers should be in a ``Running`` state as queried by the |
| 188 | command: |
| 189 | |
| 190 | .. code:: bash |
| 191 | |
| 192 | kubectl get -n voltha pod |
| 193 | |
| 194 | The output should be similar to the following with a different number of |
| 195 | ``etcd-operator`` and ``voltha-etcd-cluster`` pods depending on the |
| 196 | deployment type. |
| 197 | |
| 198 | .. code:: bash |
| 199 | |
| 200 | NAME READY STATUS RESTARTS AGE |
| 201 | etcd-operator-etcd-operator-etcd-operator-7d579799f7-xq6f2 1/1 Running 0 19m |
| 202 | ofagent-8ccb7f5fb-hwgfn 1/1 Running 0 4m |
| 203 | ro-core-564f5cdcc7-2pch8 1/1 Running 0 4m |
| 204 | rw-core1-7fbb878cdd-6npvr 1/1 Running 2 4m |
| 205 | rw-core2-7fbb878cdd-k7w9j 1/1 Running 3 4m |
| 206 | voltha-api-server-5f7c8b5b77-k6mrg 2/2 Running 0 4m |
| 207 | voltha-cli-server-5df4c95b7f-kcpdl 1/1 Running 0 4m |
| 208 | voltha-etcd-cluster-4rsqcvpwr4 1/1 Running 0 4m |
| 209 | voltha-kafka-0 1/1 Running 0 4m |
| 210 | voltha-zookeeper-0 1/1 Running 0 4m |
| 211 | |
| 212 | Install Adapters |
| 213 | ---------------- |
| 214 | |
| 215 | The following commands install both the simulated OLT and ONU adapters |
| 216 | as well as the adapters for an OpenOLT and OpenONU device. |
| 217 | |
| 218 | .. code:: bash |
| 219 | |
| 220 | helm install -f $TYPE-values.yaml -set use_go=true --set defaults.log_level=WARN \ |
| 221 | --namespace voltha --name sim onf/voltha-adapter-simulated |
| 222 | helm install -f $TYPE-values.yaml -set use_go=true --set defaults.log_level=WARN \ |
| 223 | --namespace voltha --name open-olt onf/voltha-adapter-openolt |
| 224 | helm install -f $TYPE-values.yaml -set use_go=true --set defaults.log_level=WARN \ |
| 225 | --namespace voltha --name open-onu onf/voltha-adapter-openonu |
| 226 | |
| 227 | Exposing VOLTHA Services |
| 228 | ------------------------ |
| 229 | |
Zack Williams | c6460c2 | 2019-12-18 14:54:43 -0700 | [diff] [blame] | 230 | At this point VOLTHA is deployed, and from within the Kubernetes cluster |
Matteo Scandolo | 1f5530b | 2019-12-17 10:12:31 -0800 | [diff] [blame] | 231 | the VOLTHA services can be reached. However, from outside the Kubernetes |
| 232 | cluster the services cannot be reached. |
| 233 | |
| 234 | .. code:: bash |
| 235 | |
| 236 | screen -dmS voltha-api kubectl port-forward -n voltha service/voltha-api 55555:55555 |
| 237 | screen -dmS voltha-ssh kubectl port-forward -n voltha service/voltha-cli 5022:5022 |
| 238 | |
| 239 | Install FreeRADIUS Service |
| 240 | -------------------------- |
| 241 | |
| 242 | .. code:: bash |
| 243 | |
| 244 | helm install -f minimal-values.yaml --namespace voltha --name radius onf/freeradius |
| 245 | |
| 246 | Configure ``voltctl`` to Connect to VOLTHA |
| 247 | ------------------------------------------ |
| 248 | |
Zack Williams | c6460c2 | 2019-12-18 14:54:43 -0700 | [diff] [blame] | 249 | In order for ``voltctl`` to connect to the VOLTHA instance deployed in |
Matteo Scandolo | 1f5530b | 2019-12-17 10:12:31 -0800 | [diff] [blame] | 250 | the Kubernetes cluster it must know which IP address and port to use. |
| 251 | This configuration can be persisted to a local config file using the |
| 252 | following commands. |
| 253 | |
| 254 | .. code:: bash |
| 255 | |
| 256 | mkdir -p $HOME/.volt |
| 257 | voltctl -a v2 -s localhost:55555 config > $HOME/.volt/config |
| 258 | |
| 259 | To test the connectivity you can query the version of the VOLTHA client |
Zack Williams | c6460c2 | 2019-12-18 14:54:43 -0700 | [diff] [blame] | 260 | and server:: |
Matteo Scandolo | 1f5530b | 2019-12-17 10:12:31 -0800 | [diff] [blame] | 261 | |
| 262 | voltctl version |
| 263 | |
Zack Williams | c6460c2 | 2019-12-18 14:54:43 -0700 | [diff] [blame] | 264 | The output should be similar to the following:: |
Matteo Scandolo | 1f5530b | 2019-12-17 10:12:31 -0800 | [diff] [blame] | 265 | |
| 266 | Client: |
| 267 | Version unknown-version |
| 268 | Go version: unknown-goversion |
| 269 | Vcs reference: unknown-vcsref |
| 270 | Vcs dirty: unknown-vcsdirty |
| 271 | Built: unknown-buildtime |
| 272 | OS/Arch: unknown-os/unknown-arch |
| 273 | |
| 274 | Cluster: |
| 275 | Version 2.1.0-dev |
| 276 | Go version: 1.12.6 |
| 277 | Vcs feference: 28f120f1f4751284cadccf73f2f559ce838dd0a5 |
| 278 | Vcs dirty: false |
| 279 | Built: 2019-06-26T16:58:22Z |
Zack Williams | c6460c2 | 2019-12-18 14:54:43 -0700 | [diff] [blame] | 280 | OS/Arch: linux/amd64 |