Interact directly with your NATS server deployment in Kyma using the NATS command-line interface (CLI). Use the CLI to inspect server status, manage streams and consumers, and troubleshoot message flow.
-
You have the NATS module in your cluster. See Adding and Deleting a Kyma Module.
-
You have installed kubectl and NATS CLI.
Accessing certain resources in NATS requires system account privileges. Kyma automatically generates a system account user using a Secret named eventing-nats-secret in the kyma-system namespace.
-
Get the credentials. Run:
kubectl get secrets -n kyma-system eventing-nats-secret -ogo-template='{{index .data "resolver.conf"|base64decode}}'| grep 'user:'| tr -d '{}'If you changed the default NATS instance name from
eventing-nats, replaceeventing-nats-secretwith{your_NATS_CR_name}-secret.You receive the credentials for the
system accountuser in the following format:user: admin, password: <your password> -
To access the NATS server with the NATS CLI tool, forward its port:
kubectl port-forward -n kyma-system svc/eventing-nats 4222 -
To send your NATS commands, pass the credentials:
nats server info --user admin --password <your password>