When to use node port and when cluster ip. Any example? Thanx

Hemil patel:
When to use node port and when cluster ip. Any example? Thanx

Tej_Singh_Rana:
Hello, @Hemil patel
For NodePort: When you would like to expose your application to outside the cluster.
ClusterIP: In case of ClusterIP to make the application accessible within the cluster. No one can direct access from outside the cluster.
We can take an example of a web page and database, To access web pages, we provided NodePort service to our web pod and same as for database we provided ClusterIP to only accessible within the cluster.
This one is just an example, to understand the difference b/w NodePort and ClusterIP.
images.jpeg

Hemil patel:
Wonderful, thank you @Tej_Singh_Rana. Now, i am clear