1
0
mirror of https://github.com/alexandrev/xslt-lab.git synced 2026-09-20 04:23:16 +00:00
Files
xslt-lab/charts/xslt-playground/templates/frontend-deployment.yaml
T

53 lines
1.7 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "xslt-playground.fullname" . }}-frontend
labels:
{{- include "xslt-playground.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount.frontend }}
selector:
matchLabels:
{{- include "xslt-playground.selectorLabels" . | nindent 6 }}
component: frontend
template:
metadata:
labels:
{{- include "xslt-playground.selectorLabels" . | nindent 8 }}
component: frontend
spec:
containers:
- name: frontend
image: "{{ .Values.image.frontend.repository }}:{{ .Values.image.frontend.tag }}"
imagePullPolicy: {{ .Values.image.frontend.pullPolicy }}
env:
- name: VITE_BACKEND_URL
value: {{ default (printf "http://%s-backend:%d" (include "xslt-playground.fullname" .) .Values.service.backend.port) .Values.frontend.backendUrl | quote }}
{{- if .Values.firebase.enabled }}
- name: VITE_FIREBASE_CONFIG
valueFrom:
secretKeyRef:
name: {{ .Values.firebase.secretName }}
key: {{ .Values.firebase.configKey }}
{{- end }}
{{- if .Values.adsTxt }}
volumeMounts:
- name: ads
mountPath: /usr/share/nginx/html/ads.txt
subPath: ads.txt
readOnly: true
{{- end }}
ports:
- containerPort: {{ .Values.service.frontend.port }}
resources: {{- toYaml .Values.resources.frontend | nindent 12 }}
{{- if .Values.adsTxt }}
volumes:
- name: ads
configMap:
name: {{ include "xslt-playground.fullname" . }}-ads
items:
- key: ads.txt
path: ads.txt
{{- end }}