... | @@ -27,25 +27,33 @@ The following figure illustrates the network that we will deploy. It is composed |
... | @@ -27,25 +27,33 @@ The following figure illustrates the network that we will deploy. It is composed |
|
|
|
|
|
## kube5g setup
|
|
## kube5g setup
|
|
* Build kube5g using build_m5g script:
|
|
* Build kube5g using build_m5g script:
|
|
|
|
|
|
```bash
|
|
```bash
|
|
$ ./build_m5g -k
|
|
$ ./build_m5g -k
|
|
```
|
|
```
|
|
|
|
|
|
* Install the requirements of kube5g
|
|
* Install the requirements of kube5g
|
|
- Either using the build_m5g script:
|
|
- Either using the build_m5g script:
|
|
|
|
|
|
```bash
|
|
```bash
|
|
$ ./build_m5g -i
|
|
$ ./build_m5g -i
|
|
```
|
|
```
|
|
|
|
|
|
- Or using the script of mosaic5g-operator:
|
|
- Or using the script of mosaic5g-operator:
|
|
1. go to the following directory ```mosaic5g_DIR/kube5g/openshift/m5g-operator``` (it is assumed that you are already in the directory ```mosaic5g_DIR```)
|
|
1. go to the following directory ```mosaic5g_DIR/kube5g/openshift/m5g-operator``` (it is assumed that you are already in the directory ```mosaic5g_DIR```)
|
|
|
|
|
|
```bash
|
|
```bash
|
|
$ cd kube5g/openshift/m5g-operator
|
|
$ cd kube5g/openshift/m5g-operator
|
|
```
|
|
```
|
|
|
|
|
|
2. Install the requirements of mosaic5g-operator by:
|
|
2. Install the requirements of mosaic5g-operator by:
|
|
|
|
|
|
```bash
|
|
```bash
|
|
$ ./m5goperator.sh -i
|
|
$ ./m5goperator.sh -i
|
|
```
|
|
```
|
|
|
|
|
|
* Make sure that everything is fine by checking the status of ```microk8s```
|
|
* Make sure that everything is fine by checking the status of ```microk8s```
|
|
|
|
|
|
```bash
|
|
```bash
|
|
$ microk8s.status
|
|
$ microk8s.status
|
|
microk8s is running
|
|
microk8s is running
|
... | @@ -64,12 +72,56 @@ The following figure illustrates the network that we will deploy. It is composed |
... | @@ -64,12 +72,56 @@ The following figure illustrates the network that we will deploy. It is composed |
|
dashboard: disabled
|
|
dashboard: disabled
|
|
registry: disabled
|
|
registry: disabled
|
|
```
|
|
```
|
|
|
|
|
|
|
|
* Add the dns to the configuration of kubectl
|
|
|
|
|
|
|
|
- get the dns of your network:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ nmcli device show enp0s31f6 |grep -i dns
|
|
|
|
IP4.DNS[1]: 192.168.1.1
|
|
|
|
```
|
|
|
|
|
|
|
|
where ```enp0s31f6``` is the interface name connected to the internet.
|
|
|
|
- Add the dns of your network to the config of kubectl
|
|
|
|
|
|
|
|
```bash
|
|
|
|
microk8s.kubectl -n kube-system edit configmap/kube-dns
|
|
|
|
```
|
|
|
|
and then add the dns. Here is an example:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# Please edit the object below. Lines beginning with a '#' will be ignored,
|
|
|
|
# and an empty file will abort the edit. If an error occurs while saving this file will be
|
|
|
|
# reopened with the relevant failures.
|
|
|
|
#
|
|
|
|
apiVersion: v1
|
|
|
|
data:
|
|
|
|
upstreamNameservers: '["192.168.1.1", "8.8.8.8", "8.8.4.4"]'
|
|
|
|
kind: ConfigMap
|
|
|
|
metadata:
|
|
|
|
annotations:
|
|
|
|
kubectl.kubernetes.io/last-applied-configuration: |
|
|
|
|
{"apiVersion":"v1","data":{"upstreamNameservers":"[\"192.168.1.1\", \"8.8.8.8\", \"8.8.4.4\"]"},"kind":"ConfigMap","metadata":{"annotations":{},"labels":{"addonmanager.kubernetes.io/mode":"EnsureExists"},"name":"kube-dns","namespace":"kube-system"}}
|
|
|
|
creationTimestamp: "2020-03-24T08:36:56Z"
|
|
|
|
labels:
|
|
|
|
addonmanager.kubernetes.io/mode: EnsureExists
|
|
|
|
name: kube-dns
|
|
|
|
namespace: kube-system
|
|
|
|
resourceVersion: "8703"
|
|
|
|
selfLink: /api/v1/namespaces/kube-system/configmaps/kube-dns
|
|
|
|
uid: 9f1c7876-6daa-11ea-93e1-ec21e5fc4532
|
|
|
|
```
|
|
|
|
|
|
* Run mosaic5g-operator as a pod in kubernetes
|
|
* Run mosaic5g-operator as a pod in kubernetes
|
|
- Go to ```mosaic5g_DIR/kube5g/openshift/m5g-operator```:
|
|
- Go to ```mosaic5g_DIR/kube5g/openshift/m5g-operator```:
|
|
|
|
|
|
```bash
|
|
```bash
|
|
$ cd kube5g/openshift/m5g-operator
|
|
$ cd kube5g/openshift/m5g-operator
|
|
```
|
|
```
|
|
|
|
|
|
- You can discover the capability provided by the script ```m5g-operator.sh```
|
|
- You can discover the capability provided by the script ```m5g-operator.sh```
|
|
|
|
|
|
```bash
|
|
```bash
|
|
$ ./m5goperator.sh
|
|
$ ./m5goperator.sh
|
|
This program installs the requirements to run kubernets on one machine,
|
|
This program installs the requirements to run kubernets on one machine,
|
... | @@ -93,34 +145,48 @@ The following figure illustrates the network that we will deploy. It is composed |
... | @@ -93,34 +145,48 @@ The following figure illustrates the network that we will deploy. It is composed |
|
./m5goperator.sh -i
|
|
./m5goperator.sh -i
|
|
./m5goperator.sh container start
|
|
./m5goperator.sh container start
|
|
```
|
|
```
|
|
|
|
|
|
- Apply the Custom Resource Defintion (CRD) to k8s cluster
|
|
- Apply the Custom Resource Defintion (CRD) to k8s cluster
|
|
|
|
|
|
```bash
|
|
```bash
|
|
$ ./m5goperator.sh -n
|
|
$ ./m5goperator.sh -n
|
|
```
|
|
```
|
|
|
|
|
|
- Run mosaic5g-operator as a pod
|
|
- Run mosaic5g-operator as a pod
|
|
|
|
|
|
```bash
|
|
```bash
|
|
$ ./m5goperator.sh container start
|
|
$ ./m5goperator.sh container start
|
|
```
|
|
```
|
|
|
|
|
|
* Now, Apply the custom resources to bring the LTE network up
|
|
* Now, Apply the custom resources to bring the LTE network up
|
|
|
|
|
|
```bash
|
|
```bash
|
|
$ kubectl apply -f deploy/crds/mosaic5g_v1alpha1_mosaic5g_cr.yaml
|
|
$ kubectl apply -f deploy/crds/mosaic5g_v1alpha1_mosaic5g_cr.yaml
|
|
```
|
|
```
|
|
|
|
|
|
After some time, the USRP will be on, and now you can connect the phone to the network.
|
|
After some time, the USRP will be on, and now you can connect the phone to the network.
|
|
|
|
|
|
### Bring the network down
|
|
### Bring the network down
|
|
- After that, you can bring the network down by:
|
|
- After that, you can bring the network down by:
|
|
|
|
|
|
```bash
|
|
```bash
|
|
$ kubectl delete -f deploy/crds/mosaic5g_v1alpha1_mosaic5g_cr.yaml
|
|
$ kubectl delete -f deploy/crds/mosaic5g_v1alpha1_mosaic5g_cr.yaml
|
|
```
|
|
```
|
|
|
|
|
|
- If you wan to stop the mosaic5g-operator:
|
|
- If you wan to stop the mosaic5g-operator:
|
|
|
|
|
|
```bash
|
|
```bash
|
|
$ ./m5goperator.sh container stop
|
|
$ ./m5goperator.sh container stop
|
|
```
|
|
```
|
|
|
|
|
|
- If you want to remove the Custom Resource Defintion (CRD) from the k8s cluster
|
|
- If you want to remove the Custom Resource Defintion (CRD) from the k8s cluster
|
|
|
|
|
|
```bash
|
|
```bash
|
|
$ ./m5goperator.sh -c
|
|
$ ./m5goperator.sh -c
|
|
```
|
|
```
|
|
|
|
|
|
- If you want to clean your machine from the installed softwar:
|
|
- If you want to clean your machine from the installed softwar:
|
|
|
|
|
|
```bash
|
|
```bash
|
|
$ ./m5goperator.sh -r
|
|
$ ./m5goperator.sh -r
|
|
``` |
|
``` |
|
|
|
\ No newline at end of file |