diff --git a/charts/xslt-playground/Chart.yaml b/charts/xslt-playground/Chart.yaml index f444cf9e..f132d6ad 100644 --- a/charts/xslt-playground/Chart.yaml +++ b/charts/xslt-playground/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: xslt-playground description: Helm chart for xslt-playground frontend and backend -version: 0.1.0 +version: 0.1.1 appVersion: "0.1.0" diff --git a/charts/xslt-playground/README.md b/charts/xslt-playground/README.md index 2b72092c..db107074 100644 --- a/charts/xslt-playground/README.md +++ b/charts/xslt-playground/README.md @@ -18,6 +18,8 @@ Key parameters in `values.yaml`: - `ingress` – configure ingress for the frontend service. The backend is exposed through a second ingress using the hostname `backend.` with the same settings. +- `frontend.backendUrl` – value for `VITE_BACKEND_URL` used by the frontend. + When empty it defaults to the internal backend service URL. - `hpa` – enable CPU-based autoscaling for both deployments. When `firebase.enabled` is true you must create the secret before installing the chart: diff --git a/charts/xslt-playground/templates/frontend-deployment.yaml b/charts/xslt-playground/templates/frontend-deployment.yaml index b2d17b77..125ffd23 100644 --- a/charts/xslt-playground/templates/frontend-deployment.yaml +++ b/charts/xslt-playground/templates/frontend-deployment.yaml @@ -22,7 +22,7 @@ spec: imagePullPolicy: {{ .Values.image.frontend.pullPolicy }} env: - name: VITE_BACKEND_URL - value: http://{{ include "xslt-playground.fullname" . }}-backend:{{ .Values.service.backend.port }} + value: {{ default (printf "http://%s-backend:%d" (include "xslt-playground.fullname" .) .Values.service.backend.port) .Values.frontend.backendUrl | quote }} {{- if .Values.firebase.enabled }} - name: VITE_FIREBASE_CONFIG valueFrom: diff --git a/charts/xslt-playground/values.yaml b/charts/xslt-playground/values.yaml index 9c298e2a..8841c40a 100644 --- a/charts/xslt-playground/values.yaml +++ b/charts/xslt-playground/values.yaml @@ -58,3 +58,8 @@ storage: enabled: true databaseUrl: postgres://postgres:postgres@db/xslt?sslmode=disable +frontend: + # URL used by the frontend to reach the backend. Defaults to the + # internal service URL when empty. + backendUrl: "" +