Skip to content

Local setup

Denis Koljada edited this page Sep 25, 2021 · 2 revisions

The local setup encompasses a single syncmesh node with the corresponding MongoDB instance and listener. It is mostly used for faster-debugging purposes.

Prerequisites

You need the following CLIs and packages installed:

Deployment

After setting up, just run the script minikube_node_setup.sh inside local_setup_scripts in your CLI. This deploys a minikube node and the corresponding namespace with the MongoDB instance included. The namespace for the latter is openfaas-fn, same for your functions.

After the instance is running, use the functions_deployer.sh script to deploy your syncmesh function inside the local instance.

Finally, you can access both the dashboard and your function by port forwarding the OpenFaaS gateway:

kubectl port-forward svc/gateway -n openfaas 8080:8080

You can also use an app like kube-forwarder if you like doing it inside an external application more.

Similarly, do the same with the mongoDB instance if you have a listener:

kubectl port-forward openfaas-db-mongodb-0 -n openfaas-fn 27017:27017

Fetching the dashboard password

If you don't remember how to get the password for the OpenFaaS admin UI on localhost:8080, use the script get_openfaas_password.sh

Listener deployment

The listener is a standalone component, that can be deployed by just running go build on the listener.go file inside mongo_event_listener.

Teardown

minikube stop stops your instance, the listener can be stopped using go.

Clone this wiki locally