<p>I'm currently following a course on udemy called <code>Microservices with Node JS and React</code> from Stephen Grider, and I've come to a part where I need to run a command:</p>
<pre><code>kubectl expose deployment ingress-nginx-controller --target-port=80 --type=NodePort -n kube-system
</code></pre>
<p>And this command is producing this error:</p>
<pre><code>Error from server (NotFound): deployments.apps &quot;ingress-nginx-controller&quot; not found
</code></pre>
<p>when I run the command <code>kubectl get deployments</code> I do not see an ingress-nginx-controller deployment so I tried <code>kubectl get namespace</code> and I saw then entry <code>ingress-nginx</code> from that so I then tried <code>kubectl get deployments -n ingress-nginx</code> and then I finally see <code>ingress-nginx-controller</code> from output of that command. So I now know where the ingress-nginx-controller is but I am still pretty clueless as to how i get the initial command of <code>kubectl explose deployment ingress-nginx-controller --target-port=80 --type=NodePort -n kube-system</code> to work i've been stuck on this for a long time now any help is appreciated, thanks.</p>
<p><strong>Edit 1</strong>: this is probably not relevant but I also tried putting <code>ingress-nginx</code> after the -n instead of kube-system and it did not work</p>
<p>Also I am using <code>minikube</code> on ubuntu</p>
<p><strong>Edit 2</strong>: this is a <a href="https://i.stack.imgur.com/zpif3.png" rel="nofollow noreferrer">screenshot</a> of what the course wants me to do because I'm running minikube</p>

Skyler Brandt
<p>The first time you ran it (with the correct namespace) it worked and you probably didn't notice. Your tutorial seems to be fairly out of date, you might want to find a newer one. If you want to remove the previously created service and do it again, <code>kubectl delete service -n ingress-nginx ingress-nginx-controller</code>.</p>
