summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorislav Glozman <Borislav.Glozman@amdocs.com>2020-02-26 14:30:12 +0000
committerGerrit Code Review <gerrit@onap.org>2020-02-26 14:30:12 +0000
commit791bc9f5989e51281add126bcf1baccab1f21a57 (patch)
tree0061dbbce280f2a676139e34f33152c70f32976b
parentb6cc3faee96f0f286c5ed3c6363ef5cb4f5354be (diff)
parent2f73a0f0d840c2361be68d6eae9084c6737018a4 (diff)
Merge "[COMMON] Allow to choose between nodePortPrefix and nodePortPrefixExt"
-rw-r--r--kubernetes/common/common/templates/_service.tpl5
1 files changed, 4 insertions, 1 deletions
diff --git a/kubernetes/common/common/templates/_service.tpl b/kubernetes/common/common/templates/_service.tpl
index 075f7965b9..55f73c1635 100644
--- a/kubernetes/common/common/templates/_service.tpl
+++ b/kubernetes/common/common/templates/_service.tpl
@@ -56,15 +56,18 @@ labels: {{- include "common.labels" $dot | nindent 2 -}}
- .dot : environment (.)
- .ports : an array of ports
- .portType: the type of the service
+ - .prefix: NodePort prefix to be used
+
*/}}
{{- define "common.servicePorts" -}}
{{- $portType := .portType -}}
{{- $dot := .dot -}}
{{- range $index, $port := .ports }}
+{{- $portPrefix := default "nodePortPrefix" $port.prefix }}
- port: {{ $port.port }}
targetPort: {{ $port.name }}
{{- if (eq $portType "NodePort") }}
- nodePort: {{ $dot.Values.global.nodePortPrefix | default $dot.Values.nodePortPrefix }}{{ $port.nodePort }}
+ nodePort: {{ index $dot.Values "global" $portPrefix | default (index $dot.Values $portPrefix) }}{{ $port.nodePort }}
{{- end }}
name: {{ $port.name }}
{{- end -}}