-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathingress.yaml
More file actions
52 lines (52 loc) · 1.52 KB
/
ingress.yaml
File metadata and controls
52 lines (52 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "generic-govuk-app.fullname" . }}
{{- $svcPort := .Values.service.port -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Values.ingress.name | default $fullName }}
labels:
{{- include "generic-govuk-app.labels" . | nindent 4 }}
app: {{ $fullName }}
app.kubernetes.io/name: {{ $fullName }}
app.kubernetes.io/component: app
some-other-label: something
annotations:
{{- (tpl (toYaml .Values.ingress.annotations) .) | trim | nindent 4 }}
spec:
{{- if .Values.ingress.tls }}
tls:
- hosts:
{{- range .Values.ingress.tls }}
- {{ . | quote }}
{{- end }}
{{- end }}
rules:
{{- with .Values.ingress.rules }}
{{- . | toYaml | nindent 4 }}
{{- end }}
{{- range .Values.ingress.hosts }}
- host: {{ (tpl .name $) | quote }}
http:
paths:
- path: {{ .path | default "/" | quote }}
pathType: {{ default "Prefix" .pathType }}
backend:
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- if .extraPaths }}
{{- toYaml .extraPaths | nindent 10 }}
{{- end }}
{{- if $.Values.ingress.redirect }}
- path: /
pathType: Prefix
backend:
service:
name: {{ $fullName }}-redirect
port:
name: use-annotation
{{- end }}
{{- end }}
{{- end }}