1
0
mirror of https://github.com/alexandrev/xslt-lab.git synced 2026-09-20 04:23:16 +00:00

Add backend ingress

This commit is contained in:
2025-07-04 11:32:32 +02:00
parent 62fa07b7e4
commit 91135377f0
2 changed files with 47 additions and 1 deletions
+3 -1
View File
@@ -15,7 +15,9 @@ Key parameters in `values.yaml`:
- `storage.enabled` disable database usage when `false`. If enabled the backend - `storage.enabled` disable database usage when `false`. If enabled the backend
gets `DATABASE_URL` from `storage.databaseUrl`; otherwise the environment gets `DATABASE_URL` from `storage.databaseUrl`; otherwise the environment
variable `DISABLE_DATABASE=true` is set. variable `DISABLE_DATABASE=true` is set.
- `ingress` configure ingress for the frontend service. - `ingress` configure ingress for the frontend service. The backend is exposed
through a second ingress using the hostname `backend.<hostname>` with the same
settings.
- `hpa` enable CPU-based autoscaling for both deployments. - `hpa` enable CPU-based autoscaling for both deployments.
When `firebase.enabled` is true you must create the secret before installing the chart: When `firebase.enabled` is true you must create the secret before installing the chart:
@@ -0,0 +1,44 @@
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "xslt-playground.fullname" . }}-backend
{{- with .Values.ingress.className }}
annotations:
kubernetes.io/ingress.class: {{ . | quote }}
{{- end }}
{{- range $k, $v := .Values.ingress.annotations }}
{{ $k }}: {{ $v | quote }}
{{- end }}
labels:
{{- include "xslt-playground.labels" $ | nindent 4 }}
spec:
{{- if .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ printf "backend.%s" .host }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
pathType: {{ .pathType }}
backend:
service:
name: {{ include "xslt-playground.fullname" $ }}-backend
port:
number: {{ $.Values.service.backend.port }}
{{- end }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ printf "backend.%s" . }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
{{- end }}