blob: 586b160422aa3be9c7eb086074bd85d99b992c97 [file] [log] [blame]
Zack Williams16042b62020-03-29 22:03:16 -07001.. _dev_virtual:
2
3Developing code with a virtual VOLTHA POD
4=========================================
Matteo Scandolo1f5530b2019-12-17 10:12:31 -08005
Matteo Scandoloef5d6f42020-07-27 16:46:38 -07006A guide to install a virtual POD. A virtual pod is generally used to gain familiarity with the
7environment or for development and testing purposes.
Zack Williams16042b62020-03-29 22:03:16 -07008
Matteo Scandoloef5d6f42020-07-27 16:46:38 -07009How is it different from a Physical deployment?
10-----------------------------------------------
11
12The main difference is in the ``kubernetes`` cluster itself.
13In a Physical deployment we assume that the ``kubernetes`` cluster is installed
14on 3 (or mode) physical nodes.
15When installing a ``virtual`` cluster we refer to a ``kind`` (``kubernetes-in-docker``)
16cluster.
17
18Another common difference is that a Physical deployment is generally associated
19with one or more physical OLTs while a Virtual deployment normally emulates the
20PON network using :doc:`BBSim <../bbsim/docs/source/index>`.
21
22.. figure:: ../_static/voltha_cluster_virtual.png
23 :alt: VOLTHA Component Diagram
24 :width: 100%
25
26 VOLTHA Kubernetes kind deployment
27
28Note that is anyway possible to connect a physical OLT to a virtual cluster, as
29long as the OLT is reachable from the ``kind`` host machine. If you need to control
30your OLT "in-band" then it's not advised to connect it to a virtual cluster.
Matteo Scandolo1f5530b2019-12-17 10:12:31 -080031
32Quickstart
33----------
34
35Requires:
36
37- ``docker`` and ``go`` installed on your machine
Zack Williams6ebfe062020-04-09 16:08:29 -070038- `kind-voltha <https://gerrit.opencord.org/gitweb?p=kind-voltha.git>`_ cloned
39 on your machine
Matteo Scandolo1f5530b2019-12-17 10:12:31 -080040
41.. code:: bash
42
Matteo Scandoloef5d6f42020-07-27 16:46:38 -070043 TYPE=minimal WITH_RADIUS=y CONFIG_SADIS=y WITH_BBSIM=y ./voltha up
Matteo Scandolo1f5530b2019-12-17 10:12:31 -080044
Matteo Scandoloef5d6f42020-07-27 16:46:38 -070045For more information you can visit the :doc:`kind-voltha page <../kind-voltha/README>`.
Zack Williams16042b62020-03-29 22:03:16 -070046
47Developing changes on a virtual pod
48-----------------------------------
49
50We assume you already have downloaded the git repository you want to modify and
51your IDE is correctly set up.
52
53In this tutorial we are going to use ``voltha-go`` as an example.
54
55Make the required changes in the ``voltha-go`` repository (the process
56is the same for all the VOLTHA repositories) to the code and build the
57docker images and push them on your private dockerhub account:
58
59.. code:: bash
60
61 $ DOCKER_REGISTRY="matteoscandolo/" DOCKER_TAG="dev" make docker-build
62
63Then push them to your docker hub account:
64
65.. code:: bash
66
67 $ DOCKER_REGISTRY="matteoscandolo/" DOCKER_TAG="dev" make docker-push
68
69Deploy your changes on kind-voltha
70----------------------------------
71
72Create a copy of the `minimal-values.yaml` file:
73
74.. code:: bash
75
76 $ cp minimal-values.yaml dev-values.yaml
77
78And edit that file so that it contains the appropriate values for the images you want to try,
79for example uncomment and change these two lines (mind the indentation):
80
81.. code:: yaml
82
83 images:
84 ro_core:
85 repository: matteoscandolo/voltha-ro-core
86 tag: dev
87 rw_core:
88 repository: matteoscandolo/voltha-rw-core
89 tag: dev
90
91Then redeploy `kind-voltha` using that the edited value file:
92
93.. code:: bash
94
95 $ DEPLOY_K8S=no ./voltha down && DEPLOY_K8S=no EXTRA_HELM_FLAGS="-f dev-values.yaml" ./voltha up