mirror of
https://github.com/wardviaene/kubernetes-course.git
synced 2026-07-11 06:39:16 +00:00
pod lifecycle
This commit is contained in:
35
pod-lifecycle/lifecycle.yaml
Normal file
35
pod-lifecycle/lifecycle.yaml
Normal file
@@ -0,0 +1,35 @@
|
||||
kind: Deployment
|
||||
apiVersion: apps/v1beta1
|
||||
metadata:
|
||||
name: lifecycle
|
||||
spec:
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: lifecycle
|
||||
spec:
|
||||
initContainers:
|
||||
- name: init
|
||||
image: busybox
|
||||
command: ['sh', '-c', 'sleep 10']
|
||||
containers:
|
||||
- name: lifecycle-container
|
||||
image: busybox
|
||||
command: ['sh', '-c', 'echo $(date +%s): Running >> /timing && echo "The app is running!" && /bin/sleep 120']
|
||||
readinessProbe:
|
||||
exec:
|
||||
command: ['sh', '-c', 'echo $(date +%s): readinessProbe >> /timing']
|
||||
initialDelaySeconds: 35
|
||||
livenessProbe:
|
||||
exec:
|
||||
command: ['sh', '-c', 'echo $(date +%s): livenessProbe >> /timing']
|
||||
initialDelaySeconds: 35
|
||||
timeoutSeconds: 30
|
||||
lifecycle:
|
||||
postStart:
|
||||
exec:
|
||||
command: ['sh', '-c', 'echo $(date +%s): postStart >> /timing && sleep 10 && echo $(date +%s): end postStart >> /timing']
|
||||
preStop:
|
||||
exec:
|
||||
command: ['sh', '-c', 'echo $(date +%s): preStop >> /timing && sleep 10']
|
||||
Reference in New Issue
Block a user