Skip to content

Commit 7d788b2

Browse files
authored
Add option to define a pre-known nodeport range for service ports (#123)
1 parent f517c9c commit 7d788b2

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

charts/localstack/templates/service.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,13 @@ spec:
4747
containerPort: 53
4848
protocol: UDP
4949
{{- end }}
50-
{{- range untilStep (.Values.service.externalServicePorts.start|int) (.Values.service.externalServicePorts.end|int) 1 }}
51-
- name: "external-service-port-{{ . }}"
52-
port: {{ . }}
53-
targetPort: "ext-svc-{{ . }}"
50+
{{- range $index, $port := untilStep (.Values.service.externalServicePorts.start|int) (.Values.service.externalServicePorts.end|int) 1 }}
51+
- name: "external-service-port-{{ $port }}"
52+
port: {{ $port }}
53+
targetPort: "ext-svc-{{ $port }}"
54+
{{- with $.Values.service.externalServicePorts.nodePortStart|int }}
55+
nodePort: {{ add $index . }}
56+
{{- end }}
5457
{{- end }}
5558
selector:
5659
{{- include "localstack.selectorLabels" . | nindent 4 }}

charts/localstack/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ service:
123123
externalServicePorts:
124124
start: 4510
125125
end: 4560
126+
## @param service.externalServicePorts.nodePortStart specifies the starting node ports the serviceports are mapped to
127+
## has to be in the node port range configured. See https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
128+
# nodePortStart: 31510
126129
## @param service.dnsService Enables or disables the exposure of the LocalStack DNS
127130
##
128131
dnsService: false

0 commit comments

Comments
 (0)