Add option to define a pre-known nodeport range for service ports #123
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Currently, we have no option to predefine or predict the node port values for service ports within the helm chart, they are randomly assigned.
However, if you need to access a service port from outside the cluster, you need to know the port mapping between the node port and the service port, which is currently only queryable through the k8s API.
To make this easier, I introduced an option to predefine a node port start range for node ports.
For example, if the service port range starts at
4510
, and the node port range starts at31510
, the port mappings would look like this:If the new variable
service.externalServicePorts.nodePortStart
is not set, the helm chart will assign random ports just like it does currently:This variable is not set by default, so the default behavior does not change.
Changes
nodePortStart
to make node port ranges predictable when starting LocalStack using the helm chart