93 lines
3.0 KiB
YAML
93 lines
3.0 KiB
YAML
{{- if .Values.backend.enabled }}
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "movienight.fullname" . }}-backend
|
|
labels:
|
|
{{- include "movienight.componentLabels" (dict "root" . "component" "backend") | nindent 4 }}
|
|
{{- with .Values.global.annotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
replicas: {{ .Values.backend.replicaCount }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "movienight.componentSelectorLabels" (dict "root" . "component" "backend") | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
{{- include "movienight.componentSelectorLabels" (dict "root" . "component" "backend") | nindent 8 }}
|
|
{{- with .Values.backend.podLabels }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.backend.podAnnotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
spec:
|
|
serviceAccountName: {{ include "movienight.serviceAccountName" . }}
|
|
{{- with .Values.global.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.backend.podSecurityContext }}
|
|
securityContext:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- $postgresEnv := include "movienight.postgresEnv" . | trim }}
|
|
containers:
|
|
- name: backend
|
|
image: "{{ .Values.backend.image.repository }}:{{ .Values.backend.image.tag }}"
|
|
imagePullPolicy: {{ .Values.backend.image.pullPolicy }}
|
|
{{- with .Values.backend.securityContext }}
|
|
securityContext:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
ports:
|
|
- name: http
|
|
containerPort: {{ .Values.backend.service.port }}
|
|
protocol: TCP
|
|
{{- if or $postgresEnv .Values.backend.env }}
|
|
env:
|
|
{{- if $postgresEnv }}
|
|
{{- $postgresEnv | nindent 12 }}
|
|
{{- end }}
|
|
{{- with .Values.backend.env }}
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- with .Values.backend.envFrom }}
|
|
envFrom:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with .Values.backend.startupProbe }}
|
|
startupProbe:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with .Values.backend.livenessProbe }}
|
|
livenessProbe:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with .Values.backend.readinessProbe }}
|
|
readinessProbe:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with .Values.backend.resources }}
|
|
resources:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with .Values.backend.nodeSelector }}
|
|
nodeSelector:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.backend.affinity }}
|
|
affinity:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.backend.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- end }}
|