Testing Single Container Static App Locally on Minikube

4 / 6

Minikube Hands-On || 2 - Pods, Deployments and Services || kubectl create




Not able to play video? Try with youtube


Please login to comment

3 Comments

1. Is it correct to say 'create deployment' command  will always create a underlying node with the same name ?

2.While exposing a service with 'kucectl expose' command with the nodePort option, the local port assigned to seems to be a randomw one. Is there anyway I can specify a particular avaialble local port that can be mapped to a mnikibe service port? e.g I want the nginx running on minikube to be availabe on say port 8080 so that I can hv the URL as       <minikubeIP>>:8080  instead of <<minikubeIP>>:3484 or something

 

thanks again for a well explained video on a failry complex and important concept.

 1  Upvote    Share

Hi,

1. Please elaborate what you mean by node. In kubernetes/minikube, node is a term used to refer to a machine, not any logical component. Deployments create pods under the hood, and pods run the containers.

2. The default port-range for Nodeport type service is 30000 - 32767. If you want to use a particular number out of this range, you could set the nodePort number in the service YAML file( as shown in the next video, where we have set the nodePort to be 31000). If you don't set it, we will be assigned with a random number.(like in this video where we just exposed the service but didn't mention the nodePort, thus we are randomly assigned 30009). If you want to set the port range yourself by changing the default port range, you may do that as suggested here: https://stackoverflow.com/a/54763328/14619383

Thanks.

  Upvote    Share

1, My bad: I meant pod, NOT node when I said creation of deployment leades to creation of underlying "node". 

2.Yes, I saw the option to assign a port of our choise(YML file) when I completed the next section. Thanks

  Upvote    Share