diff --git a/Containerization-Orchestration/Kubernetes/workloads/manifests/lifecycle.yaml b/Containerization-Orchestration/Kubernetes/workloads/manifests/lifecycle.yaml new file mode 100644 index 0000000..46f9d46 --- /dev/null +++ b/Containerization-Orchestration/Kubernetes/workloads/manifests/lifecycle.yaml @@ -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