Accessing the NATS Server Using CLI ​
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.
Prerequisites ​
- You have installed kubectl and NATS CLI.
Context ​
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.
Procedure ​
Get the credentials. Run:
bashkubectl 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:bashuser: admin, password: <your password>To access the NATS server with the NATS CLI tool, forward its port:
bashkubectl port-forward -n kyma-system svc/eventing-nats 4222To send your NATS commands, pass the credentials:
bashnats server info --user admin --password <your password>