Skip to content

Commit 4b033f0

Browse files
committed
Add docs for NATS authorization
Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
1 parent e236ae7 commit 4b033f0

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

docs/deployment/pro.md

+2
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ queueMode: jetstream
8686

8787
nats:
8888
streamReplication: 1
89+
authorization:
90+
enabled: true
8991
```
9092
9193
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.

docs/openfaas-pro/jetstream.md

+27-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ To enable JetSteam for OpenFaaS set `jetstream` as the queue mode in the values.
4141
```yaml
4242
queueMode: jetstream
4343
nats:
44-
streamReplication: 1
44+
streamReplication: 1
4545
```
4646
4747
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.
@@ -58,6 +58,32 @@ nats:
5858
port: "4222"
5959
```
6060
61+
## Authentication for NATS
62+
63+
We recommend enabling authentication for NATS to limit the access to the NATS server.
64+
65+
To enable authorization for NATS add the following to `nats` section in your values.yaml file.
66+
67+
```yaml
68+
nats:
69+
authorization:
70+
enabled: true
71+
```
72+
73+
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.
74+
75+
```sh
76+
# openssl is preferred to generate a random secret:
77+
openssl rand -base64 32 > ./nats-token
78+
79+
kubectl create secret generic \
80+
-n openfaas \
81+
nats-token \
82+
--from-file token=./nats-token
83+
```
84+
85+
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/).
86+
6187
## Features
6288

6389
### Metrics and monitoring

0 commit comments

Comments
 (0)