Matteo Scandolo | 97c8131 | 2020-11-06 11:23:37 -0800 | [diff] [blame^] | 1 | Deploy multiple VOLTHA stacks on a Kubernetes cluster |
| 2 | ===================================================== |
| 3 | |
| 4 | VOLTHA is designed so that multiple stacks can work together sharing the same infrastructure. |
| 5 | You can read more about VOLTHA Stacks in this `document <https://docs.google.com/document/d/1Szo7vMS7M96O4Vsm1NpDYd3zckk9g0HLMck6eldwmcI/edit?usp=sharing>`_. |
| 6 | |
| 7 | This guide assumes you have a ``kubernetes`` cluster already up and running. |
| 8 | We also assume you have familiarity with the `kind-voltha <../kind-voltha/README.html>`_. tool. |
| 9 | |
| 10 | Deploy the common infrastructure |
| 11 | -------------------------------- |
| 12 | |
| 13 | When we refer to `infrastructure` components in VOLTHA, we are referring to: |
| 14 | |
| 15 | - ``Kafka`` |
| 16 | - ``ETCD`` |
| 17 | - ``ONOS`` |
| 18 | - ``RADIUS Server`` (optional) |
| 19 | - ``Sadis Server`` (optional) |
| 20 | |
| 21 | *Note that these components can be deployed on ``kubernetes`` via ``kind-voltha`` or can be completely independent.* |
| 22 | |
| 23 | .. code:: bash |
| 24 | |
| 25 | NAME=infra INFRA_NS=infra JUST_INFRA=y ./voltha up |
| 26 | |
| 27 | Note that this command will output configurations that you'll need to deploy your ``VOLTHA`` stack: |
| 28 | |
| 29 | .. code:: bash |
| 30 | |
| 31 | To configure your VOLTHA stack to use this infrastructure please export these variables: |
| 32 | export INFRA_NS=infra |
| 33 | export WITH_ETCD=etcd.infra.svc:2379 |
| 34 | export WITH_KAFKA=kafka.infra.svc:9092 |
| 35 | export WITH_ONOS=onos-onos-classic-hs.infra.svc:6653 |
| 36 | |
| 37 | Or use: |
| 38 | |
| 39 | INFRA_NS=infra WITH_ETCD=etcd.infra.svc:2379 WITH_KAFKA=kafka.infra.svc:9092 WITH_ONOS=onos-onos-classic-hs.infra.svc:6653 ./voltha up |
| 40 | |
| 41 | If you are deploying mutltiple VOLTHA stack, also remember to configure a different NAME, NAMESPACE and BBSIM_BASE_INDEX for each stack: |
| 42 | export NAME=voltha1 |
| 43 | export VOLTHA_NS=voltha1 |
| 44 | export ADAPTER_NS=voltha1 |
| 45 | export BBSIM_NS=voltha1 |
| 46 | export BBSIM_BASE_INDEX=1 |
| 47 | |
| 48 | Or use: |
| 49 | |
| 50 | INFRA_NS=infra WITH_ETCD=etcd.infra.svc:2379 WITH_KAFKA=kafka.infra.svc:9092 WITH_ONOS=onos-onos-classic-hs.infra.svc:6653 NAME=voltha1 VOLTHA_NS=voltha1 ADAPTER_NS=voltha1 BBSIM_NS=voltha1 BBSIM_BASE_INDEX=1 ./voltha up |
| 51 | |
| 52 | Deploy a VOLTHA stack |
| 53 | --------------------- |
| 54 | |
| 55 | Once the ``infrastructure`` is set up you can deploy a ``VOLTHA`` stack using this command: |
| 56 | |
| 57 | .. code:: bash |
| 58 | |
| 59 | NAME=voltha1 VOLTHA_NS=voltha1 ADAPTER_NS=voltha1 BBSIM_NS=voltha1 BBSIM_BASE_INDEX=1 ./voltha up |
| 60 | |
| 61 | NOTE that this command assumes you have exported the variables printed at the end of the ``infra`` deployment. |
| 62 | In particular the required variables are: |
| 63 | |
| 64 | - ``INFRA_NS=infra`` (optional) only required if you installed the infrastructure using ``kind-voltha`` |
| 65 | - ``WITH_ETCD=etcd.infra.svc:2379`` the ETCD address |
| 66 | - ``WITH_KAFKA=kafka.infra.svc:9092`` the KAFKA address |
| 67 | - ``WITH_ONOS=onos-onos-classic-hs.infra.svc:6653`` the ONOS address |
| 68 | |
| 69 | Deploying multiple VOLTHA stacks |
| 70 | ******************************** |
| 71 | |
| 72 | When you deploy a second ``VOLTHA`` stack there are some information that you need to customize in order to keep the |
| 73 | two stacks independent: |
| 74 | |
| 75 | - ``NAME`` - the name of the stack, is used in log and configuration files and to customize the KAFKA topics each stack |
| 76 | is listening on |
| 77 | - ``VOLTHA_NS, ADAPTER_NS, BBSIM_NS`` - are used to configure in which namespace the components are installed |
| 78 | - ``BBSIM_BASE_INDEX`` - is used to guarantee that different ``BBSim`` instances won't have the same ID (have to be |
| 79 | unique across all the stacks) |
| 80 | |
| 81 | Operate a VOLTHA stack |
| 82 | ---------------------- |
| 83 | |
| 84 | Once the installation completes a ``voltctl`` config file is generated for each cluster, in the format: |
| 85 | |
| 86 | .. code:: bash |
| 87 | |
| 88 | VOLTCONFIG="~/.volt/config-<$NAME>" |
| 89 | |
| 90 | In order to use multiple stacks via the same ``voltcl`` tools we **strongly** suggest to **always** specify |
| 91 | the appropriate configuration with the ``-c`` flag, for example: |
| 92 | |
| 93 | .. code:: bash |
| 94 | |
| 95 | voltctl -c ~/.volt/config-voltha1 adapter list |