You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.5 KiB
YAML

{{- $version := .Capabilities.KubeVersion.GitVersion -}}
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "cvat.fullname" . -}}
{{- if semverCompare ">=1.19-0" $version -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" $version -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "cvat.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if semverCompare ">=1.19-0" $version }}
ingressClassName: nginx
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if .pathType }}
pathType: {{ .pathType }}
{{- end }}
{{- if semverCompare ">=1.19-0" $version }}
backend:
service:
name: {{ .service.name }}
port:
number: {{ .service.port }}
{{- else }}
backend:
serviceName: {{ .service.name }}
servicePort: {{ .service.port }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}