40107cb7799106d98f6f3a6aed394a4f235d1a84
[it/dep.git] / ric-platform / 50-RIC-Platform / helm / kong / charts / kong / templates / service-kong-admin.yaml
1 apiVersion: v1
2 kind: Service
3 metadata:
4   name: {{ template "kong.fullname" . }}-admin
5   annotations:
6     {{- range $key, $value := .Values.admin.annotations }}
7       {{ $key }}: {{ $value | quote }}
8     {{- end }}
9   labels:
10     app: {{ template "kong.name" . }}
11     chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
12     release: "{{ .Release.Name }}"
13     heritage: "{{ .Release.Service }}"
14 spec:
15   type: {{ .Values.admin.type }}
16   {{- if eq .Values.admin.type "LoadBalancer" }}
17   {{- if .Values.admin.loadBalancerIP }}
18   loadBalancerIP: {{ .Values.admin.loadBalancerIP }}
19   {{- end }}
20   {{- if .Values.admin.loadBalancerSourceRanges }}
21   loadBalancerSourceRanges:
22   {{- range $cidr := .Values.admin.loadBalancerSourceRanges }}
23   - {{ $cidr }}
24   {{- end }}
25   {{- end }}
26   {{- end }}
27   ports:
28   - name: kong-admin
29     port: {{ .Values.admin.servicePort }}
30     targetPort: {{ .Values.admin.containerPort }}
31   {{- if (and (eq .Values.admin.type "NodePort") (not (empty .Values.admin.nodePort))) }}
32     nodePort: {{ .Values.admin.nodePort }}
33   {{- end }}
34     protocol: TCP
35   selector:
36     app: {{ template "kong.name" . }}
37     release: {{ .Release.Name }}
38     component: app