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" . }}
11 app: {{ template "oauth2-proxy.name" . }}
12 {{- include "oauth2-proxy.labels" . | indent 4 }}
13 name: {{ template "oauth2-proxy.fullname" . }}
14 {{- with .Values.ingress.annotations }}
16 {{ toYaml . | indent 4 }}
19 {{- if and .Values.ingress.className ( eq "true" ( include "ingress.supportsIngressClassName" . ) ) }}
20 ingressClassName: {{ .Values.ingress.className | quote }}
23 {{- range $host := .Values.ingress.hosts }}
24 - host: {{ tpl $host $ | quote }}
28 {{ toYaml $extraPaths | indent 10 }}
30 - path: {{ $ingressPath }}
31 {{- if eq "true" ( include "ingress.supportsPathType" $ ) }}
32 pathType: {{ $ingressPathType }}
34 backend: {{- include "ingress.backend" ( dict "serviceName" $serviceName "servicePort" $servicePort "context" $ ) | nindent 14 }}
36 {{- if .Values.ingress.tls }}
38 {{ tpl (toYaml .Values.ingress.tls) $ | indent 4 }}