Student question: NodePort Range

Panda:
Hi everybody. I am middle of Service section of CKA lecture, and I have quick question about NodePort.
As the lecture saids, NodePort supports exposing port range as 30000-32767 and the exposed port is configured widely in the cluster.
So does it mean we cannot create over 2768 NodePort typed services?

runlevl4:
If you’re asking if you can create a NodePort exposing 2768, then the answer is no. If you specify the port, it must be in the allowable range.

Panda:
No. I mean the maximum number of nodeport services.

Panda:
I can expose 30000, 30001 and etc. But let’s say I already created a lot of nodeport services and they already took 30000 to 32767.

Panda:
Then I think I can’t create more nodeport service because there is no idle port. Is my understanding correct?

OE:
You can specify the range to use via the following API Server option:

--service-node-port-range

OE:
Also from what I remember, NodePorts where added before things like Ingress Controllers were introduced. So they aren’t really useful or recommended as a means to exposing cluster resources

runlevl4:
Looky there. Learn something new every day. I don’t think I’ve ever used a nodeport until last week. Never realized you could define the range.

Panda:
Thanks a lot! :thumbsup: