GithubHelp home page GithubHelp logo

doytsujin / local-openfaas-workbench Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zpratt/local-openfaas-workbench

0.0 1.0 0.0 15 KB

A simple way to bootstrap a local OpenFaaS environment

License: MIT License

local-openfaas-workbench's Introduction

local-openfaas-workbench

This repository contains my notes for how to quickly provision a local environment for tinkering with OpenFaaS.

Prerequisite Steps:

  1. brew update && brew install helm kind helmfile faas-cli
  2. helm plugin install https://github.com/databus23/helm-diff --version v3.0.0-rc.7
    • at the time of writing this, there wasn't a stable release of the diff plugin, but this required to avoid errors with helm3 and using helmfile

Provision The Cluster And Install OpenFaaS

  1. kind create cluster
  2. Ensure you're using the kind cluster context with kubectl: kubectl config set current-context kind-kind
  3. Verify the cluster is working: kubectl get nodes
  4. Install OpenFaaS to the local kind cluster: helmfile apply
  5. Show the state of the installed chart: helm list -n openfaas
  6. Wait for OpenFaaS pods to become ready: kubectl get po -n openfaas --watch
  7. Add 127.0.0.1 gateway.openfaas.local to /etc/hosts to map the default host entry for OpenFaaS ingress
  8. Open http://gateway.openfaas.local:30080/ui/ to verify you can see the OpenFaaS UI

Create a hello world function to verify everything is working correctly

This does nothing more than download the community template for node10 functions, which uses express under the covers.

  1. Pull the community node10 template: faas-cli template store pull node10-express
    • according to the OpenFaaS docs, this leverages a more performant implementation for functions
  2. Use the template to scaffold a function: faas-cli new --lang node10-express hello-world --gateway http://gateway.openfaas.local:30080
  3. Build the docker image for the function: faas-cli build -f hello-world.yml
  4. Load the image into kind so it can be deployed: kind load docker-image hello-world:latest
  5. Deploy the function: faas-cli up --skip-push -n openfaas-fn --update -f hello-world.yml --gateway http://gateway.openfaas.local:30080
  6. You can now interact with the function with the OpenFaaS UI at http://gateway.openfaas.local:30080/ui/

Wipe It Out

When you're done, you can wipe the slate clean by running:

  • kind delete cluster

TODO

References

local-openfaas-workbench's People

Contributors

zpratt avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.