2024-01-29 14:37:59 +00:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: {{ include "tandoor-recipes.fullname" . }}
|
|
|
|
labels:
|
|
|
|
{{- include "tandoor-recipes.labels" . | nindent 4 }}
|
|
|
|
spec:
|
|
|
|
replicas: {{ .Values.replicaCount }}
|
|
|
|
strategy:
|
|
|
|
type: Recreate
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
{{- include "tandoor-recipes.selectorLabels" . | nindent 6 }}
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
{{- with .Values.podAnnotations }}
|
|
|
|
annotations:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
labels:
|
|
|
|
{{- include "tandoor-recipes.selectorLabels" . | nindent 8 }}
|
|
|
|
spec:
|
|
|
|
{{- with .Values.imagePullSecrets }}
|
|
|
|
imagePullSecrets:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
serviceAccountName: {{ include "tandoor-recipes.serviceAccountName" . }}
|
|
|
|
securityContext:
|
|
|
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
|
|
containers:
|
|
|
|
- name: {{ .Chart.Name }}
|
|
|
|
securityContext:
|
|
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
|
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
|
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
|
|
ports:
|
|
|
|
- name: http
|
|
|
|
containerPort: {{ .Values.service.port }}
|
|
|
|
protocol: TCP
|
|
|
|
env:
|
|
|
|
- name: DB_ENGINE
|
|
|
|
value: django.db.backends.postgresql
|
|
|
|
- name: POSTGRES_HOST
|
|
|
|
value: {{ include "tandoor-recipes.postgresql.host" . }}
|
|
|
|
- name: POSTGRES_PORT
|
|
|
|
value: {{ include "tandoor-recipes.postgresql.port" . | quote }}
|
|
|
|
- name: POSTGRES_USER
|
|
|
|
value: {{ include "tandoor-recipes.postgresql.username" . }}
|
2024-01-29 15:37:05 +00:00
|
|
|
{{- if or .Values.postgresql.enabled .Values.externalPostgresql.existingSecret }}
|
2024-01-29 14:37:59 +00:00
|
|
|
- name: POSTGRES_PASSWORD
|
2024-01-29 15:37:05 +00:00
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
{{- if .Values.postgresql.enabled }}
|
|
|
|
name: {{ .Values.postgresql.existingSecret | default (include "tandoor-recipes.postgresql.fullname" .) }}
|
|
|
|
key: password
|
|
|
|
{{- else }}
|
|
|
|
name: {{ .Values.externalPostgresql.existingSecret }}
|
|
|
|
key: {{ .Values.externalPostgresql.existingSecretPasswordKey }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2024-01-29 14:37:59 +00:00
|
|
|
- name: POSTGRES_DB
|
|
|
|
value: {{ include "tandoor-recipes.postgresql.database" . }}
|
|
|
|
- name: SECRET_KEY
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: recipes-secret-key
|
|
|
|
key: password
|
|
|
|
livenessProbe:
|
|
|
|
httpGet:
|
2024-03-16 17:29:41 +00:00
|
|
|
path: /accounts/login/
|
2024-01-29 14:37:59 +00:00
|
|
|
port: http
|
2024-03-16 17:29:41 +00:00
|
|
|
startupProbe:
|
2024-01-29 14:37:59 +00:00
|
|
|
httpGet:
|
2024-03-16 17:29:41 +00:00
|
|
|
path: /accounts/login/
|
2024-01-29 14:37:59 +00:00
|
|
|
port: http
|
2024-03-16 17:29:41 +00:00
|
|
|
periodSeconds: 3
|
|
|
|
failureThreshold: 30
|
2024-01-29 14:37:59 +00:00
|
|
|
resources:
|
|
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
|
|
volumeMounts:
|
|
|
|
- name: static
|
|
|
|
mountPath: /opt/recipes/staticfiles
|
|
|
|
- name: media
|
|
|
|
mountPath: /opt/recipes/mediafiles
|
|
|
|
volumes:
|
|
|
|
- name: static
|
|
|
|
{{- if .Values.persistence.static.enabled }}
|
|
|
|
persistentVolumeClaim:
|
|
|
|
claimName: {{ if .Values.persistence.static.existingClaim }}{{ .Values.persistence.static.existingClaim }}{{- else }}{{ template "tandoor-recipes.fullname" . }}-static-pvc{{- end }}
|
|
|
|
{{- else }}
|
|
|
|
emptyDir: {}
|
|
|
|
{{- end }}
|
|
|
|
- name: media
|
|
|
|
{{- if .Values.persistence.media.enabled }}
|
|
|
|
persistentVolumeClaim:
|
|
|
|
claimName: {{ if .Values.persistence.media.existingClaim }}{{ .Values.persistence.media.existingClaim }}{{- else }}{{ template "tandoor-recipes.fullname" . }}-media-pvc{{- end }}
|
|
|
|
{{- else }}
|
|
|
|
emptyDir: {}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.nodeSelector }}
|
|
|
|
nodeSelector:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.affinity }}
|
|
|
|
affinity:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.tolerations }}
|
|
|
|
tolerations:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|