Add standalone R3 RIC platform helm charts and deployment scripts.
[ric-plt/ric-dep.git] / helm / infrastructure / subcharts / kong / templates / service-kong-portal-api.yaml
diff --git a/helm/infrastructure/subcharts/kong/templates/service-kong-portal-api.yaml b/helm/infrastructure/subcharts/kong/templates/service-kong-portal-api.yaml
new file mode 100755 (executable)
index 0000000..aedd1b0
--- /dev/null
@@ -0,0 +1,57 @@
+{{- 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:
+    app: {{ template "kong.name" . }}
+    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+    release: "{{ .Release.Name }}"
+    heritage: "{{ .Release.Service }}"
+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:
+    app: {{ template "kong.name" . }}
+    release: {{ .Release.Name }}
+    component: app
+{{- end -}}