Merge "[AAI] Add model-loader tracing config"
[oom.git] / kubernetes / platform / components / oauth2-proxy / components / oauth2-proxy / templates / service.yaml
1 apiVersion: v1
2 kind: Service
3 metadata:
4   labels:
5     app: {{ template "oauth2-proxy.name" . }}
6 {{- include "oauth2-proxy.labels" . | indent 4 }}
7   name: {{ template "oauth2-proxy.fullname" . }}
8 {{- if .Values.service.annotations }}
9   annotations:
10 {{ toYaml .Values.service.annotations | indent 4 }}
11 {{- end }}
12 spec:
13 {{- if (or (eq .Values.service.type "ClusterIP") (empty .Values.service.type)) }}
14   type: ClusterIP
15   {{- if .Values.service.clusterIP }}
16   clusterIP: {{ .Values.service.clusterIP }}
17   {{end}}
18 {{- else if eq .Values.service.type "LoadBalancer" }}
19   type: {{ .Values.service.type }}
20   {{- if .Values.service.loadBalancerIP }}
21   loadBalancerIP: {{ .Values.service.loadBalancerIP }}
22   {{- end }}
23   {{- if .Values.service.loadBalancerSourceRanges }}
24   loadBalancerSourceRanges:
25 {{ toYaml .Values.service.loadBalancerSourceRanges | indent 4 }}
26   {{- end -}}
27 {{- else }}
28   type: {{ .Values.service.type }}
29 {{- end }}
30   ports:
31     - port: {{ .Values.service.portNumber }}
32       targetPort: {{ .Values.httpScheme }}
33       {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }}
34       nodePort: {{ .Values.service.nodePort }}
35       {{- end }}
36       protocol: TCP
37       {{- with .Values.service.appProtocol }}
38       appProtocol: {{ . }}
39       {{- end }}
40       name: {{ .Values.httpScheme }}
41     {{- if and .Values.metrics.enabled .Values.metrics.port }}
42     - port: {{ .Values.metrics.port }}
43       protocol: TCP
44       {{- with .Values.metrics.service.appProtocol }}
45       appProtocol: {{ . }}
46       {{- end }}
47       targetPort: metrics
48       {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.metrics.nodePort))) }}
49       nodePort: {{ .Values.metrics.nodePort }}
50       {{- end }}
51       name: metrics
52     {{- end }}
53   selector:
54     {{- include "oauth2-proxy.selectorLabels" . | indent 4 }}