X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2Fcommon%2Fcommon%2Ftemplates%2F_service.tpl;fp=kubernetes%2Fcommon%2Fcommon%2Ftemplates%2F_service.tpl;h=8489cc502128c916d6e1a26271c908602799a7f9;hb=09c5ef251def0f9bf745817347ce33f9a9d6a05f;hp=9c3010c2090fc60ce5a9d4929bc858a43cac1836;hpb=cc2f53b36e0d7881540e8afd24119f9e3c98a210;p=oom.git diff --git a/kubernetes/common/common/templates/_service.tpl b/kubernetes/common/common/templates/_service.tpl index 9c3010c209..8489cc5021 100644 --- a/kubernetes/common/common/templates/_service.tpl +++ b/kubernetes/common/common/templates/_service.tpl @@ -181,6 +181,8 @@ labels: {{- include "common.labels" (dict "labels" $labels "dot" $dot) | nindent {{- $labels := default (dict) .labels -}} {{- $matchLabels := default (dict) .matchLabels -}} {{- $sessionAffinity := default "None" $dot.Values.service.sessionAffinity -}} +{{- $kubeTargetVersion := default $dot.Capabilities.KubeVersion.Version | trimPrefix "v" -}} +{{- $ipFamilyPolicy := default "PreferDualStack" $dot.Values.service.ipFamilyPolicy -}} apiVersion: v1 kind: Service metadata: {{ include "common.serviceMetadata" (dict "suffix" $suffix "annotations" $annotations "msb_informations" $msb_informations "labels" $labels "dot" $dot) | nindent 2 }} @@ -189,6 +191,9 @@ spec: clusterIP: None {{- end }} ports: {{- include "common.servicePorts" (dict "serviceType" $serviceType "ports" $ports "dot" $dot "add_plain_port" $add_plain_port) | nindent 4 }} + {{- if semverCompare ">=1.20.0" $kubeTargetVersion }} + ipFamilyPolicy: {{ $ipFamilyPolicy }} + {{- end }} {{- if $publishNotReadyAddresses }} publishNotReadyAddresses: true {{- end }}