azarudeen90 / riff

riff is for functions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

riff is for functions

A FaaS for Kubernetes

Installation

You can install the system using a Helm chart or by manually building and deploying the components.

Manual install of riff

Prerequisites

You need:

  • A running 1.7+ Kubernetes cluster with at least 4GB of memory. These instructions assume minikube for now.

    Tip
    We recommend using Minikube v0.23.0 or v0.24.1 and avoiding v0.24.0 due to some DNS issues
    minikube start --memory=4096
  • Git installed.

  • A Java 8 environment.

  • A working Go environment, with clones of the customized fabric8io/kubernetes-model, the function-sidecar repository, the topic-controller repository and the http-gateway repository.

    cd $(go env GOPATH)   #defaults to ~/go
    git clone -o upstream https://github.com/projectriff/kubernetes-model src/github.com/fabric8io/kubernetes-model/
    git clone -o upstream https://github.com/projectriff/function-sidecar src/github.com/projectriff/function-sidecar/
    git clone -o upstream https://github.com/projectriff/topic-controller src/github.com/projectriff/topic-controller/
    git clone -o upstream https://github.com/projectriff/http-gateway src/github.com/projectriff/http-gateway/
  • A clone of the riff, function-controller, java-function-invoker, node-function-invoker, shell-function-invoker and python2-function-invoker repos.

    Note
    These repos should be cloned under a unique root directory since we will be using relative paths during the build.
    #cd <some_root_dir>
    git clone -o upstream https://github.com/projectriff/riff.git
    git clone -o upstream https://github.com/projectriff/function-controller.git
    git clone -o upstream https://github.com/projectriff/java-function-invoker.git
    git clone -o upstream https://github.com/projectriff/node-function-invoker.git
    git clone -o upstream https://github.com/projectriff/shell-function-invoker.git
    git clone -o upstream https://github.com/projectriff/python2-function-invoker.git

From now on, this README assumes you’re running commands from the riff repository clone:

cd riff

Build the kubernetes-model jar Enhanced with the Types for the CustomResources

./build-model upstream riff

Point your local Docker environment to the Docker environment running in minikube:

eval $(minikube docker-env)

Build the Function Sidecar, HTTP Gateway and Topic Controller

./build-function-sidecar upstream master
./build-http-gateway upstream master
./build-topic-controller upstream master

Setup the Kubernetes environment

Create Function and Topic Custom Resource Definitions:

kubectl apply -f config/types

Build the Function Controller

./build-function-controller upstream master

Build the java-function-invoker, node-function-invoker, shell-function-invoker and python2-function-invoker

./build-function-invokers upstream master

Deploy Kafka/Zookeeper

kubectl apply -f config/kafka

Deploy RIFF

kubectl apply -f config

If your cluster has RBAC enabled, then you also need to create a Role and a RoleBinding:

kubectl apply -f config/rbac

Deploy Tracing (Zipkin) Dashboard

kubectl apply -f config/zipkin

See how to use the dashboards.

To tear it all down

Once you’re done playing with riff (see samples below), you can destroy everything created above by running

./teardown

Try Some Samples

With riff running try some of the samples.

About

riff is for functions

License:Apache License 2.0


Languages

Language:Shell 100.0%