Sunday, August 13, 2023

What is NodePort in Kubernetes Deployment

In Kubernetes, a NodePort is a type of service that exposes an application running inside a cluster to be accessible from outside the cluster. It allows you to expose your application to a specific port on each node in the cluster, making the application accessible from the public internet or other networks.

Here's how the NodePort type works:

Internal Cluster Communication: Your application runs as a set of pods inside the Kubernetes cluster. These pods communicate with each other using their own IP addresses and ports within the cluster's internal network.

NodePort Service: When you create a NodePort service, Kubernetes allocates a port (the NodePort) on each node in the cluster. Any traffic that arrives at this port on any node is forwarded to the corresponding port on the selected pods.

External Access: This means that the service can be accessed from outside the cluster by connecting to any node's IP address on the specified NodePort.

Port Range: The NodePort is usually in the range 30000-32767. You can specify the NodePort explicitly when creating the service, or let Kubernetes choose an available port within this range.

References:

ChatGPT 

No comments:

Post a Comment