k8s lifecycle manifest
This commit is contained in:
@@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: lifecycle-demo
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: demo-container
|
||||||
|
image: nginx
|
||||||
|
lifecycle:
|
||||||
|
postStart:
|
||||||
|
exec:
|
||||||
|
command: ["/bin/sh", "-c", "echo 'Container started!' > /usr/share/nginx/html/index.html"]
|
||||||
|
preStop:
|
||||||
|
exec:
|
||||||
|
command: ["/bin/sh", "-c", "echo 'Container stopping...' >> /usr/share/nginx/html/index.html && sleep 10"]
|
||||||
|
terminationGracePeriodSeconds: 15
|
||||||
Reference in New Issue
Block a user