Pod Lifecycle — states a Pod goes through from creation to termination.
1apiVersion: apps/v12kind: Deployment3metadata:4 name: myapp5spec:6 replicas: 27 template:8 spec:9 containers:10 - name: app11 image: myapp:latest12 lifecycle:13 postStart:14 exec:15 command:16 - sh17 - -c18 - |19 echo "Container started" > /tmp/startup.log20 wget -qO- http://config-server/config > /app/config21 preStop:22 httpGet:23 path: /shutdown24 port: 808025 httpHeaders:26 - name: X-Custom-Header27 value: shutdown28 exec:29 command:30 - sh31 - -c32 - sleep 15 && kill -TERM 133 startupProbe:34 httpGet:35 path: /healthz36 port: 808037 failureThreshold: 3038 periodSeconds: 1039 readinessProbe:40 httpGet:41 path: /ready42 port: 808043 initialDelaySeconds: 544 periodSeconds: 1045 livenessProbe:46 httpGet:47 path: /healthz48 port: 808049 initialDelaySeconds: 1550 periodSeconds: 20
Pod States:
Hooks: