This commit is contained in:
thaoduc
2025-10-08 23:37:43 +07:00
parent 610882c57d
commit 4c123eee1b
7 changed files with 443 additions and 71 deletions

View File

@@ -1,21 +1,34 @@
{{- if .Values.ingress.enabled -}}
{{- if .Values.app.ingress.enabled -}}
{{- $fullName := include "ls-app.fullname" . -}}
{{- $svcPort := .Values.app.service.port -}}
{{- if and .Values.app.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.app.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.app.ingress.annotations "kubernetes.io/ingress.class" .Values.app.ingress.className}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ include "label-studio.fullname" . }}
name: {{ $fullName }}
labels:
{{- include "label-studio.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
{{- include "ls-app.labels" . | nindent 4 }}
{{- with .Values.app.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with .Values.ingress.className }}
ingressClassName: {{ . }}
{{- if and .Values.app.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.app.ingress.className | quote }}
{{- end }}
{{- if .Values.ingress.tls }}
{{- if .Values.app.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
{{- range .Values.app.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
@@ -24,20 +37,29 @@ spec:
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
- host: {{ .Values.app.ingress.host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- with .pathType }}
pathType: {{ . }}
{{- end }}
{{- if .Values.app.ingress.extraPaths }}
{{- toYaml .Values.app.ingress.extraPaths | nindent 10 }}
{{- end }}
- path: {{ default "/" .Values.app.ingress.path }}
pathType: {{ .Values.app.ingress.pathType }}
backend:
service:
name: {{ include "label-studio.fullname" $ }}
name: {{ $fullName }}
port:
number: {{ $.Values.service.port }}
{{- end }}
number: {{ $svcPort }}
{{- range .Values.app.ingress.extraHosts }}
- host: {{ .name }}
http:
paths:
- path: {{ default "/" .path }}
pathType: {{ default "ImplementationSpecific" .pathType }}
backend:
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- end }}
{{- end }}