Files
OptimCloud-gw-ui/helm/templates/ingress.yaml
Carsten Schafer 73e3efd92f Set ingress class name if requested
Signed-off-by: Carsten Schafer <Carsten.Schafer@kinarasystems.com>
2024-02-09 15:29:11 -05:00

64 lines
1.8 KiB
YAML

{{- $root := . -}}
{{- range $ingress, $ingressValue := .Values.ingresses }}
{{- if $ingressValue.enabled }}
---
apiVersion: {{ include "owgwui.ingress.apiVersion" $root }}
kind: Ingress
metadata:
name: {{ include "owgwui.fullname" $root }}-{{ $ingress }}
labels:
app.kubernetes.io/name: {{ include "owgwui.name" $root }}
helm.sh/chart: {{ include "owgwui.chart" $root }}
app.kubernetes.io/instance: {{ $root.Release.Name }}
app.kubernetes.io/managed-by: {{ $root.Release.Service }}
{{- with $ingressValue.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if $ingressValue.className }}
ingressClassName: {{ $ingressValue.className }}
{{- end }}
{{- if $ingressValue.tls }}
tls:
{{- range $ingressValue.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ tpl .secretName $root }}
{{- end }}
{{- end }}
rules:
{{- range $ingressValue.hosts }}
- host: {{ . | quote }}
http:
paths:
{{- range $ingressValue.paths }}
- path: {{ .path }}
{{- if $root.Capabilities.APIVersions.Has "networking.k8s.io/v1" }}
pathType: {{ .pathType | default "ImplementationSpecific" }}
{{- end }}
backend:
{{- if $root.Capabilities.APIVersions.Has "networking.k8s.io/v1" }}
service:
name: {{ include "owgwui.fullname" $root }}-{{ .serviceName }}
port:
{{- if kindIs "string" .servicePort }}
name: {{ .servicePort }}
{{- else }}
number: {{ .servicePort }}
{{- end }}
{{- else }}
serviceName: {{ include "owgwui.fullname" $root }}-{{ .serviceName }}
servicePort: {{ .servicePort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}