From 1c613282b0b05e6dbc6b318c570cbf9bdbc40dc1 Mon Sep 17 00:00:00 2001 From: RadinPirouz Date: Sat, 4 Oct 2025 09:56:51 +0330 Subject: [PATCH] k8s lifecycle manifest --- .../workloads/manifests/lifecycle.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Containerization-Orchestration/Kubernetes/workloads/manifests/lifecycle.yaml 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