Skip to content

Commit

Permalink
Add docs for NATS authorization
Browse files Browse the repository at this point in the history
Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
welteki committed Aug 1, 2024
1 parent e236ae7 commit 4b033f0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/deployment/pro.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ queueMode: jetstream

nats:
streamReplication: 1
authorization:
enabled: true
```
You can find explanations for each configuration item in the [values-pro.yaml](https://github.com/openfaas/faas-netes/blob/master/chart/openfaas/values-pro.yaml) file on GitHub.
Expand Down
28 changes: 27 additions & 1 deletion docs/openfaas-pro/jetstream.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ To enable JetSteam for OpenFaaS set `jetstream` as the queue mode in the values.
```yaml
queueMode: jetstream
nats:
streamReplication: 1
streamReplication: 1
```
If the NATS pod restarts, you will lose all messages that it contains. In your development or staging environment, this shouldn't happen very often.
Expand All @@ -58,6 +58,32 @@ nats:
port: "4222"
```
## Authentication for NATS
We recommend enabling authentication for NATS to limit the access to the NATS server.
To enable authorization for NATS add the following to `nats` section in your values.yaml file.

```yaml
nats:
authorization:
enabled: true
```

We use a Helm Chart hook to generate an access token on first installation. If you are upgrading an existing OpenFaaS installation or using an external NATS cluster you will need to create the token secret manually.

```sh
# openssl is preferred to generate a random secret:
openssl rand -base64 32 > ./nats-token
kubectl create secret generic \
-n openfaas \
nats-token \
--from-file token=./nats-token
```

Make sure to configure the same access token through the NATS helm chart if you are running an external NATS cluster. Full instructions for external NATS are available in the [Customer Community](https://github.com/openfaas/customers/).

## Features

### Metrics and monitoring
Expand Down

0 comments on commit 4b033f0

Please sign in to comment.