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