Skip to content

NodePort

NodePort is a specific type of Kubernetes Service that exposes the Service on each Node's IP at a static port.^[400-devops-06-kubernetes-k8s-ithelp-day7-readme.md]

To allow external traffic to reach the Service, a NodePort service configuration defines a specific port on the Node objects.^[400-devops-06-kubernetes-k8s-ithelp-day7-readme.md] If this port number is not explicitly defined in the configuration file, Kubernetes will automatically select and assign a random port number.^[400-devops-06-kubernetes-k8s-ithelp-day7-readme.md]

This static port on the Node is used to map and forward traffic to the targetPort, which is the actual port number exposed by the container running inside the Pod.^[400-devops-06-kubernetes-k8s-ithelp-day7-readme.md]

Sources

  • 400-devops-06-kubernetes-k8s-ithelp-day7-readme.md