My question refers to the situation when you ask the system to choose a NodePort number for you when creating a NodePort service. Once the service is created and remain undeleted (i.e. not re-created/updated), does the allocated NodePort number change during the service’s lifetime?
My understanding is, if there is no new node joins the pool, , there is no need for the NodePort number to change at all, since the NodePort number should have been allocated all all nodes in the pool, and the forwarding from that NodePort to pods have been configured for all current nodes in current pool.
However, if a new node joins to pool (for example, if the user decide to need a larger pool, or if a node is down and the system decides to bring in anther node so that the number of nodes in the pool remain unchanged), how about the NodePort numbers that are already allocated on existing nodes? Is it possible that some of the already allocated NodePort number on this new node is not available so that k8s system has to update the service associated to those NodePort number with new NodePort numbers, therefore causing NodePort number not stable during the lifetime of the service?
From a user’s point of view, he didn’t delete/update the service, so the service semantically has only been started once and has been running, this is different from pods which are expected to come and go.
Searched documents and can’t find an answer.
Thank you very much.