{{- $name := include "hrbox.component" (dict "ctx" . "name" "conductor") -}} {{/* Планировщик задач по расписанию. Строго одна реплика: два планировщика запустили бы каждую задачу дважды. По той же причине стратегия Recreate, а не RollingUpdate. */}} --- apiVersion: apps/v1 kind: Deployment metadata: name: {{ $name }} labels: {{- include "hrbox.labels" (dict "ctx" . "name" "conductor") | nindent 4 }} spec: replicas: 1 strategy: type: Recreate selector: matchLabels: {{- include "hrbox.selectorLabels" (dict "ctx" . "name" "conductor") | nindent 6 }} template: metadata: labels: {{- include "hrbox.selectorLabels" (dict "ctx" . "name" "conductor") | nindent 8 }} app: conductor annotations: prometheus.io/scrape: 'true' prometheus.io/port: '8080' prometheus.io/path: '/metrics' checksum/app-secret: {{ include (print $.Template.BasePath "/00-app-secret.yaml") . | sha256sum }} spec: affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100 podAffinityTerm: labelSelector: matchExpressions: - key: app operator: In values: - conductor topologyKey: kubernetes.io/hostname {{- include "hrbox.imagePullSecrets" . | nindent 6 }} containers: - name: conductor image: {{ .Values.image.conductor | quote }} imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http containerPort: 8080 env: {{- include "envs_all" . | indent 12 }} {{- include "hrbox.resources" (dict "ctx" . "component" "conductor") | indent 10 }} livenessProbe: httpGet: path: /health port: 8080 initialDelaySeconds: 10 periodSeconds: 30 timeoutSeconds: 5 failureThreshold: 3 readinessProbe: httpGet: path: /health port: 8080 initialDelaySeconds: 10 periodSeconds: 30 timeoutSeconds: 5 failureThreshold: 3 lifecycle: preStop: exec: command: - /bin/sh - -c - "sleep 5"