{{- $name := include "hrbox.component" (dict "ctx" . "name" "worker") -}} {{/* Обработчик фоновых задач: конвертация файлов, рассылка почты и уведомлений, генерация отчётов, обслуживание Nanabush Player. Стратегия Recreate: воркеры разбирают задачи из общей очереди, и пересечение старых и новых подов во время выката привело бы к двойной обработке. Длинный terminationGracePeriodSeconds даёт закончить уже взятую задачу. */}} --- apiVersion: apps/v1 kind: Deployment metadata: name: {{ $name }} labels: {{- include "hrbox.labels" (dict "ctx" . "name" "worker") | nindent 4 }} spec: minReadySeconds: 5 strategy: type: Recreate replicas: {{ .Values.app.replicas.worker }} selector: matchLabels: {{- include "hrbox.selectorLabels" (dict "ctx" . "name" "worker") | nindent 6 }} template: metadata: labels: {{- include "hrbox.selectorLabels" (dict "ctx" . "name" "worker") | nindent 8 }} app: worker annotations: prometheus.io/scrape: 'true' prometheus.io/port: '9253' checksum/app-secret: {{ include (print $.Template.BasePath "/00-app-secret.yaml") . | sha256sum }} spec: {{- include "hrbox.imagePullSecrets" . | nindent 6 }} containers: - name: worker image: {{ .Values.image.hrbox | quote }} imagePullPolicy: {{ .Values.image.pullPolicy }} command: ["hrbox-worker"] env: {{- include "envs_all" . | indent 12 }} - name: VIDEO_CONVERTER_ENABLED value: {{ .Values.app.videoConverter.enabled | quote }} {{- include "hrbox.resources" (dict "ctx" . "component" "worker") | indent 10 }} terminationGracePeriodSeconds: 600