Kubernetes Container Lifecycle Events
(Redirected from Container Lifecycle Events)
Jump to navigation
Jump to search
Official example[edit]
apiVersion: v1
kind: Pod
metadata:
name: lifecycle-demo
spec:
containers:
- name: lifecycle-demo-container
image: nginx
lifecycle:
postStart:
exec:
command: ["/bin/sh", "-c", "echo Hello from the postStart handler > /usr/share/message"]
preStop:
exec:
command: ["/bin/sh","-c","nginx -s quit; while killall -0 nginx; do sleep 1; done"]
Related[edit]
See also[edit]
- Lifecycle, AWS EC2 Instance lifecycle, AWS S3 lifecycle, Container Lifecycle Events, ignore_changes, prevent_destroy, Object Lifecycle Management
- Pods,
Mypod.yml, Create and configure a basic Pod,pod (command),pod --help,pod install, List containers on a POD,livenessProbe, readinessProbe, Pod status, Static pod, Pod Security, PodReplacementPolicy
Advertising: