
apiVersion: v1
kind: Pod
metadata:
  name: lifecyc-pod 
spec:
  containers:
  - name: lifecyc-container
    image: nginx
    lifecycle:
      postStart:
        exec:
          command: ["/bin/sh", "-c", "echo Welcome! > /usr/share/poststart-msg"]
      preStop:
        exec:
          command: ["/usr/sbin/nginx","-s","quit"]
