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