简体   繁体   中英

kubectl expose deployment not working with ingress-controller

I'm currently following a course on udemy called Microservices with Node JS and React from Stephen Grider, and I've come to a part where I need to run a command:

kubectl expose deployment ingress-nginx-controller --target-port=80 --type=NodePort -n kube-system

And this command is producing this error:

Error from server (NotFound): deployments.apps "ingress-nginx-controller" not found

when I run the command kubectl get deployments I do not see an ingress-nginx-controller deployment so I tried kubectl get namespace and I saw then entry ingress-nginx from that so I then tried kubectl get deployments -n ingress-nginx and then I finally see ingress-nginx-controller 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 kubectl explose deployment ingress-nginx-controller --target-port=80 --type=NodePort -n kube-system to work i've been stuck on this for a long time now any help is appreciated, thanks.

Edit 1 : this is probably not relevant but I also tried putting ingress-nginx after the -n instead of kube-system and it did not work

Also I am using minikube on ubuntu

Edit 2 : this is a screenshot of what the course wants me to do because I'm running minikube

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, kubectl delete service -n ingress-nginx ingress-nginx-controller .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM