improwised-charts/charts/erpnext/templates/deployment-worker-default.yaml

102 lines
3.4 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "erpnext.fullname" . }}-worker-d
labels:
{{- include "erpnext.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "erpnext.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "erpnext.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ template "erpnext.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.pythonImage.repository }}:{{ .Values.pythonImage.tag }}"
volumeMounts:
- name: sites-dir
mountPath: /home/frappe/frappe-bench/sites
- name: logs
mountPath: /home/frappe/frappe-bench/logs
imagePullPolicy: {{ .Values.pythonImage.pullPolicy }}
args: ["worker"]
env:
- name: "WORKER_TYPE"
value: "default"
{{- if .Values.enableProbs }}
livenessProbe:
exec:
command:
- "healthcheck.sh"
{{- if and .Values.postgresHost .Values.postgresPort }}
- "-p"
- "{{ .Values.postgresHost }}:{{ .Values.postgresPort }}"
{{- end }}
initialDelaySeconds: 100
periodSeconds: 5
readinessProbe:
exec:
command:
- "healthcheck.sh"
{{- if and .Values.postgresHost .Values.postgresPort }}
- "-p"
- "{{ .Values.postgresHost }}:{{ .Values.postgresPort }}"
{{- end }}
initialDelaySeconds: 20
periodSeconds: 5
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: sites-dir
{{- if .Values.persistence.worker.enabled }}
persistentVolumeClaim:
{{- if .Values.persistence.worker.existingClaim }}
claimName: {{ .Values.persistence.worker.existingClaim }}
{{- else }}
claimName: {{ template "erpnext.fullname" . }}
{{- end }}
readOnly: false
{{- else }}
emptyDir: {}
{{- end }}
- name: logs
{{- if .Values.persistence.logs.enabled }}
persistentVolumeClaim:
{{- if .Values.persistence.logs.existingClaim }}
claimName: {{ .Values.persistence.logs.existingClaim }}
{{- else }}
claimName: {{ template "erpnext.fullname" . }}-logs
{{- end }}
readOnly: false
{{- 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 }}