Skip to content

Instantly share code, notes, and snippets.

@wuestkamp
Last active February 21, 2020 23:34
Show Gist options
  • Save wuestkamp/50863c57ef1c6dd126c3fc62e9ba2448 to your computer and use it in GitHub Desktop.
Save wuestkamp/50863c57ef1c6dd126c3fc62e9ba2448 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
volumes:
- name: share
emptyDir: {}
containers:
- name: sidecar
volumeMounts:
- mountPath: /share
name: share
lifecycle:
preStop:
exec:
command: ["sh", "-c", "while ! [ -f /share/kill_sidecar ]; do sleep 1; done; kill -2 1"]
image: python-flask
- name: agent
volumeMounts:
- mountPath: /share
name: share
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;
touch /share/kill_sidecar
image: my-symfony-agent-image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment