---
apiVersion: v1
kind: Pod
metadata:
  name: hook-demo2
  labels:
    app: hook
spec:
  containers:
    - name: hook-demo2
      image: nginx
      ports:
        - containerPort: 80
      volumeMounts:
        - mountPath: /usr/share
          name: message
      lifecycle:
        preStop:
          exec:
            command:
              - /bin/sh
              - -c
              - echo Hello from the preStop Handler > /usr/share/message
  volumes:
    - name: message
      hostPath:
        path: /tmp