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