Extend K8S and RIC installation instructions
[it/dep.git] / ric-infra / 30-Kong / helm / kong / charts / kong / templates / service-kong-portal-api.yaml
1 {{- if .Values.enterprise.enabled }}
2 apiVersion: v1
3 kind: Service
4 metadata:
5   name: {{ template "kong.fullname" . }}-portalapi
6   annotations:
7     {{- range $key, $value := .Values.portalapi.annotations }}
8       {{ $key }}: {{ $value | quote }}
9     {{- end }}
10   labels:
11     app: {{ template "kong.name" . }}
12     chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
13     release: "{{ .Release.Name }}"
14     heritage: "{{ .Release.Service }}"
15 spec:
16   type: {{ .Values.portalapi.type }}
17   {{- if eq .Values.portalapi.type "LoadBalancer" }}
18   {{- if .Values.portalapi.loadBalancerIP }}
19   loadBalancerIP: {{ .Values.portalapi.loadBalancerIP }}
20   {{- end }}
21   {{- if .Values.portalapi.loadBalancerSourceRanges }}
22   loadBalancerSourceRanges:
23   {{- range $cidr := .Values.portalapi.loadBalancerSourceRanges }}
24   - {{ $cidr }}
25   {{- end }}
26   {{- end }}
27   {{- end }}
28   externalIPs:
29   {{- range $ip := .Values.portalapi.externalIPs }}
30   - {{ $ip }}
31   {{- end }}
32   ports:
33   {{- if .Values.portalapi.http.enabled }}
34   - name: kong-portalapi
35     port: {{ .Values.portalapi.http.servicePort }}
36     targetPort: {{ .Values.portalapi.http.containerPort }}
37   {{- if (and (eq .Values.portalapi.type "NodePort") (not (empty .Values.portalapi.http.nodePort))) }}
38     nodePort: {{ .Values.portalapi.http.nodePort }}
39   {{- end }}
40     protocol: TCP
41   {{- end }}
42   {{- if or .Values.portalapi.tls.enabled }}
43   - name: kong-portalapi-tls
44     port: {{ .Values.portalapi.tls.servicePort }}
45     targetPort: {{ .Values.portalapi.tls.containerPort }}
46   {{- if (and (eq .Values.portalapi.type "NodePort") (not (empty .Values.portalapi.tls.nodePort))) }}
47     nodePort: {{ .Values.portalapi.tls.nodePort }}
48   {{- end }}
49     protocol: TCP
50   {{- end }}
51
52
53   selector:
54     app: {{ template "kong.name" . }}
55     release: {{ .Release.Name }}
56     component: app
57 {{- end -}}