Add init container and cm for front
This commit is contained in:
parent
7cadc006d3
commit
727495f7c1
@ -12,12 +12,33 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app: navix-frontend
|
app: navix-frontend
|
||||||
spec:
|
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:
|
containers:
|
||||||
- name: frontend
|
- name: frontend
|
||||||
image: "{{ .Values.frontend.image.repository }}:{{ .Values.frontend.image.tag }}"
|
image: "{{ .Values.frontend.image.repository }}:{{ .Values.frontend.image.tag }}"
|
||||||
imagePullPolicy: {{ .Values.frontend.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.frontend.image.pullPolicy }}
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 80
|
- containerPort: 80
|
||||||
env:
|
volumeMounts:
|
||||||
- name: VITE_API_URL
|
- name: env-volume
|
||||||
value: "http://navix-backend.{{ .Release.Namespace }}.svc.cluster.local:8000"
|
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