2019年6月24日月曜日

Openfaas for Raspberry pi

openfaasの導入方法について記載する。
オンプレでserverless体験をしてみたいので導入を行ってみる。


1)以下の方法で導入を行う。
git clone https://github.com/openfaas/faas-netes
cd faas-netes
kubectl apply -f ./namespaces.yml && kubectl apply -f ./yaml_armhf


2)実際に、導入が出来たのか確認を行う。
root@rasp-master:/home/pi/k8s/faas-netes#  kubectl -n openfaas get pod
======================================================================
NAME                           READY   STATUS    RESTARTS   AGE
alertmanager-96d4c9b7f-xr7w7   1/1     Running   0          4m26s
gateway-54878fcb85-5qjzj       2/2     Running   0          4m19s
nats-784c98db98-gf7kz          1/1     Running   0          4m21s
prometheus-6b7b994d9d-49w4d    1/1     Running   0          4m21s
queue-worker-c5776978d-sccpq   1/1     Running   0          4m20s
======================================================================

3)接続先を確認する。
root@rasp-master:/home/pi/k8s/faas-netes# kubectl -n openfaas get svc
================================================================================
NAME           TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
alertmanager   ClusterIP   10.104.22.60    <none>        9093/TCP         5m1s
gateway        NodePort    10.108.216.33   <none>        8080:31112/TCP   4m54s
nats           ClusterIP   10.109.27.162   <none>        4222/TCP         4m53s
prometheus     NodePort    10.99.157.125   <none>        9090:31119/TCP   4m53s
================================================================================

4)以下のアドレスでアクセスを行う。
http://IPアドレス:31112/

5)ログインが出来たことが確認できた。



5)openfaasのコマンドを導入してみる。
root@rasp-master:/home/pi/k8s/faas-netes# curl -SL https://cli.openfaas.com/ | sudo sh
==========================================================================================
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    23  100    23    0     0     23      0  0:00:01 --:--:--  0:00:01    23
100  3525  100  3525    0     0   2723      0  0:00:01  0:00:01 --:--:--  688k
armv7l
Downloading package https://github.com/openfaas/faas-cli/releases/download/0.8.14/faas-cli-armhf as /tmp/faas-cli-armhf
Download complete.

Running as root - Attempting to move faas-cli to /usr/local/bin
New version of faas-cli installed to /usr/local/bin
Creating alias 'faas' for 'faas-cli'.
  ___                   _____           ____
 / _ \ _ __   ___ _ __ |  ___|_ _  __ _/ ___|
| | | | '_ \ / _ \ '_ \| |_ / _` |/ _` \___ \
| |_| | |_) |  __/ | | |  _| (_| | (_| |___) |
 \___/| .__/ \___|_| |_|_|  \__,_|\__,_|____/
      |_|

CLI:
 commit:  25cada08609e00bed526790a6bdd19e49ca9aa63

 version: 0.8.14
=====================================================================================



と言うことで、色々と検証してみる。




0 件のコメント:

コメントを投稿

memo2

  ## ProxyPassにALBのパスルーティング先を記載 ## RUN echo 'LoadModule proxy_module modules/mod_proxy.so' >> /etc/apache2/apache2.conf ...