fix template

This commit is contained in:
dvirlabs 2025-12-17 16:07:25 +02:00
parent 35d3db7400
commit 17f5a900d5
4 changed files with 25 additions and 12 deletions

View File

@ -38,13 +38,10 @@ spec:
- containerPort: {{ .Values.frontend.service.targetPort }} - containerPort: {{ .Values.frontend.service.targetPort }}
name: http name: http
protocol: TCP protocol: TCP
{{- with .Values.frontend.env }} volumeMounts:
env: - name: env-config
{{- range $key, $value := . }} mountPath: /usr/share/nginx/html/env.js
- name: {{ $key }} subPath: env.js
value: {{ $value | quote }}
{{- end }}
{{- end }}
livenessProbe: livenessProbe:
httpGet: httpGet:
path: / path: /
@ -67,4 +64,7 @@ spec:
memory: {{ .Values.frontend.resources.requests.memory }} memory: {{ .Values.frontend.resources.requests.memory }}
limits: limits:
cpu: {{ .Values.frontend.resources.limits.cpu }} cpu: {{ .Values.frontend.resources.limits.cpu }}
memory: {{ .Values.frontend.resources.limits.memory }} memory: {{ .Values.frontend.resources.limits.memory }} volumes:
- name: env-config
configMap:
name: {{ .Release.Name }}-frontend-env-config

View File

@ -0,0 +1,13 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-frontend-env-config
namespace: {{ .Values.global.namespace }}
labels:
app: {{ .Release.Name }}-{{ .Values.frontend.name }}
component: frontend
data:
env.js: |
window.__ENV__ = {
API_BASE: "{{ .Values.frontend.env.API_BASE }}"
};

View File

@ -66,8 +66,8 @@ frontend:
host: yourdomain.com host: yourdomain.com
path: / path: /
pathType: Prefix pathType: Prefix
environment: env:
VITE_API_URL: "https://api.yourdomain.com" API_BASE: "https://api.yourdomain.com"
ingress: ingress:
enabled: true enabled: true

View File

@ -71,8 +71,8 @@ frontend:
host: app.lab.local host: app.lab.local
path: / path: /
pathType: Prefix pathType: Prefix
environment: env:
VITE_API_URL: "http://api.lab.local" API_BASE: "http://api.lab.local"
ingress: ingress:
enabled: true enabled: true