Skip to content

Commit a906875

Browse files
committed
fix: add support for Ingress v1
1 parent a9ed998 commit a906875

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

charts/lighthouse-webui-plugin/templates/ingress.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{- if .Values.ingress.enabled -}}
22

33
---
4-
apiVersion: networking.k8s.io/v1beta1
4+
apiVersion: {{ .Values.ingress.apiVersion }}
55
kind: Ingress
66
metadata:
77
name: {{ include "webui.fullname" . }}
@@ -21,6 +21,7 @@ metadata:
2121
{{- end }}
2222
spec:
2323
rules:
24+
{{- if eq .Values.ingress.apiVersion "networking.k8s.io/v1beta1" }}
2425
{{- range .Values.ingress.hosts }}
2526
- host: {{ tpl . $ }}
2627
http:
@@ -29,6 +30,20 @@ spec:
2930
serviceName: {{ include "webui.fullname" $ }}
3031
servicePort: http
3132
{{- end }}
33+
{{- else }}
34+
{{- $pathType := .Values.ingress.pathType | default "ImplementationSpecific" -}}
35+
{{- range .Values.ingress.hosts }}
36+
- host: {{ tpl . $ }}
37+
http:
38+
paths:
39+
- pathType: {{ $pathType }}
40+
backend:
41+
service:
42+
name: {{ include "webui.fullname" $ }}
43+
port:
44+
name: http
45+
{{- end }}
46+
{{- end }}
3247

3348
{{- if .Values.ingress.tls.enabled }}
3449
tls:

charts/lighthouse-webui-plugin/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ ingress:
7676
labels: {}
7777
annotations: {}
7878

79+
apiVersion: "networking.k8s.io/v1beta1"
80+
pathType: "ImplementationSpecific"
81+
7982
# hosts:
8083
# - lighthouse.example.com
8184
# - lighthouse.foo.bar

0 commit comments

Comments
 (0)