Skip to content

Instantly share code, notes, and snippets.

@muralidharan-rade
Last active July 31, 2020 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muralidharan-rade/5b22b60df2ac9aca99cc5fe7ac22b2c2 to your computer and use it in GitHub Desktop.
Save muralidharan-rade/5b22b60df2ac9aca99cc5fe7ac22b2c2 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: Pod
metadata:
name: demopod
spec:
containers:
- image: demo:web
name: demo-container
ports:
- containerPort: 8080
lifecycle:
postStart:
exec:
command: ["/bin/sh", "-c", "echo Hello from the postStart handler > /usr/share/message"]
preStop:
exec:
command: ["/bin/sh", "-c", "echo Stopping server > /usr/share/message1; sleep 10; sh /usr/local/tomcat/bin/catalina.sh stop"]
terminationGracePeriodSeconds: 45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment