Skip to content

Commit

Permalink
fix: Handle multiple ingresses in UI helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
niallthomson committed Jan 15, 2025
1 parent 393d3cf commit f93c0cb
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
59 changes: 59 additions & 0 deletions deploy/kubernetes/charts/ui/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{{- if and .Values.ingress.enabled .Values.ingresses }}
{{- fail "Cannot set both ingress.enabled and ingresses" }}
{{- end }}
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "ui.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
Expand Down Expand Up @@ -51,3 +54,59 @@ spec:
number: {{ $svcPort }}
{{- end }}
{{- end }}
{{- if .Values.ingresses }}
{{- $fullName := include "ui.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- range .Values.ingresses }}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}-{{ .name }}
labels:
{{- include "ui.labels" $ | nindent 4 }}
{{- with .annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .className }}
ingressClassName: {{ .className }}
{{- end }}
{{- if .tls }}
tls:
{{- range .tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- if .hosts }}
{{- range .hosts }}
- host: {{ . | quote }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- end }}
{{- else }}
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
17 changes: 17 additions & 0 deletions deploy/kubernetes/charts/ui/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,23 @@ endpoints:
ingress:
enabled: false
# className: ""
annotations: {}
# alb.ingress.kubernetes.io/scheme: internet-facing
# alb.ingress.kubernetes.io/target-type: ip
# alb.ingress.kubernetes.io/healthcheck-path: /actuator/health/liveness
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
hosts: []
# - "chart-example.local"

ingresses: []
# - name: default
# className: ""
# hosts: []
# annotations: {}
# tls: []

istio:
enabled: false
Expand Down

0 comments on commit f93c0cb

Please sign in to comment.