@@ -182,3 +182,128 @@ spec:
182182 tolerations :
183183 {{- toYaml . | nindent 8 }}
184184 {{- end }}
185+ ---
186+ apiVersion : apps/v1
187+ kind : Deployment
188+ metadata :
189+ name : {{ include "core.artifactBackendWorker" . }}
190+ labels :
191+ {{- include "core.labels" . | nindent 4 }}
192+ app.kubernetes.io/component : artifact-backend-worker
193+ annotations :
194+ rollme : {{ randAlphaNum 5 | quote }}
195+ {{- with .Values.artifactBackendWorker.annotations }}
196+ {{- toYaml . | nindent 4 }}
197+ {{- end }}
198+ spec :
199+ strategy :
200+ type : {{ .Values.updateStrategy.type }}
201+ {{- if eq .Values.updateStrategy.type "RollingUpdate" }}
202+ rollingUpdate :
203+ maxSurge : {{ .Values.updateStrategy.rollingUpdate.maxSurge }}
204+ maxUnavailable : {{ .Values.updateStrategy.rollingUpdate.maxUnavailable }}
205+ {{- else}}
206+ rollingUpdate : null
207+ {{- end }}
208+ {{- if not .Values.artifactBackendWorker.autoscaling.enabled }}
209+ replicas : {{ .Values.artifactBackendWorker.replicaCount }}
210+ {{- end }}
211+ selector :
212+ matchLabels :
213+ {{- include "core.matchLabels" . | nindent 6 }}
214+ app.kubernetes.io/component : artifact-backend-worker
215+ template :
216+ metadata :
217+ labels :
218+ {{- include "core.matchLabels" . | nindent 8 }}
219+ app.kubernetes.io/component : artifact-backend-worker
220+ annotations :
221+ checksum/config : {{ include (print $.Template.BasePath "/artifact-backend/configmap.yaml") . | sha256sum }}
222+ {{- with .Values.artifactBackendWorker.podAnnotations }}
223+ {{- toYaml . | nindent 8 }}
224+ {{- end }}
225+ spec :
226+ # Distroless nonroot:nonroot is 65532:65532
227+ securityContext :
228+ runAsUser : 65532
229+ runAsGroup : 65532
230+ {{- if .Values.artifactBackend.serviceAccountName }}
231+ serviceAccountName : {{ .Values.artifactBackend.serviceAccountName }}
232+ {{- end }}
233+ automountServiceAccountToken : {{ .Values.artifactBackend.automountServiceAccountToken | default false }}
234+ terminationGracePeriodSeconds : 120
235+ {{- with .Values.imagePullSecrets }}
236+ imagePullSecrets :
237+ {{- toYaml . | nindent 8 }}
238+ {{- end }}
239+ initContainers :
240+ {{- with .Values.artifactBackendWorker.extraInitFirstContainers }}
241+ {{- toYaml . | nindent 8 }}
242+ {{- end }}
243+ {{- if .Values.database.enabled }}
244+ - name : wait-for-db
245+ image : {{ .Values.database.image.repository }}:{{ .Values.database.image.tag }}
246+ imagePullPolicy : {{ $.Values.database.image.pullPolicy }}
247+ command : ['sh', '-c', "until pg_isready; do echo waiting for db; sleep 2; done"]
248+ env :
249+ - name : PGHOST
250+ value : {{ include "core.database" . }}
251+ - name : PGUSER
252+ value : {{ include "core.database.username" . }}
253+ {{- end }}
254+ - name : wait-for-dependencies
255+ image : curlimages/curl:8.00.1
256+ command : ['sh', '-c']
257+ args :
258+ - >
259+ while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' ${ARTIFACT_BACKEND_HOST}:${ARTIFACT_BACKEND_PORT}/v1alpha/health/artifact)" != "200" ]]; do echo waiting for artifact-backend; sleep 1; done
260+ env :
261+ - name : ARTIFACT_BACKEND_HOST
262+ value : " {{ include " core.artifactBackend" . }}"
263+ - name : ARTIFACT_BACKEND_PORT
264+ value : " {{ include " core.artifactBackend.publicPort" . }}"
265+ {{- with .Values.artifactBackend.extraInitContainers }}
266+ {{- toYaml . | nindent 8 }}
267+ {{- end }}
268+ containers :
269+ - name : artifact-backend-worker
270+ image : {{ .Values.artifactBackend.image.repository }}:{{ .Values.artifactBackend.image.tag }}
271+ imagePullPolicy : {{ .Values.artifactBackend.image.pullPolicy }}
272+ livenessProbe :
273+ tcpSocket :
274+ port : rpc
275+ {{- if .Values.artifactBackendWorker.resources }}
276+ resources :
277+ {{- toYaml .Values.artifactBackendWorker.resources | nindent 12 }}
278+ {{- end }}
279+ command : ["./{{ .Values.artifactBackendWorker.commandName.worker }}"]
280+ env :
281+ {{- if .Values.artifactBackendWorker.extraEnv }}
282+ {{- toYaml .Values.artifactBackendWorker.extraEnv | nindent 12 }}
283+ {{- end }}
284+ volumeMounts :
285+ - name : config
286+ mountPath : {{ .Values.artifactBackend.configPath }}
287+ subPath : config.yaml
288+ {{- with .Values.artifactBackend.extraVolumeMounts }}
289+ {{- toYaml . | nindent 12 }}
290+ {{- end }}
291+ volumes :
292+ - name : config
293+ configMap :
294+ name : {{ include "core.artifactBackend" . }}
295+ {{- with .Values.artifactBackend.extraVolumes }}
296+ {{- toYaml . | nindent 8 }}
297+ {{- end }}
298+ {{- with .Values.artifactBackendWorker.nodeSelector }}
299+ nodeSelector :
300+ {{- toYaml . | nindent 8 }}
301+ {{- end }}
302+ {{- with .Values.artifactBackendWorker.affinity }}
303+ affinity :
304+ {{- toYaml . | nindent 8 }}
305+ {{- end }}
306+ {{- with .Values.artifactBackendWorker.tolerations }}
307+ tolerations :
308+ {{- toYaml . | nindent 8 }}
309+ {{- end }}
0 commit comments