Add init container and cm for front

This commit is contained in:
dvirlabs 2025-06-06 17:11:32 +03:00
parent 7cadc006d3
commit 727495f7c1
2 changed files with 33 additions and 3 deletions

View File

@ -12,12 +12,33 @@ spec:
labels:
app: navix-frontend
spec:
initContainers:
- name: copy-env
image: busybox
command: ["sh", "-c", "cp /config/env.js /env/env.js"]
volumeMounts:
- name: env-config
mountPath: /config
- name: env-volume
mountPath: /env
containers:
- name: frontend
image: "{{ .Values.frontend.image.repository }}:{{ .Values.frontend.image.tag }}"
imagePullPolicy: {{ .Values.frontend.image.pullPolicy }}
ports:
- containerPort: 80
env:
- name: VITE_API_URL
value: "http://navix-backend.{{ .Release.Namespace }}.svc.cluster.local:8000"
volumeMounts:
- name: env-volume
mountPath: /usr/share/nginx/html/env.js
subPath: env.js
volumes:
- name: env-volume
emptyDir: {}
- name: env-config
configMap:
name: navix-frontend-env
items:
- key: env.js
path: env.js

View File

@ -0,0 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: navix-frontend-env
data:
env.js: |
window.env = {
VITE_API_URL: "http://navix-backend.{{ .Release.Namespace }}.svc.cluster.local:8000"
};