From e348efbb2476990c5bee07f2ac2bcf1e440a43bb Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Mon, 28 Nov 2022 14:47:07 +0200 Subject: [PATCH] fix loadbalancerIP --- .../common/1.0.0/templates/class/_service.tpl | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/library/common/1.0.0/templates/class/_service.tpl b/library/common/1.0.0/templates/class/_service.tpl index 5b450874..744a594d 100644 --- a/library/common/1.0.0/templates/class/_service.tpl +++ b/library/common/1.0.0/templates/class/_service.tpl @@ -39,22 +39,24 @@ spec: {{- if has $svcType (list "ClusterIP" "NodePort" "ExternalName" "LoadBalancer") }} type: {{ $svcType }} {{/* Specify type only for the above types */}} {{- end -}} -{{- if eq $svcType "ClusterIP" }} {{/* ClusterIP */}} +{{- if has $svcType (list "ClusterIP" "NodePort" "LoadBalancer") }} {{/* ClusterIP */}} {{- with $svcValues.clusterIP }} clusterIP: {{ . }} {{- end }} + {{- if eq $svcType "LoadBalancer" -}} + {{- with $svcValues.loadBalancerIP }} + loadBalancerIP: {{ . }} + {{- end }} + {{- with $svcValues.loadBalancerSourceRanges }} + loadBalancerSourceRanges: + {{- range . }} + - {{ tpl . $root }} + {{- end }} + {{- end -}} + {{- end -}} {{- else if eq $svcType "ExternalName" -}} {{/* ExternalName */}} externalName: {{ $svcValues.externalName }} {{- else if eq $svcType "LoadBalancer" -}} {{/* LoadBalancer */}} - {{- with $svcValues.loadBalancerIP }} - loadBalancerIP: {{ . }} - {{- end }} - {{- with $svcValues.loadBalancerSourceRanges }} - loadBalancerSourceRanges: - {{- range . }} - - {{ tpl . $root }} - {{- end }} - {{- end -}} {{- end -}} {{- if ne $svcType "ClusterIP" -}} {{- with $svcValues.externalTrafficPolicy -}}