-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
Problem
The current Ingress template fails when paths is empty under hosts. This results in an invalid Ingress resource, causing Helm to throw an error.
Suggested Fix
Modify the template to ensure paths always has at least one entry, with a default value of / and pathType: Prefix, which is a common and functional default.
Additionally, the ingressClassName field should be explicitly included if .Values.ingress.className is set, as this is now a standard Kubernetes annotation.
Proposed Changes
- Update the
values.yamldefault configuration to ensurepathsis never empty:
ingress:
enabled: true
hosts:
- host: example.com
paths:
- path: /
pathType: Prefix
tls:
- hosts:
- example.com
secretName: example-tls- Modify the Ingress template to include a default path and
ingressClassName:
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "langflow.fullname" . -}}
{{- $svcPort := .Values.langflow.frontend.service.port -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "langflow.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with .Values.ingress.className }}
ingressClassName: {{ . }}
{{- 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:
{{- if .paths }}
{{- range .paths }}
- path: {{ .path | quote }}
pathType: {{ .pathType | default "Prefix" | quote }}
backend:
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- end }}
{{- else }}
- path: "/"
pathType: "Prefix"
backend:
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}This change ensures:
- Ingress always has at least one path (
/) to prevent Helm from failing. ingressClassNameis included when defined, improving compatibility with Kubernetes updates.
Would love to get this merged to improve reliability when deploying via Helm! 🚀
matthewoflynn-dxrx and Naroh091
Metadata
Metadata
Assignees
Labels
No labels