gui/charts/nebulous-gui/templates/deployment.yaml
jmarchel a52fd60366 Add new config to deployment
Change-Id: I5fed8bda442fffeee9dc6ffa16033898b60266d0
2024-03-04 12:20:50 +01:00

90 lines
2.8 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "nebulous-gui.fullname" . }}
labels:
{{- include "nebulous-gui.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "nebulous-gui.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "nebulous-gui.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "nebulous-gui.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
initContainers:
- name: {{ .Chart.Name }}-builder
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.builderImage.repository }}:{{ .Values.builderImage.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.builderImage.pullPolicy }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
command:
- npx
- vite
- build
volumeMounts:
- name: static-files
mountPath: /app/dist
env:
{{- toYaml .Values.builderEnv | nindent 12 }}
containers:
- name: {{ .Chart.Name }}-server
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.serverImage.repository }}:{{ .Values.serverImage.tag }}"
imagePullPolicy: {{ .Values.serverImage.pullPolicy }}
ports:
- name: http
containerPort: 80
protocol: TCP
env:
- name: NODE_ENV
value: "{{ .Values.env.NODE_ENV }}"
- name: VITE_API_URL
value: "{{ .Values.env.VITE_API_URL }}"
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: static-files
mountPath: /usr/share/nginx/html
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: static-files
emptyDir: {}