Adding openfaas (#620)
Credits: https://github.com/kenfdev/rancher-cattle-openfaas
This commit is contained in:
parent
44d518231c
commit
75f4db112a
3
templates/openfaas/0/README.md
Normal file
3
templates/openfaas/0/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
This is a catalog that spins up an OpenFaaS(https://github.com/alexellis/faas) stack with Rancher as the backend. The `faas-rancher` container is the proxy that connects OpenFaas and Rancher.
|
||||
|
||||
`faas-rancher` is in an extremely early stage and is meant only to be used in development.
|
56
templates/openfaas/0/docker-compose.yml
Normal file
56
templates/openfaas/0/docker-compose.yml
Normal file
@ -0,0 +1,56 @@
|
||||
version: '2'
|
||||
services:
|
||||
lb:
|
||||
image: rancher/lb-service-haproxy:v0.7.9
|
||||
ports:
|
||||
- 8080:8080/tcp
|
||||
- 9090:9090/tcp
|
||||
- 9093:9093/tcp
|
||||
labels:
|
||||
io.rancher.container.agent.role: environmentAdmin
|
||||
io.rancher.container.create_agent: 'true'
|
||||
prometheus:
|
||||
image: kenfdev/prometheus:latest-cattle
|
||||
environment:
|
||||
no_proxy: gateway
|
||||
stdin_open: true
|
||||
tty: true
|
||||
command:
|
||||
- -config.file=/etc/prometheus/prometheus.yml
|
||||
- -storage.local.path=/prometheus
|
||||
- -storage.local.memory-chunks=10000
|
||||
- --alertmanager.url=http://alertmanager:9093
|
||||
labels:
|
||||
io.rancher.container.pull_image: always
|
||||
faas-rancher:
|
||||
image: kenfdev/faas-rancher
|
||||
environment:
|
||||
FUNCTION_STACK_NAME: ${FUNCTION_STACK_NAME}
|
||||
CATTLE_URL: ${CATTLE_URL}
|
||||
CATTLE_ACCESS_KEY: ${CATTLE_ACCESS_KEY}
|
||||
CATTLE_SECRET_KEY: ${CATTLE_SECRET_KEY}
|
||||
stdin_open: true
|
||||
tty: true
|
||||
labels:
|
||||
io.rancher.container.pull_image: always
|
||||
gateway:
|
||||
image: functions/gateway:0.6.2
|
||||
environment:
|
||||
dnsrr: 'true'
|
||||
functions_provider_url: http://faas-rancher:8080/
|
||||
stdin_open: true
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
tty: true
|
||||
labels:
|
||||
io.rancher.container.pull_image: always
|
||||
alertmanager:
|
||||
image: functions/alertmanager:latest
|
||||
environment:
|
||||
no_proxy: gateway
|
||||
stdin_open: true
|
||||
tty: true
|
||||
command:
|
||||
- -config.file=/alertmanager.yml
|
||||
labels:
|
||||
io.rancher.container.pull_image: always
|
71
templates/openfaas/0/rancher-compose.yml
Normal file
71
templates/openfaas/0/rancher-compose.yml
Normal file
@ -0,0 +1,71 @@
|
||||
.catalog:
|
||||
name: "OpenFaaS"
|
||||
version: "v0.0.1"
|
||||
description: "Enable Rancher as a backend for Functions as a Service (OpenFaaS)"
|
||||
uuid: "openfaas-0"
|
||||
minimum_rancher_version: v1.5.0
|
||||
questions:
|
||||
- variable: "CATTLE_URL"
|
||||
description: "The v2-beta Rancher Server Endpoint"
|
||||
label: "Rancher Server Endpoint URL"
|
||||
required: true
|
||||
type: "string"
|
||||
- variable: "CATTLE_ACCESS_KEY"
|
||||
description: "The Rancher API Access Key"
|
||||
label: "API Access Key"
|
||||
required: true
|
||||
type: "string"
|
||||
- variable: "CATTLE_SECRET_KEY"
|
||||
description: "The Rancher API Secret Key"
|
||||
label: "API Secret Key"
|
||||
required: true
|
||||
type: "string"
|
||||
- variable: "FUNCTION_STACK_NAME"
|
||||
description: "The stack name faas functions will be deployed to. Don't forget to create it!"
|
||||
label: "Functions Stack Name"
|
||||
required: true
|
||||
type: "string"
|
||||
|
||||
version: '2'
|
||||
services:
|
||||
lb:
|
||||
scale: 1
|
||||
start_on_create: true
|
||||
lb_config:
|
||||
certs: []
|
||||
port_rules:
|
||||
- priority: 1
|
||||
protocol: http
|
||||
service: gateway
|
||||
source_port: 8080
|
||||
target_port: 8080
|
||||
- priority: 2
|
||||
protocol: http
|
||||
service: prometheus
|
||||
source_port: 9090
|
||||
target_port: 9090
|
||||
- priority: 3
|
||||
protocol: http
|
||||
service: alertmanager
|
||||
source_port: 9093
|
||||
target_port: 9093
|
||||
health_check:
|
||||
healthy_threshold: 2
|
||||
response_timeout: 2000
|
||||
port: 42
|
||||
unhealthy_threshold: 3
|
||||
initializing_timeout: 60000
|
||||
interval: 2000
|
||||
reinitializing_timeout: 60000
|
||||
prometheus:
|
||||
scale: 1
|
||||
start_on_create: true
|
||||
faas-rancher:
|
||||
scale: 1
|
||||
start_on_create: true
|
||||
gateway:
|
||||
scale: 1
|
||||
start_on_create: true
|
||||
alertmanager:
|
||||
scale: 1
|
||||
start_on_create: true
|
BIN
templates/openfaas/catalogIcon-openfaas.png
Normal file
BIN
templates/openfaas/catalogIcon-openfaas.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
7
templates/openfaas/config.yml
Normal file
7
templates/openfaas/config.yml
Normal file
@ -0,0 +1,7 @@
|
||||
name: OpenFaaS
|
||||
description: |
|
||||
Functions as a Service - a serverless framework for Docker
|
||||
version: v0.0.1
|
||||
category: Platform
|
||||
license: MIT
|
||||
projectURL: https://github.com/kenfdev/rancher-cattle-openfaas
|
Loading…
x
Reference in New Issue
Block a user