diff --git a/library/common/templates/lib/service/_additionalAnnotations.tpl b/library/common/templates/lib/service/_additionalAnnotations.tpl index 2c426944..444f2818 100644 --- a/library/common/templates/lib/service/_additionalAnnotations.tpl +++ b/library/common/templates/lib/service/_additionalAnnotations.tpl @@ -20,8 +20,11 @@ annotations: The annotations variable reference, to append the MetalLB annotatio {{- if (hasKey $rootCtx.Values.global "metallb") -}} {{- if $rootCtx.Values.global.metallb.addServiceAnnotations -}} - - {{- if eq $objectData.externalTrafficPolicy "Cluster" -}} + {{- if $objectData.externalTrafficPolicy -}} + {{- if ne $objectData.externalTrafficPolicy "Local" -}} + {{- $_ := set $annotations "metallb.universe.tf/allow-shared-ip" $sharedKey -}} + {{- end -}} + {{- else -}} {{- $_ := set $annotations "metallb.universe.tf/allow-shared-ip" $sharedKey -}} {{- end -}}