... | ... | @@ -166,9 +166,22 @@ user@workstation:~/ich/functions/rgb2wb$ cat Hopetoun_falls.jpg | faas-cli invok |
|
|
|
|
|
### Controller-0
|
|
|
|
|
|
#### faas-cli
|
|
|
> This method is under validation and not completed
|
|
|
|
|
|
In the host:
|
|
|
```sh
|
|
|
controller-0:~$ PASSWORD=$(head -c 12 /dev/urandom | shasum | cut -d' ' -f1)
|
|
|
controller-0:~$ echo $PASSWORD > password.txt
|
|
|
controller-0:~$ kubectl create secret generic basic-auth \
|
|
|
> --from-literal=basic-auth-user=admin \
|
|
|
> --from-literal=basic-auth-password="$PASSWORD"
|
|
|
secret/basic-auth created
|
|
|
controller-0:~$ kubectl apply -f https://raw.githubusercontent.com/okteto/samples/master/openfaas/openfaas.yml
|
|
|
controller-0:~$ kubectl delete -f https://raw.githubusercontent.com/okteto/samples/master/openfaas/openfaas.yml
|
|
|
```
|
|
|
|
|
|
## OpenFaaS Command Line Interface
|
|
|
|
|
|
### Controller-0 Host
|
|
|
|
|
|
```
|
|
|
controller-0:~$ curl -sSL https://cli.openfaas.com | sudo sh
|
... | ... | @@ -184,11 +197,13 @@ Hello World |
|
|
```
|
|
|
|
|
|
```sh
|
|
|
controller-0:~/ich$ mkdir media/camera-01/ media/camera-02/
|
|
|
controller-0:~/ich$ sudo chown -R sysadmin media/
|
|
|
controller-0:~/ich$ wget https://upload.wikimedia.org/wikipedia/commons/3/36/Hopetoun_falls.jpg
|
|
|
controller-0:~/ich$ cat Hopetoun_falls.jpg | faas-cli invoke rgb2wb --gateway http://192.168.1.91:8080 > media/camera-02/openfaas.jpg
|
|
|
```
|
|
|
|
|
|
Inside containers:
|
|
|
### Controller-0 Containers
|
|
|
|
|
|
```
|
|
|
controller-0:~/ich$ docker stop ich-homeassistant
|
... | ... | @@ -209,7 +224,7 @@ Hello World |
|
|
bash-5.0# cat /config/media/camera-02/openfaas.jpg | faas-cli invoke rgb2wb --gateway http://192.168.1.91:8080 > /config/media/camera-02/openfaasy.jpg
|
|
|
```
|
|
|
|
|
|
Manual
|
|
|
## OpenFaaS Manual Inspection
|
|
|
|
|
|
1. Take the snapshot
|
|
|
2. Visualize it: http://192.168.1.110:8123/local/media/camera-02/snapshot.jpg
|
... | ... | @@ -221,27 +236,12 @@ Manual |
|
|
|
|
|
4. Visualize it: http://192.168.1.110:8123/local/media/camera-02/openfaas.jpg
|
|
|
|
|
|
Dashboard
|
|
|
## OpenFaaS Dashboard
|
|
|
|
|
|
1. Add Prometheus as data source
|
|
|
2. Add [Original Open FaaS Dashboard](https://grafana.com/grafana/dashboards/3526)
|
|
|
3. Go to [OpenFaaS Grafana Dashboard](http://192.168.1.91:3000/d/9_Uy9ucZz/original-open-faas-dashboard?orgId=1&refresh=5s&from=1568485206901&to=1568506806901)
|
|
|
|
|
|
#### faas
|
|
|
|
|
|
> This method is under validation.
|
|
|
|
|
|
```sh
|
|
|
controller-0:~$ PASSWORD=$(head -c 12 /dev/urandom | shasum | cut -d' ' -f1)
|
|
|
controller-0:~$ echo $PASSWORD > password.txt
|
|
|
controller-0:~$ kubectl create secret generic basic-auth \
|
|
|
> --from-literal=basic-auth-user=admin \
|
|
|
> --from-literal=basic-auth-password="$PASSWORD"
|
|
|
secret/basic-auth created
|
|
|
controller-0:~$ kubectl apply -f https://raw.githubusercontent.com/okteto/samples/master/openfaas/openfaas.yml
|
|
|
controller-0:~$ kubectl delete -f https://raw.githubusercontent.com/okteto/samples/master/openfaas/openfaas.yml
|
|
|
```
|
|
|
|
|
|
## EdgeX Initialization
|
|
|
|
|
|
### Workstation
|
... | ... | |