tekumara / nats-demo

nats demo running in a local kubernetes cluster

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nats demo

nats demo running in a local kubernetes cluster.

Getting started

Prerequisites:

  • k3d (for creating a local kubernetes cluster)
  • kubectl
  • helm

Install nats cli, create k3d cluster and deploy nats:

make install

Usage

Endpoints:

Run

  • make ping
  • make demo-js python jetstream demo
  • nats stream ls list streams
  • nats server report connections list connections
  • nats server ls --context=admin list servers using system account (admin)
  • nats server report jetstream --context=admin jetstream summary report
  • nats kv watch articles tail bucket dwatch
  • nats stream view KV_dwatch view messages in the KV_dwatch stream
  • nats stream get KV_dwatch 2 view message with sid 2 in KV_dwatch stream
  • nats consumer rm KV_dwatch delete consumer. Recreating it will start from the beginning of the stream.
  • nats events -a listen for advisories eg: delivery attempts exceeded

Config

Stored in /etc/nats-config/nats.conf.

NB: /etc/nats/nats-server.conf is the default example config built into the docker image.

References

Troubleshooting

nats: error: server request failed, ensure the account used has system privileges and appropriate permissions

Connect using the system account.

nats: error: nats: Authorization Violation

Use the username and password when connecting, eg:

About

nats demo running in a local kubernetes cluster

License:MIT License


Languages

Language:Python 85.1%Language:Makefile 14.9%