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

Update NACK readme #931

Merged
merged 2 commits into from
Sep 26, 2024
Merged

Update NACK readme #931

merged 2 commits into from
Sep 26, 2024

Conversation

MauriceVanVeen
Copy link
Member

@MauriceVanVeen MauriceVanVeen commented Sep 12, 2024

Update README with primarily two improvements:

  • nats-box.yml file was removed, kubectl apply -f https://nats-io.github.io/k8s/tools/nats-box.yml
  • nats-box's file system is read-only, so don't use nats context save

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
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
Copy link
Member Author

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.

one as follows:

```yaml
natsBox:
enabled: false
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was natsBox.enabled: false before and we'd add it later on with:

kubectl apply -f https://nats-io.github.io/k8s/tools/nats-box.yml

That file has been removed in the mean time, so instead just enable nats-box as part of our NATS installation.


# 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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Later on there are descriptions about:

First, we'll read the data using a pull-based consumer. In consumer_pull.yml
we set:

filterSubject: orders.received

so that's the subject my-pull-consumer will pull messages from.

Saving it into a file makes it easier for people to inspect the contents when they get to this bit.

@@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The 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
Copy link
Member Author

Choose a reason for hiding this comment

The 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.

@MauriceVanVeen MauriceVanVeen marked this pull request as ready for review September 12, 2024 18:46
Copy link
Member

@samuelattwood samuelattwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the improvements Maurice. LGTM

@samuelattwood samuelattwood merged commit 1f0ca95 into main Sep 26, 2024
6 checks passed
@samuelattwood samuelattwood deleted the update-nack-readme branch September 26, 2024 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants