Add init container and cm for front
This commit is contained in:
parent
7cadc006d3
commit
727495f7c1
@ -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
|
||||
|
||||
9
navix-helm/templates/frontend-env-configmap.yaml
Normal file
9
navix-helm/templates/frontend-env-configmap.yaml
Normal 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"
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user