Skip to content

Instantly share code, notes, and snippets.

@wuestkamp
Last active March 10, 2020 11:54
Show Gist options
  • Save wuestkamp/237be313e4ffa0752ce3b649f557fa87 to your computer and use it in GitHub Desktop.
Save wuestkamp/237be313e4ffa0752ce3b649f557fa87 to your computer and use it in GitHub Desktop.
apiVersion: apps/v1
kind: Deployment
metadata:
name: agent
spec:
replicas: 8
selector:
matchLabels:
id: agent-pod
template:
metadata:
labels:
id: agent-pod
spec:
terminationGracePeriodSeconds: 3600
containers:
- name: agent
lifecycle:
preStop:
exec:
command: ["sh", "-c", "touch /tmp/kill_me"]
command:
- /bin/sh
- -c
- >
sleep 3 && rm -rf var/cache/* && bin/console cache:clear &&
while ! [ -f /tmp/kill_me ];
do
bin/console messenger:consume queue --limit=1 --time-limit=60 -vv
done;
image: my-symfony-agent-image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment