I'm new to Kubernetes. In Kubernetes why NodePort alone has a default port range from 30000 - 32767? Even if we change the default to user-defined port ranges why only 2767 ports are allowed?
Please help me understand. Thanks in advance.
I'm new to Kubernetes. In Kubernetes why NodePort alone has a default port range from 30000 - 32767? Even if we change the default to user-defined port ranges why only 2767 ports are allowed?
Please help me understand. Thanks in advance.
This range was picked to avoid conflicts with anything else on the host machine network since in many cases it is assigned dynamically (manual option is also possible). For example if you'll set it up from range 1-32767 your allocated
nodePort
might be in conflict with port 22.The reasons are pretty much well covered here by @thockin:
Looking at the code I see that the range is not limited by it. You can find code snippets here, here and in the godocs here.
I've also performed quick test when I set higher default range it works fine for me: