Charm the deploys ONOS, that stands for Open Network Operating System.
ONOS provides the control plane for a software-defined network (SDN), managing network components, such as switches and links, and running software programs or modules to provide communication services to end hosts and neighboring networks.
Requirements:
- vCPU: 2
- Memory: 4G
- Disk: 20G
With multipass:
multipass launch -c 2 -m 4G -d 20G
Install Microk8s:
sudo snap install microk8s --classic --channel 1.20/stable
sudo usermod -a -G microk8s `whoami`
sudo chown -f -R `whoami` ~/.kube
newgrp microk8s
microk8s.status --wait-ready
microk8s.enable storage ingress dns
Install, deploy, and configure Juju:
sudo snap install juju --classic --channel 2.9/stable
juju bootstrap microk8s
juju add-model onos
Clone the repository:
git clone https://github.com/charmed-osm/onos-operator
cd onos-operator/
Build and deploy the charm:
sudo snap install charmcraft
charmcraft build
juju deploy ./onos.charm --resource onos-image=onosproject/onos:latest
Set admin-password:
juju config onos admin-password=myadminpass
The current way of exposing the service is using the nginx-ingress-integrator
charm. It can be easily configured executing the following commands:
K8S_WORKER_IP=192.168.0.12 # change this IP with the IP of your K8s worker
juju config onos external-hostname=onos.$K8S_WORKER_IP.nip.io
juju deploy nginx-ingress-integrator ingress
juju relate ingress onos
Enable/disable the GUI:
juju config onos enable-gui=true # or false
Set JAVA_OPTS:
juju config onos java-opts=...
Set password for admin user:
juju config onos admin-password=myadminpass
Enable/disable guest user:
juju config onos enable-guest=true
Set password for guest user:
juju config onos guest-password=myadminpass
Restart ONOS service:
juju run-action onos/0 restart --wait
Start ONOS service:
juju run-action onos/0 start --wait
Stop ONOS service:
juju run-action onos/0 stop --wait
List activated application:
juju run-action onos/0 list-activated-apps --wait
List all available applications:
juju run-action onos/0 list-available-apps --wait
Activate an application:
juju run-action onos/0 activate-app --string-args name=org.onosproject.acl --wait
Deactivate an application:
juju run-action onos/0 deactivate-app --string-args name=org.onosproject.acl --wait
List roles:
juju run-action onos/0 list-roles --wait
Add user:
juju run-action onos/0 add-user --string-args username=myuser password=mypass group=admingroup --wait
Add group:
juju run-action onos/0 add-group --string-args groupname=mygroup roles=group,admin,manager,viewer --wait
Delete user:
juju run-action onos/0 delete-user --string-args username=myuser --wait
Delete group:
juju run-action onos/0 delete-group --string-args groupname=mygroup --wait
Create and activate a virtualenv with the development requirements:
virtualenv -p python3 venv
source venv/bin/activate
pip install -r requirements-dev.txt