faas-dcos

command module
v0.0.0-...-11a2ac0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2017 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

faas-dcos

DC/OS plugin for OpenFaas

A more recent blog post describing the installation process can be found here: https://medium.com/@realrealbot/openfaas-on-dcos-9d5927f4e725

Prerequisites:

  1. a running DC/OS cluster accessible without authentication
  2. an external Marathon-LB service running
  3. 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:

  1. add option oauth_enabled: 'false' in etc/config-1.9.yaml config file to disable authentication
  2. 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):

Marathon-LB in Universe

Plugin has been tested with DC/OS version 1.9.2, 1.9.4 and 1.10.2 .

Installation

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 running

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

Function running

and it will be available to be executed

Function invoked

TODO

  1. Handle authentication and token expiration (see #292)
  2. Marathon 1.5 compatibility (remove go-marathon or #324)

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址