X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=helm%2Finfrastructure%2Fsubcharts%2Fkong%2Ftemplates%2Fservice-kong-portal-api.yaml;h=710f2018811cfe86fed479dd00087b457e7ac478;hb=75c0de3cae4b58e001f7ec715f13f82ded10e678;hp=1f61ac2957eef409de3e2b7ce3d1e5b412c90b83;hpb=f1bf45955876f9ed5779b65d0be49af7bd68d04f;p=ric-plt%2Fric-dep.git diff --git a/helm/infrastructure/subcharts/kong/templates/service-kong-portal-api.yaml b/helm/infrastructure/subcharts/kong/templates/service-kong-portal-api.yaml index 1f61ac2..710f201 100644 --- a/helm/infrastructure/subcharts/kong/templates/service-kong-portal-api.yaml +++ b/helm/infrastructure/subcharts/kong/templates/service-kong-portal-api.yaml @@ -1,50 +1,19 @@ +{{- if .Values.deployment.kong.enabled }} {{- if .Values.enterprise.enabled }} -apiVersion: v1 -kind: Service -metadata: - name: {{ template "kong.fullname" . }}-portalapi - annotations: - {{- range $key, $value := .Values.portalapi.annotations }} - {{ $key }}: {{ $value | quote }} - {{- end }} - labels: - {{- include "kong.metaLabels" . | nindent 4 }} -spec: - type: {{ .Values.portalapi.type }} - {{- if eq .Values.portalapi.type "LoadBalancer" }} - {{- if .Values.portalapi.loadBalancerIP }} - loadBalancerIP: {{ .Values.portalapi.loadBalancerIP }} - {{- end }} - {{- if .Values.portalapi.loadBalancerSourceRanges }} - loadBalancerSourceRanges: - {{- range $cidr := .Values.portalapi.loadBalancerSourceRanges }} - - {{ $cidr }} - {{- end }} - {{- end }} - {{- end }} - externalIPs: - {{- range $ip := .Values.portalapi.externalIPs }} - - {{ $ip }} - {{- end }} - ports: - {{- if .Values.portalapi.http.enabled }} - - name: kong-portalapi - port: {{ .Values.portalapi.http.servicePort }} - targetPort: {{ .Values.portalapi.http.containerPort }} - {{- if (and (eq .Values.portalapi.type "NodePort") (not (empty .Values.portalapi.http.nodePort))) }} - nodePort: {{ .Values.portalapi.http.nodePort }} - {{- end }} - protocol: TCP - {{- end }} - {{- if or .Values.portalapi.tls.enabled }} - - name: kong-portalapi-tls - port: {{ .Values.portalapi.tls.servicePort }} - targetPort: {{ .Values.portalapi.tls.containerPort }} - {{- if (and (eq .Values.portalapi.type "NodePort") (not (empty .Values.portalapi.tls.nodePort))) }} - nodePort: {{ .Values.portalapi.tls.nodePort }} - {{- end }} - protocol: TCP - {{- end }} - selector: - {{- include "kong.selectorLabels" . | nindent 4 }} +{{- if and .Values.portalapi.enabled (or .Values.portalapi.http.enabled .Values.portalapi.tls.enabled) -}} +{{- $serviceConfig := dict -}} +{{- $serviceConfig := merge $serviceConfig .Values.portalapi -}} +{{- $_ := set $serviceConfig "ingressVersion" (include "kong.ingressVersion" .) -}} +{{- $_ := set $serviceConfig "fullName" (include "kong.fullname" .) -}} +{{- $_ := set $serviceConfig "namespace" (include "kong.namespace" .) -}} +{{- $_ := set $serviceConfig "metaLabels" (include "kong.metaLabels" .) -}} +{{- $_ := set $serviceConfig "selectorLabels" (include "kong.selectorLabels" .) -}} +{{- $_ := set $serviceConfig "serviceName" "portalapi" -}} +{{- include "kong.service" $serviceConfig }} +{{ if .Values.portalapi.ingress.enabled }} +--- +{{ include "kong.ingress" $serviceConfig }} +{{- end -}} +{{- end -}} +{{- end -}} {{- end -}}