From e780ca6d9dee185de37bf6f000d4418b5dcfe2b7 Mon Sep 17 00:00:00 2001 From: Jan Christoph Beyer Date: Tue, 7 Sep 2021 10:56:40 +0200 Subject: [PATCH] docs(kubernetes): add example for messenger deployment --- deployment/kubernetes.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/deployment/kubernetes.md b/deployment/kubernetes.md index 3805ebd6998..9ea33e1bd1a 100644 --- a/deployment/kubernetes.md +++ b/deployment/kubernetes.md @@ -96,3 +96,33 @@ We noticed that some tiller RBAC trouble occurred. You can usually resolve it by Please, see the [related issue](https://github.com/kubernetes/helm/issues/3130) for further details / information. You can also take a look at the [related documentation](https://github.com/kubernetes/helm/blob/master/docs/rbac.md) + +## Symfony Messenger + +Running Pods with the Messenger Component to consume queues requires additions to the Helm chart. + +Start by creating a new template for the queue-worker-deployment. The `deployment.yaml` can be used as template, the caddy container and all unused ENV variables should be removed. + +Add the following lines under `containers` to overwrite the command. + + command: + {{ range .Values.queue_worker.command }} + - {{ . | quote }} + {{ end }} + args: + {{ range .Values.queue_worker.commandArgs }} + - {{ . | quote }} + {{ end }} + +Here is an example on how to use it from your `values.yaml`: + + command: ['bin/console'] + commandArgs: ['messenger:consume', 'async', '--memory-limit=100M'] + +The `readinessProbe` and the `livenessProble` can not use the default `docker-healthcheck` but should test if the command is running. + + readinessProbe: + exec: + command: ["/bin/sh", "-c", "/bin/ps -ef | grep messenger:consume | grep -v grep"] + initialDelaySeconds: 120 + periodSeconds: 3