Move Kong to infra deployment
[it/dep.git] / ric-infra / 30-Kong / helm / kong / charts / kong / templates / service-kong-proxy.yaml
1 apiVersion: v1
2 kind: Service
3 metadata:
4   name: {{ template "kong.fullname" . }}-proxy
5   annotations:
6     {{- range $key, $value := .Values.proxy.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.proxy.type }}
16   {{- if eq .Values.proxy.type "LoadBalancer" }}
17   {{- if .Values.proxy.loadBalancerIP }}
18   loadBalancerIP: {{ .Values.proxy.loadBalancerIP }}
19   {{- end }}
20   {{- if .Values.proxy.loadBalancerSourceRanges }}
21   loadBalancerSourceRanges:
22   {{- range $cidr := .Values.proxy.loadBalancerSourceRanges }}
23   - {{ $cidr }}
24   {{- end }}
25   {{- end }}
26   {{- end }}
27   externalIPs:
28   {{- range $ip := .Values.proxy.externalIPs }}
29   - {{ $ip }}
30   {{- end }}
31   ports:
32   {{- if .Values.proxy.http.enabled }}
33   - name: kong-proxy
34     port: {{ .Values.proxy.http.servicePort }}
35     targetPort: {{ .Values.proxy.http.containerPort }}
36   {{- if (and (eq .Values.proxy.type "NodePort") (not (empty .Values.proxy.http.nodePort))) }}
37     nodePort: {{ .Values.proxy.http.nodePort }}
38   {{- end }}
39     protocol: TCP
40   {{- end }}
41   {{- if or .Values.proxy.tls.enabled }}
42   - name: kong-proxy-tls
43     port: {{ .Values.proxy.tls.servicePort }}
44     targetPort: {{ .Values.proxy.tls.containerPort }}
45   {{- if (and (eq .Values.proxy.type "NodePort") (not (empty .Values.proxy.tls.nodePort))) }}
46     nodePort: {{ .Values.proxy.tls.nodePort }}
47   {{- end }}
48     protocol: TCP
49   {{- end }}
50   {{- if .Values.proxy.externalTrafficPolicy }}
51   externalTrafficPolicy: {{ .Values.proxy.externalTrafficPolicy }}
52   {{- end }}
53
54   selector:
55     app: {{ template "kong.name" . }}
56     release: {{ .Release.Name }}
57     component: app