-
Notifications
You must be signed in to change notification settings - Fork 308
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
Update NACK readme #931
Update NACK readme #931
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,12 +18,17 @@ using a NATS client with JetStream support for management or the `nats` utility. | |
|
||
### Getting started | ||
|
||
First, we'll need to NATS cluster that has enabled JetStream. You can install | ||
First, we'll need to install the CRDs. | ||
```bash | ||
kubectl apply -f https://github.com/nats-io/nack/releases/latest/download/crds.yml | ||
``` | ||
|
||
Then, we'll need a NATS cluster that has enabled JetStream. You can install | ||
one as follows: | ||
|
||
```yaml | ||
natsBox: | ||
enabled: false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was
That file has been removed in the mean time, so instead just enable nats-box as part of our NATS installation. |
||
enabled: true | ||
|
||
config: | ||
jetstream: | ||
|
@@ -81,10 +86,12 @@ NAME STATE STREAM NAME SUBJECTS | |
mystream Created mystream [orders.*] | ||
|
||
# Create a push-based consumer | ||
$ kubectl apply -f https://raw.githubusercontent.com/nats-io/nack/main/deploy/examples/consumer_push.yml | ||
$ wget -q https://raw.githubusercontent.com/nats-io/nack/main/deploy/examples/consumer_push.yml | ||
$ kubectl apply -f consumer_push.yml | ||
|
||
# Create a pull based consumer | ||
$ kubectl apply -f https://raw.githubusercontent.com/nats-io/nack/main/deploy/examples/consumer_pull.yml | ||
$ wget -q https://raw.githubusercontent.com/nats-io/nack/main/deploy/examples/consumer_pull.yml | ||
$ kubectl apply -f consumer_pull.yml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Later on there are descriptions about:
Saving it into a file makes it easier for people to inspect the contents when they get to this bit. |
||
|
||
# Check if they were successfully created. | ||
$ kubectl get consumers | ||
|
@@ -102,13 +109,9 @@ data into `mystream`. | |
|
||
```sh | ||
# Run nats-box that includes the NATS management utilities. | ||
$ kubectl apply -f https://nats-io.github.io/k8s/tools/nats-box.yml | ||
$ kubectl exec -it nats-box -- /bin/sh -l | ||
kubectl exec -it deploy/nats-box -- /bin/sh -l | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now that nats-box is pre-installed, no need to install here and we need to refer to it by its deployment. |
||
|
||
# Publish a couple of messages | ||
$ nats context save jetstream -s nats://nats:4222 | ||
$ nats context select jetstream | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These would fail as by default (by now) the file system is read-only. Because we now enable nats-box above it's pre-configured and doesn't need a context to be set. |
||
|
||
$ nats pub orders.received "order 1" | ||
$ nats pub orders.received "order 2" | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we skip the TL;DR we should first install the CRDs here.