Skip to content

Instantly share code, notes, and snippets.

@wuestkamp
Last active February 21, 2020 22:01
Show Gist options
  • Save wuestkamp/9db81572ccbeff99397e02f6508b61ca to your computer and use it in GitHub Desktop.
Save wuestkamp/9db81572ccbeff99397e02f6508b61ca to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: Pod
metadata:
name: runner
spec:
terminationGracePeriodSeconds: 3600 # one hour!
containers:
- command:
- sh
- -c
- >
touch /tmp/messaging &&
while ! [ -f /tmp/kill_me ];
do
cat /tmp/messaging;
rm /tmp/messaging && touch /tmp/messaging;
sleep 1;
done
image: bash
name: runner
lifecycle:
postStart:
exec:
command: ["sh", "-c", "echo postStart >> /tmp/messaging"]
preStop:
exec:
command: ["sh", "-c", "echo preStop >> /tmp/messaging && sleep 10 && touch /tmp/kill_me"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment