2525 tolerations :
2626 {{- toYaml .Values.global.tolerations | nindent 8 }}
2727 {{- end }}
28+ initContainers :
29+ - name : wait-for-redis
30+ image : busybox:1.36
31+ command :
32+ - sh
33+ - -c
34+ - |
35+ echo "Waiting for Redis to be ready..."
36+ until nc -z redis-service 6379; do
37+ echo "Redis is unavailable - sleeping"
38+ sleep 2
39+ done
40+ echo "Redis is ready!"
41+ resources :
42+ requests :
43+ cpu : " 10m"
44+ memory : " 16Mi"
45+ limits :
46+ cpu : " 50m"
47+ memory : " 32Mi"
2848 containers :
2949 - name : celery-worker-scheduler # Lightweight task scheduler
3050 image : {{ .Values.image.repository }}:{{ .Values.image.tag }}
4969 value : " celery"
5070 - name : CELERY_WORKER_COUNT
5171 value : " 4"
72+ - name : CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP
73+ value : " true"
74+ - name : CELERY_BROKER_CONNECTION_MAX_RETRIES
75+ value : " 10"
5276 volumeMounts :
5377 - name : credentials-volume
5478 mountPath : /code/credentials/secrets.yaml
6084 limits :
6185 cpu : {{ .Values.resources.scheduler.limits.cpu | quote }}
6286 memory : {{ .Values.resources.scheduler.limits.memory | quote }}
87+ startupProbe :
88+ exec :
89+ command :
90+ - /bin/sh
91+ - -c
92+ - " celery -A agent inspect ping -d celery@$HOSTNAME -t 5"
93+ initialDelaySeconds : 30
94+ periodSeconds : 10
95+ timeoutSeconds : 5
96+ failureThreshold : 12
97+ livenessProbe :
98+ exec :
99+ command :
100+ - /bin/sh
101+ - -c
102+ - " celery -A agent inspect ping -d celery@$HOSTNAME -t 5"
103+ initialDelaySeconds : 30
104+ periodSeconds : 30
105+ timeoutSeconds : 10
106+ failureThreshold : 3
63107
64108 - name : celery-worker-task-executor # Task executor for high-priority tasks
65109 image : {{ .Values.image.repository }}:{{ .Values.image.tag }}
@@ -84,6 +128,10 @@ spec:
84128 value : " exec"
85129 - name : CELERY_WORKER_COUNT
86130 value : " 4"
131+ - name : CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP
132+ value : " true"
133+ - name : CELERY_BROKER_CONNECTION_MAX_RETRIES
134+ value : " 10"
87135 volumeMounts :
88136 - name : credentials-volume
89137 mountPath : /code/credentials/secrets.yaml
@@ -95,6 +143,26 @@ spec:
95143 limits :
96144 cpu : {{ .Values.resources.taskExecutor.limits.cpu | quote }}
97145 memory : {{ .Values.resources.taskExecutor.limits.memory | quote }}
146+ startupProbe :
147+ exec :
148+ command :
149+ - /bin/sh
150+ - -c
151+ - " celery -A agent inspect ping -d celery@$HOSTNAME -t 5"
152+ initialDelaySeconds : 30
153+ periodSeconds : 10
154+ timeoutSeconds : 5
155+ failureThreshold : 12
156+ livenessProbe :
157+ exec :
158+ command :
159+ - /bin/sh
160+ - -c
161+ - " celery -A agent inspect ping -d celery@$HOSTNAME -t 5"
162+ initialDelaySeconds : 30
163+ periodSeconds : 30
164+ timeoutSeconds : 10
165+ failureThreshold : 3
98166
99167 - name : celery-worker-asset-extractor # Task executor for asset extraction tasks, which run rarely and are long-running
100168 image : {{ .Values.image.repository }}:{{ .Values.image.tag }}
@@ -119,6 +187,10 @@ spec:
119187 value : " asset_extraction"
120188 - name : CELERY_WORKER_COUNT
121189 value : " 3"
190+ - name : CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP
191+ value : " true"
192+ - name : CELERY_BROKER_CONNECTION_MAX_RETRIES
193+ value : " 10"
122194 volumeMounts :
123195 - name : credentials-volume
124196 mountPath : /code/credentials/secrets.yaml
@@ -130,6 +202,26 @@ spec:
130202 limits :
131203 cpu : {{ .Values.resources.assetExtractor.limits.cpu | quote }}
132204 memory : {{ .Values.resources.assetExtractor.limits.memory | quote }}
205+ startupProbe :
206+ exec :
207+ command :
208+ - /bin/sh
209+ - -c
210+ - " celery -A agent inspect ping -d celery@$HOSTNAME -t 5"
211+ initialDelaySeconds : 30
212+ periodSeconds : 10
213+ timeoutSeconds : 5
214+ failureThreshold : 12
215+ livenessProbe :
216+ exec :
217+ command :
218+ - /bin/sh
219+ - -c
220+ - " celery -A agent inspect ping -d celery@$HOSTNAME -t 5"
221+ initialDelaySeconds : 30
222+ periodSeconds : 30
223+ timeoutSeconds : 10
224+ failureThreshold : 3
133225
134226 volumes :
135227 - name : credentials-volume
0 commit comments