Merge "[AAI] Add model-loader tracing config"
[oom.git] / kubernetes / platform / components / oauth2-proxy / components / oauth2-proxy / templates / ingress.yaml
1 {{- if .Values.ingress.enabled -}}
2 {{- $serviceName := include "oauth2-proxy.fullname" . -}}
3 {{- $servicePort := .Values.service.portNumber -}}
4 {{- $ingressPath := .Values.ingress.path -}}
5 {{- $ingressPathType := .Values.ingress.pathType -}}
6 {{- $extraPaths := .Values.ingress.extraPaths -}}
7 apiVersion: {{ include "capabilities.ingress.apiVersion" . }}
8 kind: Ingress
9 metadata:
10   labels:
11     app: {{ template "oauth2-proxy.name" . }}
12 {{- include "oauth2-proxy.labels" . | indent 4 }}
13   name: {{ template "oauth2-proxy.fullname" . }}
14 {{- with .Values.ingress.annotations }}
15   annotations:
16 {{ toYaml . | indent 4 }}
17 {{- end }}
18 spec:
19   {{- if and .Values.ingress.className ( eq "true" ( include "ingress.supportsIngressClassName" . ) ) }}
20   ingressClassName: {{ .Values.ingress.className | quote }}
21   {{- end }}
22   rules:
23     {{- range $host := .Values.ingress.hosts }}
24     - host: {{ tpl $host $ | quote }}
25       http:
26         paths:
27 {{- if $extraPaths }}
28 {{ toYaml $extraPaths | indent 10 }}
29 {{- end }}
30           - path: {{ $ingressPath }}
31             {{- if eq "true" ( include "ingress.supportsPathType" $ ) }}
32             pathType: {{ $ingressPathType }}
33             {{- end }}
34             backend: {{- include "ingress.backend" ( dict "serviceName" $serviceName "servicePort" $servicePort "context" $ )  | nindent 14 }}
35     {{- end -}}
36   {{- if .Values.ingress.tls }}
37   tls:
38 {{ tpl (toYaml .Values.ingress.tls) $ | indent 4 }}
39   {{- end -}}
40 {{- end -}}