---
apiVersion: v1
kind: Pod
metadata:
  name: nginx
spec:
  containers:
  - name: nginx
    image: nginx:latest
    lifecycle:
      postStart:
        exec:
          command:
            - /bin/sh
            - -c
            - 'echo postStarted > /usr/share/message'

# kubectl describe pod/nginx
# kubectl exec -it nginx -- /bin/sh -c 'cat /usr/share/message'