<p>I'm trying to setup a basic NATS service on my kubernetes cluster, according to their documentation, <a href="https://docs.nats.io/running-a-nats-service/nats-kubernetes" rel="nofollow noreferrer">here</a>. I executed the following code:</p>
<pre><code>$ helm install test-nats nats/nats

NAME: test-nats
LAST DEPLOYED: Thu Jul 14 13:18:09 2022
NAMESPACE: default
STATUS: deployed
REVISION: 1
NOTES:
You can find more information about running NATS on Kubernetes
in the NATS documentation website:

  https://docs.nats.io/nats-on-kubernetes/nats-kubernetes

NATS Box has been deployed into your cluster, you can
now use the NATS tools within the container as follows:

  kubectl exec -n default -it deployment/test-nats-box -- /bin/sh -l

  nats-box:~# nats-sub test &amp;
  nats-box:~# nats-pub test hi
  nats-box:~# nc test-nats 4222

Thanks for using NATS!

$ kubectl exec -n default -it deployment/test-nats-box -- /bin/sh -l
             _             _               
 _ __   __ _| |_ ___      | |__   _____  __
| '_ \ / _` | __/ __|_____| '_ \ / _ \ \/ /
| | | | (_| | |_\__ \_____| |_) | (_) &gt;  &lt; 
|_| |_|\__,_|\__|___/     |_.__/ \___/_/\_\
                                           
nats-box v0.11.0
test-nats-box-84c48d46f-j7jvt:~#
</code></pre>
<p>Now, so far, everything has conformed to their start guide. However, when I try to test the connection, I run into trouble:</p>
<pre><code>test-nats-box-84c48d46f-j7jvt:~# nats-sub test &amp;
test-nats-box-84c48d46f-j7jvt:~# /bin/sh: nats-sub: not found
test-nats-box-84c48d46f-j7jvt:~# nats-pub test hi
/bin/sh: nats-pub: not found
</code></pre>
<p>It looks like the commands weren't found but they should have been installed when I did the <code>helm install</code>. What's going on here?</p>

Woody1193
<p>I have reproduced the set-up on my kubernetes cluster and have successfully deployed the nats box and started a <a href="https://docs.nats.io/nats-concepts/core-nats/pubsub/pubsub_walkthrough#1.-create-subscriber-1" rel="nofollow noreferrer">client subscriber</a> program in which subscribers listen on subjects, and publishers send messages on specific subjects.</p>
<p><strong>1. Create Subscriber</strong></p>
<p>In a shell or command prompt session, start a client subscriber program.</p>
<pre><code> nats sub &lt; subject&gt;
</code></pre>
<p>Here, &lt; subject &gt; is a subject to listen on. It helps to use unique and well thought-through subject strings because you need to ensure that messages reach the correct subscribers even when wildcards are used.</p>
<p>For example:</p>
<pre><code>nats sub msg.test
</code></pre>
<p>You should see the message: Listening on [msg.test].</p>
<p><strong>2. Create a Publisher and publish a message</strong></p>
<p>Create a NATS publisher and send a message.</p>
<pre><code>nats pub &lt; subject&gt; &lt; message&gt;
</code></pre>
<p>Where &lt; subject&gt; is the subject name and &lt; message&gt; is the text to publish.</p>
<p>For example:</p>
<pre><code>nats pub msg.test nats-message-1
</code></pre>
<p>You'll notice that the publisher sends the message and prints: Published [msg.test] : 'NATS MESSAGE'.</p>
<p>The subscriber receives the message and prints: [#1] Received on [msg.test]: 'NATS MESSAGE'.</p>
<p>Here, you have provided the wrong syntax nats-sub and nats-pub which are deprecated. Try using the above commands to give precise results.</p>
