Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add k8s Helm and JetStream permission examples #656

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,69 @@ When `allow_responses` is set to `true`, it defaults to the equivalent of `{ max

## Examples

### JetStream

Clients that want to work with JetStream will need to configure permissions that match the [JetStream ACLs](/reference/reference-protocols/nats_api_reference#acls). For example:

```
authorization: {
users = [
{
user: subscriber
password: secret
permissions: {
publish: {
allow: [
"$JS.API.CONSUMER.INFO.stream-name.consumer-name",
"$JS.ACK.stream-name.consumer-name.>",
"_INBOX.>"
]
},
subscribe: {
allow: [
"_INBOX.>"
]
},
}
}
}
]
}
```

### Helm chart configuration

If using the [NATS Helm chart](https://github.com/nats-io/k8s), the `accounts` section needs to be merged into the overall configuration.

```yaml
config:
cluster:
enabled: true
replicas: 3
jetstream:
enabled: true
fileStore:
pvc:
size: 128Gi
nats:
tls:
enabled: true
secretName: tls-secret
merge:
accounts:
file-api:
jetstream: enabled
users:
- nkey: U*******************************************************
permissions:
publish:
allow: ">"
subscribe:
allow:
- "subject1.>"
- "subject2.>"
```

### Variables

Here is an example authorization configuration that uses _variables_ which defines four users, three of whom are assigned explicit permissions.
Expand Down