[VOL-2870]

Add Makefile with lint and test targets to kind-voltha (not enabled yet)
Add VERSION and .gitreview file
Add headers to pass license check

Change-Id: I960b667d574b86ea143eb9d7c07895a807425cff
7 files changed
tree: 47bbfb8727c5106721231c10eb8580f5ca7c162c
  1. .gitignore
  2. .gitreview
  3. LICENSE
  4. Makefile
  5. README.md
  6. RELEASE_NOTES.md
  7. VERSION
  8. full-cluster.cfg
  9. full-values.yaml
  10. minimal-cluster.cfg
  11. minimal-values.yaml
  12. monkey-values.yaml
  13. onos-files/
  14. releases/
  15. resources/
  16. scripts/
  17. voltha
README.md

VOLTHA DEPLOYMENT TOOL

Thie repository describes how to the the voltha script to install a VOLTHA deployment. voltha can be used to deploy an instance into an existing Kubernetes cluster (physical or virtual) or can be start up a local docker-in-docker KinD Kuberentes cluster in which to deploy VOLTHA.

When deploying VOLTHA there are several configuration options tha can be set as described in the CONFIGURATION section below. All configuration options are specified as envirment variables.

PREREQUISITES

The voltha script uses several standard Linux tools to deploy VOLTHA including curl, sed, and jq. This tools must be installed before using the script. The script checks for the presence of these tools before it deployes VOLTHA and will exit with an error if the tools are not present.

NOTE: If you are deploying a KinD Kubernetes cluster using the voltha script, you must also also have Docker installed

INSTALL TYPE

The voltha script can install two variations or types of a VOLTHA deployment: minimal or full. The difference is characterized in the following table:

RESOURCEMINIMALFULL
K8s Control Plane Nodes11
K8s Workers23
EtcdOperator ComponentsOperator onlyOperator, Backup, Restore
EtcdCluster1 Member3 Members

Throughout this README.md file deployment and configuration files are referenced in the form $TYPE-cluster.cfg and $TYPE-values.yaml. Depending on which type of deloyment you wish to install replace $TYPE with either minimal or full. If you set the environment variable TYPE to the desired deployment type, example below, then the commands can be executed via a simply copy and paste to your command line.

export TYPE=minimal

TL;DR

OK, if you really don't care how it starts and you just want it started. After cloning the repository and making sure you have the prerequisites installed, just execute

DEPLOY_K8S=y WITH_BBSIM=y WITH_RADIUS=y CONFIG_SADIS=y  ./voltha up

and the minimal cluster should start.

To remove voltha use DEPLOY_K8S=y ./voltha down

RUN WITHOUT CLONING REPOSITORY

The voltha script can be run without cloning the complete repository. To do so, download the script and run it.

curl -sSL https://raw.githubusercontent.com/ciena/kind-voltha/master/voltha --output ./voltha
chmod +x ./voltha
DEPLOY_K8S=y WITH_BBSIM=y WITH_RADIUS=y CONFIG_SADIS=y  ./voltha up

Demo @ Speed NOTE: Shown significantly sped up (20x), actual install was about 8 minutes.

CONFIGURATION

The option should be set using environment variables, thus to start VOLTHA with the BBSIM POD, RADIUS, and ONOS SADIS configured you could use the following command:

WITH_BBSIM=yes WITH_RADIUS=y CONFIG_SADIS=y  voltha up

To start a specific version of VOLTHA, e.g. 2.3, you could use the following commands:

git checkout tags/3.0.3 -b 3.0.3
source releases/voltha-2.3 && voltha up

Please check the releases folder to see the available ones and pick the correct tag associatet do that release.

OPTIONDEFAULTDESCRIPTION
TYPEminimalminimal or full and determines number of cluster nodes and etcd cluster members
NAMETYPEName of the KinD Cluster to be created
DEPLOY_K8SyesShould the KinD Kubernetes cluster be deployed?
JUST_K8SnoShould just the KinD Kubernetes cluster be depoyed? (i.e. no VOLTHA)
VOLTHA_NSvolthaK8s namespace into which to deploy voltha PODs
INFRA_NSdefaultK8s namespace into which to deploy infrastructure PODs
BBSIM_NSvolthaK8s namespace into which to deploy BBSIM PODs
ADAPTER_NSvolthaK8s namespace into which to deploy VOLTHA adapters
WITH_BBSIMnoShould the BBSIM POD be deployed?
NUM_OF_BBSIM1number of BBSIM POD to start (minimum = 1, maximum = 10)
WITH_ONOSyesDeploy ONOS (yes/no) or service:port of external ONOS
WITH_KAFKAyesDeploy private Kafka (yes/no) or k8s servce:port of external Kafka
WITH_ETCDyesDeploy private etcd (yes/no) or k8s service:port of external etcd
WITH_RADIUSnoDeploy sample RADIUS server (yes/no) or a k8s service:port of external RADIUS
WITH_EAPOLnoConfigure the OLT app to push EAPOL flows
WITH_DHCPnoConfigure the OLT app to push DCHP flows
WITH_IGMPnoConfigure the OLT app to push IGMP flows
WITH_TIMINGSnoOutputs duration of various steps of the install
WITH_CHAOSnoStarts kube-monkey to introduce chaos
WITH_ADAPTERSyesShould device adpters be installed, if no overrides options for specific adapters
WITH_SIM_ADAPTERSnoShould simulated device adapters be deployed (simulated adpaters deprecated)
WITH_OPEN_ADAPTERSyesShould open OLT and ONU adapters be deployed
WITH_PORT_FORWARDSyesForwards ports for some services from localhost into the K8s cluster
CONFIG_SADISnoConfigure SADIS entries into ONOS. Values: yes, no, file, url, or bbsim
SADIS_SUBSCRIBERShttp://bbsim.voltha.svc:50074/v2/subscribers/%sURL for ONOS to use to query subsriber information if CONFIG_SADIS is set to url
SADIS_BANDWIDTH_PROFILEShttp://bbsim.voltha.svc:50074/v2/bandwidthprofiles/%sURL for ONOS to use to query bandwidth profiles if CONFIG_SADIS is set to url
SADIS_CFGonos-files/onos-sadis-sample.jsonSADIS Configuration File to push, if CONFIG_SADIS set
INSTALL_ONOS_APPSnoReplaces/installs ONOS OAR files in onos-files/onos-apps
INSTALL_KUBECTLyesShould a copy of kubectl be installed locally?
INSTALL_HELMyesShould a copy of helm be installed locallly?
VOLTHA_LOG_LEVELWARNLog level to set for VOLTHA core processes
ONOS_CHARTonf/volthaHelm chart to used to install ONOS
ONOS_CHART_VERSIONlatestVersion of helm chart for ONOS
VOLTHA_CHARTonf/volthaHelm chart to used to install voltha
VOLTHA_CHART_VERSIONlatestVersion of Helm chart to install voltha
VOLTHA_ADAPTER_SIM_CHARTonf/voltha-adapter-simulatedHelm chart to use to install simulated device adapter
VOLTHA_ADAPTER_SIM_CHART_VERSIONlatestVersion of Helm chart to install simulated device adapter
VOLTHA_BBSIM_CHARTonf/bbsimHelm chart to use to install bbsim
VOLTHA_BBSIM_CHART_VERSIONlatestVersion of Helm chart to install bbim
VOLTHA_ADAPTER_OPEN_OLT_CHARTonf/voltha-adapter-openoltHelm chart to use to install OpenOlt adapter
VOLTHA_ADAPTER_OPEN_OLT_CHART_VERSIONlatestVersion of Helm chart to install OpenOlt adapter
VOLTHA_ADAPTER_OPEN_ONU_CHARTonf/voltha-adapter-openonuHelm chart to use to install OpenOnu adapter
VOLTHA_ADAPTER_OPEN_ONU_CHART_VERSIONlatestVersion of Helm chart to install OpenOnu adapter
ONLY_ONEyesRun a single rw-core, no api-server, and no ssh CLI
ENABLE_ONOS_EXTRANEOUS_RULESnoSet ONOS to allows flow rules not set via ONOS
UPDATE_HELM_REPOSyesUpdate the Helm repository with the latest charts before installing
WAIT_ON_DOWNyesWhen tearing down the VOLTHA, don't exit script until all containers are stoped
WAIT_TIMEOUT30mTime to wait before timing out on lengthy operations
KIND_VERSIONv0.5.1Version of KinD to install if using a KinD cluster
VOLTCTL_VERSIONlatestVersion of voltctl to install or up/downgrade to and use
ONOS_API_PORTdynamic(advanced) Override dynamic port selection for port forward for ONOS API
ONOS_SSH_PORTdynamic(advanced) Override dynamic port selection for port forward for ONOS SSH
VOLTHA_API_PORTdynamic(advanced) Override dynamic port selection for port forward for VOLTHA API
VOLTHA_SSH_PORTdynamic(advanced) Override dynamic port selection for port forward for VOLTHA SSH
VOLTHA_ETCD_PORTdynamic(advanced) Override dynamic port selection for port forward for VOLTHA etcd
VOLTHA_KAFKA_PORTdynamic(advanced) Override dynamic port selection for port forward for VOLTHA Kafka API

Custom Namespaces

Separate namespaces can be specified for various components

  • VOLTHA_NS (default: voltha) for cores, ofagent, Etcd (yes), Kafka (yes)
  • ADAPTER_NS (default: voltha) for device adapters
  • INFRA_NS (default: default) for RADIUS, ONOS, Etcd (external), Kafka (external)
  • BBSIM_NS (default: voltha) for BBSIM instances

As an example BBSIM_NS=devices deployes BBSim in the devices namespace.

External Kafka, Etcd and ONOS

WITH_ETCD, WITH_KAFKA and WITH_ONOS can have different values depending on the deployment needs:

VALUEDESCRIPTION
yes or yinstalls Etcd and Kafka in the voltha namespace
externalinstalls Etcd and Kafka in the default namespace
<endpoint>connects the deployment to pre-deployed instance of the service

When specifying the <endpoint> of the service the format for each of these is service-name[:port]. Port is optional and will default to the standard port for the given service. For example, WITH_KAFA=kafka.infra.svc.cluster.local

Specifying the endpoint enable to use ./voltha up incrementally, for example:

DEPLOY_K8S=n WITH_BBSIM=y WITH_RADIUS=no CONFIG_SADIS=no  WITH_ONOS=onos-openflow.infra.svc.cluster.local  WITH_ETCD=etcd-cluster-client.infra.svc.cluster.local WITH_KAFKA=kafka.infra.svc.cluster.local  INFRA_NS=infra BBSIM_NS=devices ADAPTER_NS=adapters ./voltha up

starts VOLTHA with external ONOS,KAFKA,ETCD in the infra namespace.

CONFIG_SADIS Values

VALUEDESCRIPTION
yes or fileuse the contents of a file to configure SADIS in ONOS. The file used defaults to
onos-files/onos-sadis-sample.json but can be specified via the SADIS_CFG
environment variable
nodo not configure ONOS for SADIS usage
urlconfigure ONOS to use SADIS via a URL. The URL used for subscriber information
is specified in the variable SADIS_SUBSCRIBERS and the URL used for bandwidth
profiles is specified in the variable SADIS_BANDWIDTH_PROFILES
bbsimconfigure ONOS use use the SADIS servers that are part of BBSIM

GENERATED CONFIGURATION

When the voltha script is run it generates a file that contains the configuration settings. This file will be named $TYPE-env.sh. The user can source this file to set the configuration as well as establish key environment variables in order to access VOLTHA, including:

VARIABLEDESCRIPTION
KUBECONFIGSets the configuration file for the Kubernetes control application kubectl
VOLTCONFIGSets the configuration file for the VOLTHA control application voltctl
PATHAugments the PATH to include kubectl and voltctl

After voltha up is run, it is useful to source this file.

QUICK CHECK

After source the $TYPE-env.sh file, you should be able to access VOLTHA via the control application voltctl. To validate this you can use the following command

voltctl version

and should see output similar to

Client:
 Version        1.0.14
 Go version:    go1.12.8
 Vcs reference: 086629f0403fe67213fa0df5dc4d7b7ee317cbac
 Vcs dirty:     false
 Built:         2020-03-03T13:48:00Z
 OS/Arch:       linux/amd64

Cluster:
 Version        2.3.3-dev
 Go version:    1.13.8
 Vcs feference: aa8bd4dcc3510caf2c5362106d9bff2852663d31
 Vcs dirty:     false
 Built:         2020-03-06T16:16:47Z
 OS/Arch:       linux/amd64

TROUBLESHOOTING

When VOLTHA is installed the install log is written to the file install-$TYPE.log. If the install appears stalled or is not completing consulting this file may indicate the reason.

Similarly, when VOLTHA is uninstalled down-$TYPE.log is written and should be consulted in the event of an error or unexpected result.