A more recent blog post describing the installation process can be found here: https://medium.com/@realrealbot/openfaas-on-dcos-9d5927f4e725
- a running DC/OS cluster accessible without authentication
- an external Marathon-LB service running
- DC/OS CLI installed and configured (installation instructions can be found here or in the Dashboard top-left corner)
A quick way to have a local DCOS cluster running is https://github.com/dcos/dcos-vagrant. Do not forget to:
- add option
oauth_enabled: 'false'
in etc/config-1.9.yaml config file to disable authentication - set environment variable
export DCOS_VERSION=1.9.2
in shell before running vagrant up.
Marathon-LB can be easily installed from DCOS Universe packages (the default configuration is okay, just click on INSTALL button):
Plugin has been tested with DC/OS version 1.9.2, 1.9.4 and 1.10.2 .
Once you have your cluster running, you can easily install OpenFaas components. From faas-dcos project root run the following command :
dcos marathon group add faas-dcos.json
You should see services being deployed and, after a few minutes, you should have something like this:
OpenFaaS Interface should be now be available at http://<public_node_address>:10012/ui/
where <public_node_address> is the cluster node accessible from outside, is the one running Marathon-LB by the way...
You can now deploy functions using the web interface, for instance using these values:
image: functions/nodeinfo:latest
name: nodeinfo
handler: node main.js
or alternatively you can use the CLI for OpenFaaS with the following YAML stack file (functions.yaml
):
provider:
name: faas
gateway: http://<public_node_address>:10012
functions:
nodeinfo:
fprocess: node main.js
image: functions/nodeinfo:latest
skip_build: true
Remember to set the gateway to http://<public_node_address>:10012
!
Then run this command to deploy your function:
$ faas-cli deploy -f ./functions.yml
Once the function has been created, you should see a new service running in DC/OS
and it will be available to be executed