aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes
diff options
context:
space:
mode:
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>2021-05-21 13:14:35 +0000
committerGerrit Code Review <gerrit@onap.org>2021-05-21 13:14:35 +0000
commit1b5b074584b5d169e7578fc8fc6870fd9767c0c2 (patch)
tree94fc62e28ae8ffd98d5ed24e16fee12b5796c3f7 /kubernetes
parentf4527b94897c02c763f11e4013dbbe9b3a821061 (diff)
parent09c5ef251def0f9bf745817347ce33f9a9d6a05f (diff)
Merge "[COMMON] Enhance ONAP common-service template - add IPv4/IPv6 support"
Diffstat (limited to 'kubernetes')
-rw-r--r--kubernetes/common/common/templates/_service.tpl5
1 files changed, 5 insertions, 0 deletions
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 }}