apiVersion: v1
kind: Pod
metadata:
  name: pod-with-prestop-hook
spec:
  containers:
  - image: luksa/kubia
    name: kubia
    command:
    - sh
    - -c
    - 'echo "`date` start" >> /tmp/log/log.txt ; sleep 10000 ; exit 1'
    livenessProbe:
      initialDelaySeconds: 30
      exec:
        command:
        - sh
        - -c
        - "exit 1"
    volumeMounts:
    - name: log
      mountPath: /tmp/log
    lifecycle:
      preStop:
        exec:
          command: 
          - sh
          - -c
          - 'echo "`date` preStop" >> /tmp/log/log.txt'
  volumes:
  - name: log
    emptyDir:
      medium: Memory
