Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No port for job queue consumer #376

Merged
merged 3 commits into from
Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions src/akeneo/docker/image/job-queue-consumer/root/bin/readiness.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

function task_database_available()
{
local command=""

if [ "${DB_PLATFORM}" == "mysql" ]; then
command="mysqladmin -h $DB_HOST -u ${DB_ADMIN_USER:-$DB_USER} -p${DB_ROOT_PASS:-${DB_ADMIN_PASS:-$DB_PASS}} ping --connect_timeout=10"
elif [ "${DB_PLATFORM}" == "postgres" ]; then
command="pg_isready -h $DB_HOST"
elif [ "${DB_PLATFORM}" == "" ]; then
# no database is used
return
else
(>&2 echo "invalid database type")
exit 1
fi

local counter=0

while ! $command &> /dev/null; do

if (( counter > 300 )); then
(>&2 echo "timeout while waiting on ${DB_PLATFORM} to become available")
exit 1
fi

sleep 2
((++counter))
done
}

task_database_available
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,16 @@ spec:
{{- end }}
image: {{ .Values.docker.image.job_queue_consumer | default $service.image | quote }}
imagePullPolicy: Always
ports:
- containerPort: 9000
resources:
limits:
memory: {{ .Values.resources.memory.job_queue_consumer }}
requests:
memory: {{ .Values.resources.memory.job_queue_consumer }}
readinessProbe:
tcpSocket:
port: 9000
initialDelaySeconds: 5
exec:
command:
- /bin/readiness.sh
Copy link
Contributor

@andytson-inviqa andytson-inviqa Sep 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, I had thought the app/sidekick stuff (so app state) was copied into php-fpm, but seems not

initialDelaySeconds: 20
periodSeconds: 10
volumeMounts:
{{- if not (and (eq "" (include "application.volumeMounts.backend" .)) (eq "" (include "application.volumeMounts.all" .)) ) }}
Expand Down