Choosing the correct NodePort

11/15/2017

Usually we expose our Kubenretes services through an managed K8s/GCP Ingress with auto-assigned NodePorts, but for some use cases we need to specify a static NodePort ourselves.

The documentation says that we need to make sure to avoid port collissions:

you need to take care about possible port collisions yourself

Q: How should how we choose the correct NodePort?

Should we / do we have to allocate our static NodePort from the flag-configured range (default: 30000-32767)?

Or rather not from this range to avoid collisions with these auto-assigned ports?

-- tex
google-kubernetes-engine
kubernetes

1 Answer

11/15/2017

It is more about not assigning the same port manually to multiple services then anything else. If you have a manualy defined NodePort it will not get assigned to dynamic service, so yes, you should use port from this range.

-- Radek 'Goblin' Pieczonka
Source: StackOverflow