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 }}
name: http
protocol: TCP
{{- with .Values.frontend.env }}
env:
{{- range $key, $value := . }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
{{- end }}
volumeMounts:
- name: env-config
mountPath: /usr/share/nginx/html/env.js
subPath: env.js
livenessProbe:
httpGet:
path: /
@ -67,4 +64,7 @@ spec:
memory: {{ .Values.frontend.resources.requests.memory }}
limits:
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
path: /
pathType: Prefix
environment:
VITE_API_URL: "https://api.yourdomain.com"
env:
API_BASE: "https://api.yourdomain.com"
ingress:
enabled: true

View File

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