Skip to content

Commit

Permalink
Documentation for Jetstream TLS configuration (#2698)
Browse files Browse the repository at this point in the history
* docs(pubsub/jetstream): make table readable as plain text and easier to edit

Signed-off-by: NickLarsenNZ <[email protected]>

* docs(pubsub/jetstream): add tls client authentication fields (see dapr/components-contrib#1924)

Signed-off-by: NickLarsenNZ <[email protected]>

* docs(pubsub/jetstream): make example values consistent (strings quotes inside the code span)

Signed-off-by: NickLarsenNZ <[email protected]>

* add to yaml example and mark as optional

Signed-off-by: Hannah Hunter <[email protected]>

Signed-off-by: Hannah Hunter <[email protected]>

Signed-off-by: NickLarsenNZ <[email protected]>
Signed-off-by: Hannah Hunter <[email protected]>
Co-authored-by: Yaron Schneider <[email protected]>
Co-authored-by: Mark Fussell <[email protected]>
Co-authored-by: Hannah Hunter <[email protected]>
  • Loading branch information
4 people authored Oct 7, 2022
1 parent 4737583 commit 44ed7a7
Showing 1 changed file with 35 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,40 +24,46 @@ spec:
metadata:
- name: natsURL
value: "nats://localhost:4222"
- name: jwt
value: "eyJhbGciOiJ...6yJV_adQssw5c" # Optional. Used for decentralized JWT authentication
- name: seedKey
value: "SUACS34K232O...5Z3POU7BNIL4Y" # Optional. Used for decentralized JWT authentication
- name: name
value: "connection name"
- name: durableName
value: "consumer durable name"
- name: queueGroupName
value: "queue group name"
- name: startSequence
- name: jwt # Optional. Used for decentralized JWT authentication.
value: "eyJhbGciOiJ...6yJV_adQssw5c"
- name: seedKey # Optional. Used for decentralized JWT authentication.
value: "SUACS34K232O...5Z3POU7BNIL4Y"
- name: tls_client_cert # Optional. Used for TLS Client authentication.
value: "/path/to/tls.crt"
- name: tls_client_key # Optional. Used for TLS Client authentication.
value: "/path/to/tls.key"
- name: name
value: "my-conn-name"
- name: durableName
value: "my-durable"
- name: queueGroupName
value: "my-queue"
- name: startSequence
value: 1
- name: startTime # in Unix format
- name: startTime # In Unix format
value: 1630349391
- name: deliverAll
- name: deliverAll
value: false
- name: flowControl
- name: flowControl
value: false
```
## Spec metadata fields
| Field | Required | Details | Example |
|----------------|:--------:|---------|---------|
| natsURL | Y | NATS server address URL | "`nats://localhost:4222`"|
| jwt | N | NATS decentralized authentication JWT | "`eyJhbGciOiJ...6yJV_adQssw5c`"|
| seedKey | N | NATS decentralized authentication seed key | "`SUACS34K232O...5Z3POU7BNIL4Y`"|
| name | N | NATS connection name | `"my-conn-name"`|
| durableName | N | [Durable name] | `"my-durable"` |
| queueGroupName | N | Queue group name | `"my-queue"` |
| startSequence | N | [Start Sequence] | `1` |
| startTime | N | [Start Time] in Unix format | `1630349391` |
| deliverAll | N | Set deliver all as [Replay Policy] | `true` |
| flowControl | N | [Flow Control] | `true` |
| Field | Required | Details | Example |
| --------------- | :------: | ------------------------------------------ | -------------------------------- |
| natsURL | Y | NATS server address URL | `"nats://localhost:4222"` |
| jwt | N | NATS decentralized authentication JWT | `"eyJhbGciOiJ...6yJV_adQssw5c"` |
| seedKey | N | NATS decentralized authentication seed key | `"SUACS34K232O...5Z3POU7BNIL4Y"` |
| tls_client_cert | N | NATS TLS Client Authentication Certificate | `"/path/to/tls.crt"` |
| tls_client_key | N | NATS TLS Client Authentication Key | `"/path/to/tls.key"` |
| name | N | NATS connection name | `"my-conn-name"` |
| durableName | N | [Durable name] | `"my-durable"` |
| queueGroupName | N | Queue group name | `"my-queue"` |
| startSequence | N | [Start Sequence] | `1` |
| startTime | N | [Start Time] in Unix format | `1630349391` |
| deliverAll | N | Set deliver all as [Replay Policy] | `true` |
| flowControl | N | [Flow Control] | `true` |

## Create a NATS server

Expand All @@ -81,13 +87,13 @@ helm repo add nats https://nats-io.github.io/k8s/helm/charts/
helm install --set nats.jetstream.enabled=true my-nats nats/nats
```

This installs a single NATS server into the `default` namespace. To interact with NATS, find the service with:
This installs a single NATS server into the `default` namespace. To interact with NATS, find the service with:

```bash
kubectl get svc my-nats
```

For more information on helm chart settings, see the [Helm chart documentation](https://helm.sh/docs/helm/helm_install/).
For more information on helm chart settings, see the [Helm chart documentation](https://helm.sh/docs/helm/helm_install/).

{{% /codetab %}}

Expand All @@ -114,4 +120,4 @@ nats -s localhost:4222 stream add myStream --subjects mySubject
[Start Time]: https://docs.nats.io/jetstream/concepts/consumers#deliverbystarttime
[Replay Policy]: https://docs.nats.io/jetstream/concepts/consumers#replaypolicy
[Flow Control]: https://docs.nats.io/jetstream/concepts/consumers#flowcontrol
[Decentralized JWT Authentication/Authorization]: https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/jwt
[Decentralized JWT Authentication/Authorization]: https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/jwt

0 comments on commit 44ed7a7

Please sign in to comment.