86 lines
3.2 KiB
YAML
86 lines
3.2 KiB
YAML
{{- if .Values.worker.enabled -}}
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "django.fullname" . }}-worker
|
|
labels:
|
|
{{- include "django.labels" . | nindent 4 }}
|
|
app.kubernetes.io/component: worker
|
|
spec:
|
|
replicas: {{ .Values.worker.replicaCount }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "django.selectorLabels" . | nindent 6 }}
|
|
app.kubernetes.io/component: worker
|
|
template:
|
|
metadata:
|
|
annotations:
|
|
checksum/secret: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
|
|
checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
|
tag: "{{ .Values.image.tag }}"
|
|
{{- if .Values.worker.podAnnotations }}
|
|
{{- include "common.tplvalues.render" ( dict "value" .Values.worker.podAnnotations "context" $ ) | nindent 8 }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "django.selectorLabels" . | nindent 8 }}
|
|
app.kubernetes.io/component: worker
|
|
spec:
|
|
{{- with .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
serviceAccountName: {{ include "django.serviceAccountName" . }}
|
|
securityContext:
|
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
containers:
|
|
- name: {{ .Chart.Name }}
|
|
{{- if .Values.worker.args }}
|
|
args: {{- toYaml .Values.worker.args | nindent 10}}
|
|
{{- end }}
|
|
securityContext:
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
{{- if .Values.worker.livenessProbe.enabled }}
|
|
livenessProbe:
|
|
initialDelaySeconds: {{ .Values.worker.livenessProbe.initialDelaySeconds }}
|
|
periodSeconds: {{ .Values.worker.livenessProbe.periodSeconds }}
|
|
timeoutSeconds: {{ .Values.worker.livenessProbe.timeoutSeconds }}
|
|
exec:
|
|
command: {{ .Values.worker.livenessProbe.command }}
|
|
{{- end }}
|
|
resources:
|
|
{{- toYaml .Values.worker.resources | nindent 12 }}
|
|
env:
|
|
- name: SERVER_ROLE
|
|
value: "worker"
|
|
{{- if .Values.postgresql.enabled }}
|
|
- name: DATABASE_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ default (include "django.postgresql.fullname" .) .Values.postgresql.auth.existingSecret }}
|
|
key: postgres-password
|
|
{{- end }}
|
|
envFrom:
|
|
- secretRef:
|
|
name: {{ include "django.fullname" . }}
|
|
{{- if .Values.existingSecret }}
|
|
- secretRef:
|
|
name: {{ .Values.existingSecret }}
|
|
{{- end }}
|
|
- configMapRef:
|
|
name: {{ include "django.fullname" . }}
|
|
{{- with .Values.worker.nodeSelector }}
|
|
nodeSelector:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.worker.affinity }}
|
|
affinity:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.worker.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- end }}
|