Commit 69f00865 authored by Kevin Di Lallo's avatar Kevin Di Lallo
Browse files

doc update + tc-engine fix for user charts

parent bd35c346
Loading
Loading
Loading
Loading
+41 −19
Original line number Diff line number Diff line
@@ -48,18 +48,15 @@ We use the kubeadm method from [here](https://kubernetes.io/docs/setup/independe

Versions we use:

- 1.09, 1.10, 1.12, 1.13
- 1.09, 1.10, 1.12, 1.13, 1.14

>**IMPORTANT NOTE #1**<br>
>**IMPORTANT NOTE**<br>
K8s deployment has a dependency on the node's IP address.<br>
From our experience, it is **strongly recommended** to ensure that your platfrom always gets the same IP address for the main interface when it reboots. It also makes usage of the platform easier since it will reside at a well-known IPon your network.<br>
Depending on your network setup, this can be achieved either by setting a static IP address on the host or configuring the DHCP server to always give the same IP address to your platform.<br>

>**IMPORTANT NOTE #2**<br>
Latest version of K8s (1.14) has some changes incompatible with AdvantEDGE.<br>
We are currently working at resolving these.

How we do it:

###### STEP 1 - Verify pre-requisites [(here)](https://kubernetes.io/docs/setup/independent/install-kubeadm/#before-you-begin)

```
@@ -67,6 +64,7 @@ How we do it:
sudo swapoff -a
sudo sed -i '/ swap / s/^/#/' /etc/fstab
```

###### STEP 2 - Setup Docker daemon [(details)](https://kubernetes.io/docs/setup/cri/#docker)

```
@@ -93,7 +91,23 @@ sudo mkdir -p /etc/systemd/system/docker.service.d
sudo systemctl daemon-reload
sudo systemctl restart docker
```

###### STEP 3 - Install kubeadm, kubelet & kubectl [(details)](https://kubernetes.io/docs/setup/independent/install-kubeadm/#installing-kubeadm-kubelet-and-kubectl)

If upgrading from an older version, start by uninstalling it:

```
kubeadm reset

sudo apt-get purge kubeadm kubectl kubelet kubernetes-cni kube*
sudo apt-get autoremove  
sudo rm -rf ~/.kube

sudo reboot
```

To install the latest version:

```
sudo apt-get update && sudo apt-get install -y apt-transport-https curl

@@ -105,12 +119,14 @@ EOF'

sudo apt-get update

sudo apt-get install -y kubelet=1.13.0-00 kubeadm=1.13.0-00 kubectl=1.13.0-00 kubernetes-cni=0.6.0-00
sudo apt-get install -y kubelet kubeadm kubectl kubernetes-cni

# Lock current version
sudo apt-mark hold kubelet kubeadm kubectl
```

###### STEP 4 - Initialize master [(details)](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/#initializing-your-master)

```
sudo kubeadm init

@@ -118,51 +134,55 @@ sudo kubeadm init
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

```

###### STEP 5 - Install the network add-on [(details)](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/#pod-network)

We use [WeaveNet](https://www.weave.works/docs/net/latest/kubernetes/kube-addon/)

```
sudo sysctl net.bridge.bridge-nf-call-iptables=1
kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
```

###### STEP 6 - Allow scheduling pods on master node [(details)](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/#control-plane-node-isolation)

We currently support only single node K8s

```
kubectl taint nodes --all node-role.kubernetes.io/master-
```

###### STEP 7 - Enable kubectl auto-completion

```
echo "source <(kubectl completion bash)" >> ~/.bashrc
```
###### STEP 8 - Enable initializers
```
# Edit kube-apiserver configuration
sudo vi /etc/kubernetes/manifests/kube-apiserver.yaml

# Add this flag to the kube-apiserver command
--runtime-config=admissionregistration.k8s.io/v1alpha1

# Reboot the platform
sudo reboot
```

## Helm

We use [this](https://docs.helm.sh/using_helm/#installing-helm) procedure

Versions we use:

- 2.8.2, 2.12.3, 2.13.1

How we do it:

###### STEP 1 - Install Helm [(details)](https://docs.helm.sh/using_helm/#installing-helm)

```
sudo snap install helm --classic
```

###### STEP 2 - Install Tiller [(details)](https://docs.helm.sh/using_helm/#installing-tiller)

```
helm init
```

###### STEP 3 - Configure Tiller

```
# Create Tiller service account
kubectl create serviceaccount tiller --namespace kube-system
@@ -188,7 +208,9 @@ kubectl create -f tiller-crb.yaml
# Re-initialize Tiller with crb
helm init --service-account tiller --upgrade
```

###### STEP 4 - Configure repo

```
# Enable incubator charts
helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
+15 −5
Original line number Diff line number Diff line
@@ -15,20 +15,30 @@ Before running the tests, do the following:

- [Build AdvantEDGE](build.md)
- [Deploy AdvantEDGE](deploy.md)
- Install the demo1 scenario:
- Install the [demo1](../examples/demo1/README.md) & [demo2](../examples/demo2/README.md) scenarios:
  - [Import demo1 scenario](use/base-ops.md#import-demo1-scenario-in-advantedge)
  - [demo1 scenario information](../examples/demo1/README.md)
  - Use the same import procedure for demo2 scenario
- Make sure there is no deployed scenario
- [Install Cypress](#install-cypress)

## Install Cypress

To install Cypress run the following commands:

```
cd ~/AdvantEDGE/test
npm ci
```

## Run tests

Test specification files are located [here](../js-apps/meep-frontend/cypress/integration/tests)
Test specification files are located [here](../test/cypress/integration/tests)

### Cypress CLI

```
# Run Cypress tests using CLI
cd js-apps/meep-frontend
cd ~/AdvantEDGE/test
npm run cy:run
```

@@ -42,7 +52,7 @@ npm run cy:run

```
# Run/Debug Cypress tests using GUI
cd js-apps/meep-frontend
cd ~/AdvantEDGE/test
npm run cy:open
```

+28 −11
Original line number Diff line number Diff line
# Demo1

A simple scenario used to showcase platform capabilities.

This scenario is composed of three applications (_iperf-server_, _iperf-proxy & _demo-server_) deployed across multiple tiers of the network (fog/edge/cloud).
@@ -12,6 +13,7 @@ Internal client traffic is iperf only and has no GUI.
External client accesses both iperf and demo servers and has a GUI.

The platform capabilities demonstrated with this scenario are:

- Scenario deployment (dynamic charts)
- Network tiering
- Internal & external clients
@@ -22,6 +24,7 @@ The platform capabilities demonstrated with this scenario are:
- Monitoring (demo specific dashboards)

## Scenario composition

The scenario is composed of the following components:

- 2 distant cloud application: _iperf_ server and _demo_ server
@@ -35,11 +38,13 @@ The scenario is composed of the following components:
  - 1 external UE that runs a Demo client

#### Internal UE application

Upon scenario startup, internal UE application (an iperf client) connects automatically to the closest iperf server and starts transferring traffic.

As the UE moves around the network, edge node instance will change.

#### External UE

External UE application is a javascript application running in an external browser.

To start the aooplcation, load the following page in the browser `<AdvantEDGE-node-ip-address>:31111`
@@ -47,6 +52,7 @@ To start the aooplcation, load the following page in the browser `<AdvantEDGE-no
The application shows details about the connection, allows to start a state counter and iperf traffic and presents an image. See Iperf & Demo server sub-sections for more details.

#### Iperf server

This is a standard iperf server that will terminate iperf client connections.

There is an iperf client running in the internal UE and another one in the external UE.
@@ -54,6 +60,7 @@ There is an iperf client running in the internal UE and another one in the exter
External UE needs the iperf proxy running to be able to control the iperf client from the javascript GUI.

#### Demo server

Demo server is a web server that maintains a UE state and also stores unique data.
Only the external UE accesses the demo server.

@@ -65,39 +72,48 @@ On the UE GUI, the counter is started by pressing the button.
When the external UE moves in the network and transitions from one edge instance to another, the "UE state" (e.g. the counter value) is transferred using the application state transfer. On the UE GUI, the counter continue incrementing (e.g. not reset to zero) when the UE moves in the network.

## Using the scenario

The following steps need to be done prior to using this scenario

#### Dockerize demo applications
Only need to do it once, or when the demo application changes
#### Build demo binaries

To build _iperf-proxy_ & _demo-server_ binaries from source code:

In a command line shell
```
cd ~/AdvantEDGE/examples/demo1/
./dockerize.sh
./build-demo1.sh
```
> Demo Application binaries are dockerized (containerized) and the container images are stored in the local Docker registry.<br> Next time you want to use the demo scenario; demo application containers will be available

#### Source code compilation
Compiling from source code is available through the command:
> **NOTE:** Binary files are created in ./bin/ folder

#### Dockerize demo applications

Demo Application binaries must be dockerized (containerized) as container images in the local Docker registry. This step is necessary every time the demo binaries are updated.

To generate docker images from demo binary files:

```
cd ~/AdvantEDGE/examples/demo1/
./build-demo1.sh
./dockerize.sh
```
> As a result, both the iperf-proxy and demo-server app are compiled and demo-server is dockerized

#### Configure demo specific dashboards

Only need to do it once, or when the demo dashboard changes

Follow the procedure described in [Configuring Monitoring](../../docs/use/monitoring.md#configure-dashboards). The demo specific dashboard that is loaded can also be found at `AdvantEDGE/examples/demo1/demo1-dashboards.json`
Follow the procedure described in [Scenario Monitoring](../../docs/use/monitoring.md#configure-dashboards). The demo specific dashboard that is loaded can also be found at `AdvantEDGE/examples/demo1/demo1-dashboards.json`

> Demo specific dashboards are stored in Kibana.<br> Next time you want to use the demo scenario; demo specific dashboard will be available.
> Demo specific dashboards are stored in Kibana.<br>
> Next time you want to use the demo scenario; demo specific dashboard will be available.

#### Start iperf proxy

Do it everytime you start using the demo when the iperf-proxy is not running

This demo scenario requires iperf installed on the AdvantEDGE host and the iperf proxy running.

If `which iperf` returns nothing, install iperf

```
sudo apt-get install iperf
# the following should now return /usr/bin/iperf
@@ -105,6 +121,7 @@ which iperf
```

Start iperf proxy, in a command line shell

```
cd ~/AdvantEDGE/examples/demo1/bin/iperf-proxy
./iperf-proxy
+13 −3
Original line number Diff line number Diff line
# Demo2
This scenario is the same as [demo1](../demo1/README.md) except that it uses a different deployment technique.

Demo2 uses _user charts_ to deploy its components deployment instead of using dynamic chart generation.
This scenario is the same as [demo1](../demo1/README.md) except that it uses _user charts_ to deploy its components instead of using dynamic chart generation.

Functionally it is the same as demo1
## Prerequisites

- Running AdvantEDGE platform
- Demo1 docker images
  - [Build demo1](../demo1/README.md)
  - [Dockerized demo1](../demo1/README.md)

## Using the scenario

- [Import scenario in MEEP](../../docs/use/base-ops.md#import-demo1-scenario-in-advantedge)
- Deploy scenario
  - Scenario behavior is identical to [demo1](../demo1/README.md)
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -496,7 +496,7 @@ func parseScenario(scenario ceModel.Scenario) {
							// Retrieve service ports
							var servicePorts []ceModel.ServicePort
							port, err := strconv.ParseInt(userChartGroup[2], 10, 32)
							if err != nil {
							if err == nil {
								var servicePort ceModel.ServicePort
								servicePort.Port = int32(port)
								servicePort.Protocol = userChartGroup[3]