Hey everyone, I was hoping you might be able to help me through this. Great tutorial, better than the rest I came across. However, to note some help for others in the future. The following line only creates a pod and deploys to a worker node. That worker node will then show that it is running the docker container, but the container has no ports associated with it. Also in the following line the image name must include the tag if the tag is present for the image.
kubectl run --image=nginx:“tag name” nginx-server --port=80 --env=“DOMAIN=cluster”
Now running the following command it doesn’t work. I suspect that the port number here sets the port number for the Worker Node for communication. I don’t know that to be true though.
kubectl expose deployment nginx-server --port=80 --name=nginx-http
The error I get when running the above command line is : “Error from server (NotFound): deployments.apps “nodejs-webapi-deployment” not found”
you will notice the error message has “nodejs-webapi-deployment” that is stuff on my side, that I am trying to resolve. I am actually deploying an image that has a nodejs webapi.
Therefore I am assuming it’s looking for a deployment and this tutorial did not go over deployments. Now from a Kubernetes expert on Youtube Nana, she said you should create a deployment first and then your pods go in the deployment. The first command I list above while it creates a pod I am not exactly sure how to create that pod for a specific deployment if I created a deployment prehand. But from the previous deployments I have created it instantly make the pods for me. So I am not sure how to get the first command above to create the deployment for the 2nd command to work. Is there someone out there than can help guide me on this? If I am wrong in my thinking that is fine. I am new to Kubernetes and I was asked to explore this technology.