OpenSource

OpenFaaS 설치하기

아르비스 2019. 11. 5. 11:23

https://github.com/openfaas/faas

 

openfaas/faas

OpenFaaS - Serverless Functions Made Simple. Contribute to openfaas/faas development by creating an account on GitHub.

github.com

 OpenFaaS는 쿠버네티스 클러스터에 도커 컨테이너의 기능을 구현하는 서버리스 모델이다. 이러한 쿠버네티스 클러스터를 배치하면, 더 이상 서비스 업체 종속에 대해서는 아무런 걱정도 할 필요가 없을 것이다. 물론 쿠버네티스의 클러스터의 자동 확장 없이는 비용 절감 효과를 얻지 못하겠지만, 새로운 프로그래밍 패러다임을 사용하면서 배치의 유연성을 확보할 수는 있을 것이다.

 

 

1. 설치하기.

1) Package 받기

 

installation page가 있지만, Windows 10 (docker for windows) 환경에서는 잘 설치가 안된다.

그냥 git에서 받아서 압축풀기

https://github.com/openfaas/faas.git

 

2) Power shell에서 실행 (OpenFaaS 실행)

power shell file 실행

./deploy_stack.ps1 -noAuth 

"disable basic authentication" 옵션으로 실행

 

3) faas-cli download

특이하게도 exe file은 별도로 받아야 함.

https://github.com/openfaas/faas-cli/releases

 

exe file을 받아서 Path 경로에 추가해주면 된다.

 

 

4) OpenFaaS Service 접속

http://localhost:8080/

 

생각보다 많은 container가 뜬다.

PS D:\Work\OpenFaaS> docker ps
CONTAINER ID        IMAGE                               COMMAND                  CREATED             STATUS              PORTS                NAMES
ead3bb34daf1        openfaas/queue-worker:0.8.0         "./app"                  17 minutes ago      Up 17 minutes       8080/tcp             func_queue-worker.1.q9153jfr65lyf7l8sqe31706l
b8f7d29b3ffe        openfaas/faas-swarm:0.7.3           "./faas-swarm"           17 minutes ago      Up 17 minutes       8080/tcp             func_faas-swarm.1.sgyrvv6br6yrinkmckd449zgz
88b066f203a8        openfaas/gateway:0.17.3             "./gateway"              17 minutes ago      Up 17 minutes       8080/tcp, 8082/tcp   func_gateway.1.06qkb1ofoiwtfe7scvz7bfv9c
36188fa19682        nats-streaming:0.11.2               "/nats-streaming-ser…"   17 minutes ago      Up 17 minutes       4222/tcp, 8222/tcp   func_nats.1.21csjryiwssohexvxrdamroiq
b7f3d9bbdaa6        prom/alertmanager:v0.18.0           "/bin/alertmanager -…"   17 minutes ago      Up 17 minutes       9093/tcp             func_alertmanager.1.tupaktk0k2y37zpd5ubi89a65
0fef60b7ced0        prom/prometheus:v2.11.0             "/bin/prometheus --c…"   17 minutes ago      Up 17 minutes       9090/tcp             func_prometheus.1.63joui2980w4wz8qbka4woaxd
4f2533cd2425        openfaas/basic-auth-plugin:0.17.0   "./handler"              17 minutes ago      Up 17 minutes                            func_basic-auth-plugin.1.vsv0kyr7i90psuxpjveo3m4tf
PS D:\Work\OpenFaaS>

 

 

 

 

5) 종료하기

$ docker stack rm func

 

그외 기타 command 확인

https://ericstoekl.github.io/faas/troubleshooting/#stop-and-remove-openfaas

 

Troubleshooting - OpenFaaS

Troubleshooting guide Timeouts Default timeouts are configured at the HTTP level and must be set both on the gateway and the function. Your function You can also enforce a hard-timeout for your function with the hard_timeout environmental variable. For wat

ericstoekl.github.io