nats-connector
by Helm
Trigger OpenFaaS Functions from NATS Pub/Sub
About this chart
Trigger OpenFaaS Functions from NATS Pub/Sub
The OpenFaaS nats-connector invokes functions in response to events published on a NATS pub/sub subject.
Prerequisites
-
Install OpenFaaS
You must have a working OpenFaaS installation. You can find instructions in the docs, including instructions to also install OpenFaaS via Helm.
Install the Chart
- Add the OpenFaaS chart repo and deploy the
nats-connectorchart. We recommend installing it in the same namespace as the rest of OpenFaaS
$ helm repo add openfaas https://openfaas.github.io/faas-netes/
$ helm upgrade nats-connector openfaas/nats-connector \
--install \
--namespace openfaas
The above command will also update your helm repo to pull in any new releases.
Configuration
Additional nats-connector options in values.yaml.
| Parameter | Description | Default |
|---|---|---|
gateway_url | OpenFaaS gateway URL | http://gateway.openfaas:8080 |
basic_auth | Enable basic auth for the gateway | true |
upstream_timeout | Maximum timeout for upstream function call, must be a Go formatted duration string. | 30s |
rebuild_interval | Interval for rebuilding function to topic map, must be a Go formatted duration string. | 5s |
topics | Topics to which the connector will bind, provide as a comma-separated list. | nats-test, |
topic_delimiter | Delimiter for topics list. | , |
gateway_url | The URL for the API gateway. | http://gateway:8080" |
broker_host | location of the nats brokers. | nats |
print_response | Output the response of calling a function in the logs. | true |
print_response_body | Output to the logs the response body when calling a function. | false |
fullnameOverride | Override the name value used for the Connector Deployment object. | `` |
resources | Resources requests and limits configuration | requests.memory: "64Mi" |
Specify each parameter using the --set key=value[,key=value] argument to helm install.
See values.yaml for detailed configuration.
Removing the nats-connector
All control plane components can be cleaned up with helm:
$ helm uninstall nats-connector
Deploy nats-connector with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has nats-connector on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartnats-connector is pinned at v0.3.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply