X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=helm%2Finfrastructure%2Fsubcharts%2Fkong%2Ftemplates%2Fservice-kong-portal.yaml;h=0be4b09b8e9a62f5a0adcfcd38258d7edd7730c0;hb=refs%2Fchanges%2F69%2F12969%2F1;hp=c75b0b766c5f64ab3d0e68026934a1d97fdf1668;hpb=7799f9c20d56ceaab38178b7083ed66e63312a0c;p=ric-plt%2Fric-dep.git diff --git a/helm/infrastructure/subcharts/kong/templates/service-kong-portal.yaml b/helm/infrastructure/subcharts/kong/templates/service-kong-portal.yaml index c75b0b7..0be4b09 100644 --- a/helm/infrastructure/subcharts/kong/templates/service-kong-portal.yaml +++ b/helm/infrastructure/subcharts/kong/templates/service-kong-portal.yaml @@ -1,50 +1,19 @@ +{{- if .Values.deployment.kong.enabled }} {{- if .Values.enterprise.enabled }} -apiVersion: v1 -kind: Service -metadata: - name: {{ template "kong.fullname" . }}-portal - annotations: - {{- range $key, $value := .Values.portal.annotations }} - {{ $key }}: {{ $value | quote }} - {{- end }} - labels: - {{- include "kong.metaLabels" . | nindent 4 }} -spec: - type: {{ .Values.portal.type }} - {{- if eq .Values.portal.type "LoadBalancer" }} - {{- if .Values.portal.loadBalancerIP }} - loadBalancerIP: {{ .Values.portal.loadBalancerIP }} - {{- end }} - {{- if .Values.portal.loadBalancerSourceRanges }} - loadBalancerSourceRanges: - {{- range $cidr := .Values.portal.loadBalancerSourceRanges }} - - {{ $cidr }} - {{- end }} - {{- end }} - {{- end }} - externalIPs: - {{- range $ip := .Values.portal.externalIPs }} - - {{ $ip }} - {{- end }} - ports: - {{- if .Values.portal.http.enabled }} - - name: kong-portal - port: {{ .Values.portal.http.servicePort }} - targetPort: {{ .Values.portal.http.containerPort }} - {{- if (and (eq .Values.portal.type "NodePort") (not (empty .Values.portal.http.nodePort))) }} - nodePort: {{ .Values.portal.http.nodePort }} - {{- end }} - protocol: TCP - {{- end }} - {{- if or .Values.portal.tls.enabled }} - - name: kong-portal-tls - port: {{ .Values.portal.tls.servicePort }} - targetPort: {{ .Values.portal.tls.containerPort }} - {{- if (and (eq .Values.portal.type "NodePort") (not (empty .Values.portal.tls.nodePort))) }} - nodePort: {{ .Values.portal.tls.nodePort }} - {{- end }} - protocol: TCP - {{- end }} - selector: - {{- include "kong.selectorLabels" . | nindent 4 }} +{{- if and .Values.portal.enabled (or .Values.portal.http.enabled .Values.portal.tls.enabled) -}} +{{- $serviceConfig := dict -}} +{{- $serviceConfig := merge $serviceConfig .Values.portal -}} +{{- $_ := 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" "portal" -}} +{{- include "kong.service" $serviceConfig }} +{{ if .Values.portal.ingress.enabled }} +--- +{{ include "kong.ingress" $serviceConfig }} +{{- end -}} +{{- end -}} +{{- end -}} {{- end -}}