1+ {{ range .Values.app.queues }}
2+ {{ $resources := .resources | default $.Values.app.resources }}
3+ {{ $tolerations := .tolerations | default $.Values.app.tolerations }}
4+ {{ $nodeSelector := .nodeSelector | default $.Values.app.nodeSelector }}
5+ {{ $affinity := .affinity | default $.Values.app.affinity }}
6+ {{ $name := required "Queue name is required" .name }}
7+ {{ $volumeMounts := .volumeMounts | default $.Values.app.volumeMounts }}
8+ {{ $volumes := .volumes | default $.Values.app.volumes }}
9+ {{ $nodeSelector := .nodeSelector | default $.Values.app.nodeSelector }}
10+ {{ $image := .image | default $.Values.app.image }}
11+ {{ $extraEnvVars := .envVars | default dict }}
12+ ---
13+ apiVersion : apps/v1
14+ kind : Deployment
15+ metadata :
16+ name : {{ include "app.fullname" . }}-{{ $name }}
17+ labels :
18+ {{- include "app.labels" . | nindent 4 }}
19+ spec :
20+ # for now this application is a single process + thread
21+ replicas : 1
22+ selector :
23+ matchLabels :
24+ component : {{ $.Values.app.name }}
25+ queue : {{ $name }}
26+ template :
27+ metadata :
28+ labels :
29+ queue : {{ $name }}
30+ {{- include "app.selectorLabels" . | nindent 8 }}
31+ spec :
32+ {{- if .serviceAccountName }}
33+ serviceAccountName : {{ .serviceAccountName }}
34+ {{- else }}
35+ serviceAccountName : {{ include "app.serviceAccountName" $ }}
36+ {{- end }}
37+ {{- with $affinity }}
38+ affinity :
39+ {{ toYaml . | nindent 8 }}
40+ {{- end }}
41+ {{- with $nodeSelector }}
42+ nodeSelector :
43+ {{ toYaml . | nindent 8 }}
44+ {{- end }}
45+ {{- with $tolerations }}
46+ tolerations :
47+ {{ toYaml . | nindent 8 }}
48+ {{- end }}
49+ containers :
50+ - name : {{ $.Values.app.name }}
51+ image : {{ $image.repo }}:{{ $image.tag }}
52+ {{- if .command -}}
53+ command : {{ toYaml .command | nindent 10 }}
54+ {{- else -}}
55+ command : ["uv"]
56+ {{- end }}
57+ {{- if .args -}}
58+ args : {{ toYaml .args | nindent 10 }}
59+ {{- else }}
60+ args :
61+ - run
62+ - --directory
63+ - warehouse/scheduler
64+ - scheduler
65+ - run
66+ - " {{ $name }}"
67+ {{- end }}
68+ imagePullPolicy : Always
69+ ports :
70+ - containerPort : 8000
71+ {{- with $resources }}
72+ resources :
73+ {{ toYaml . | nindent 10 }}
74+ {{- end }}
75+ {{- with $volumeMounts }}
76+ volumeMounts :
77+ {{- toYaml . | nindent 10 }}
78+ {{- end }}
79+ env :
80+ {{- range $key, $value := $.Values.app.envVars }}
81+ - name : {{ $key }}
82+ value : {{ $value | quote }}
83+ {{- end }}
84+ {{- range $key, $value := $extraEnvVars }}
85+ - name : {{ $key }}
86+ value : {{ $value | quote }}
87+ {{- end }}
88+ {{- range $.Values.app.rawEnvVars }}
89+ {{- toYaml . | nindent 12 }}
90+ {{- end }}
91+ {{- with $volumes }}
92+ volumes :
93+ {{- toYaml . | nindent 8 }}
94+ {{- end }}
95+ {{- end }}
0 commit comments