blob: ee47f8b8d99cb2d54b76a403ec1cc6b8b8945509 [file] [log] [blame]
gio16bb6382025-05-21 18:42:40 +04001{{- if .Values.ingress.enabled }}
2{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
3apiVersion: networking.k8s.io/v1
4{{- else -}}
5apiVersion: networking.k8s.io/v1beta1
6{{- end }}
7kind: Ingress
8metadata:
9 name: longhorn-ingress
10 namespace: {{ include "release_namespace" . }}
11 labels: {{- include "longhorn.labels" . | nindent 4 }}
12 app: longhorn-ingress
13 annotations:
14 {{- if .Values.ingress.secureBackends }}
15 ingress.kubernetes.io/secure-backends: "true"
16 {{- end }}
17 {{- range $key, $value := .Values.ingress.annotations }}
18 {{ $key }}: {{ $value | quote }}
19 {{- end }}
20spec:
21 {{- if and .Values.ingress.ingressClassName (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
22 ingressClassName: {{ .Values.ingress.ingressClassName }}
23 {{- end }}
24 rules:
25 - host: {{ .Values.ingress.host }}
26 http:
27 paths:
28 - path: {{ default "" .Values.ingress.path }}
29 {{- if (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
30 pathType: ImplementationSpecific
31 {{- end }}
32 backend:
33 {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
34 service:
35 name: longhorn-frontend
36 port:
37 number: 80
38 {{- else }}
39 serviceName: longhorn-frontend
40 servicePort: 80
41 {{- end }}
42{{- if .Values.ingress.tls }}
43 tls:
44 - hosts:
45 - {{ .Values.ingress.host }}
46 secretName: {{ .Values.ingress.tlsSecret }}
47{{- end }}
48{{- end }}