Files

65 lines
2.6 KiB
YAML
Raw Permalink Normal View History

2026-06-30 16:58:52 -07:00
{{- $api := include "checkmate.api" . | fromYaml -}}
apiVersion: apps/v1
kind: Deployment
metadata:
2026-06-29 10:15:29 -07:00
name: checkmate-api
spec:
2026-06-29 10:15:29 -07:00
replicas: 1 # single scheduler — seeds/reconciles the jobs collection
selector:
matchLabels:
2026-06-29 10:15:29 -07:00
app: checkmate-api
template:
metadata:
labels:
2026-06-29 10:15:29 -07:00
app: checkmate-api
spec:
2026-06-30 16:58:52 -07:00
{{- with $api.affinity }}
2025-10-05 22:36:39 +07:00
affinity:
{{- tpl ( . | toYaml) $ | nindent 8 }}
{{- end }}
2026-06-30 16:58:52 -07:00
{{- with $api.tolerations }}
2025-10-05 22:36:39 +07:00
tolerations:
{{- tpl ( . | toYaml) $ | nindent 8 }}
{{- end }}
containers:
2026-06-29 10:15:29 -07:00
- name: api
2026-07-02 09:44:37 -07:00
image: {{ include "checkmate.image" (dict "image" $api.image "tag" $api.tag "root" $) }}
2026-06-30 16:58:52 -07:00
imagePullPolicy: {{ $api.imagePullPolicy }}
ports:
2026-06-29 14:14:42 -07:00
- name: http
2026-06-30 16:58:52 -07:00
containerPort: {{ $api.port }}
envFrom:
- secretRef:
name: checkmate-secrets
2026-06-29 14:14:42 -07:00
# Probes hit the Express /api/v1/health endpoint — proves the HTTP server is responsive.
# NOTE: this does NOT detect a wedged job loop when queuePrimaryProcesses=true (the API is
# also a worker). Worker-aware health for that mode is a follow-up — see worker-health-checks.md §7.5.
livenessProbe:
httpGet:
path: /api/v1/health
port: http
2026-06-30 16:58:52 -07:00
initialDelaySeconds: {{ $api.probes.liveness.initialDelaySeconds }}
periodSeconds: {{ $api.probes.liveness.periodSeconds }}
timeoutSeconds: {{ $api.probes.liveness.timeoutSeconds }}
failureThreshold: {{ $api.probes.liveness.failureThreshold }}
2026-06-29 14:14:42 -07:00
readinessProbe:
httpGet:
path: /api/v1/health
port: http
2026-06-30 16:58:52 -07:00
initialDelaySeconds: {{ $api.probes.readiness.initialDelaySeconds }}
periodSeconds: {{ $api.probes.readiness.periodSeconds }}
timeoutSeconds: {{ $api.probes.readiness.timeoutSeconds }}
failureThreshold: {{ $api.probes.readiness.failureThreshold }}
{{- with $api.resources }}
2025-10-05 22:36:39 +07:00
resources:
{{- tpl ( . | toYaml) $ | nindent 12 }}
{{- end }}
2025-10-01 09:16:45 +07:00
env:
- name: CLIENT_HOST
2025-10-05 22:47:48 +07:00
value: "{{ .Values.client.protocol }}://{{ .Values.client.ingress.host }}"
2026-06-29 10:15:29 -07:00
- name: QUEUE_MODE
value: "primary"
2026-06-30 09:08:01 -07:00
# Derived: when a worker tier is deployed the API only schedules (false); otherwise it is
# all-in-one and processes jobs itself (true). Keeps the two from ever competing for jobs.
- name: QUEUE_PRIMARY_PROCESSES
value: {{ not .Values.worker.enabled | quote }}